[libvirt] [PATCH] qemu driver: use lseek64 for setting position in logfile

Eric Blake eblake at redhat.com
Tue Jan 4 16:23:15 UTC 2011


[hmm, are you aware that messages from you are adding a cc to
libvir-list-bounces?]

On 01/04/2011 08:02 AM, Stefan Berger wrote:
>> While doing some testing with Qemu and creating huge logfiles I 
>> encountered the case where the VM could not start anymore due to the 
>> lseek() to the end of the Qemu VM's log file failing. The patch below 
>> replaces the two occurrences of lseek() in the relevant path with 
>> lseek64() and solves this problem. It may be a good idea to look at 
>> other occurrences of lseek() as well whether they should be replaced. 
>> off_t is 8 bytes long (64 bit), so it doesn't need to be replaced with 
>> the explicit off64_t.

NACK to the bulk of this patch.  Gnulib already guarantees that we have
large-file support (and therefore, off_t should already be off64_t on
platforms that support dual mode off_t sizing); we should NOT be
explicitly referencing the non-standard off64_t or lseek64, since they
do not exist on all platforms.

>> @@ -2624,7 +2624,7 @@ static int qemudStartVMDaemon(virConnect
>>                                 enum virVMOperationType vmop) {
>>       int ret;
>>       unsigned long long qemuCmdFlags;
>> -    int pos = -1;
>> +    off_t pos = -1;
>>       char ebuf[1024];
>>       char *pidfile = NULL;
>>       int logfile = -1;
> 
> ... actually this is really the only hunk that's necessary to fix this 
> problem.

Agree that changing that one mistaken type should fix things.  Can you
resubmit as a v2 with a fixed commit message, at which point I will feel
more comfortable giving ack?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110104/b074d4d6/attachment-0001.sig>


More information about the libvir-list mailing list