<tt><font size=2>libvir-list-bounces@redhat.com wrote on 01/04/2011 09:46:07
AM:<br>
</font></tt>
<br><tt><font size=2>> <br>
> While doing some testing with Qemu and creating huge logfiles I <br>
> encountered the case where the VM could not start anymore due to the
<br>
> lseek() to the end of the Qemu VM's log file failing. The patch below
<br>
> replaces the two occurrences of lseek() in the relevant path with
<br>
> lseek64() and solves this problem. It may be a good idea to look at
<br>
> other occurrences of lseek() as well whether they should be replaced.
<br>
> off_t is 8 bytes long (64 bit), so it doesn't need to be replaced
with <br>
> the explicit off64_t.<br>
> <br>
> To reproduce this error, you could do the following:<br>
> <br>
> dd if=/dev/zero of=/var/log/libvirt/qemu/<name of VM>.log bs=1024
<br>
> count=$((1024*2048))<br>
> <br>
> and you should get an error like this:<br>
> <br>
> error: Failed to start domain <name of VM><br>
> error: Unable to seek to -2147482651 in /var/log/libvirt/qemu/<name
of <br>
> VM>.log: Success<br>
> <br>
> Signed-off-by: Stefan Berger <stefanb@us.ibm.com><br>
> <br>
> ---<br>
>   src/qemu/qemu_driver.c |    6 +++---<br>
>   1 file changed, 3 insertions(+), 3 deletions(-)<br>
> <br>
> Index: libvirt-acl/src/qemu/qemu_driver.c<br>
> ===================================================================<br>
> --- libvirt-acl.orig/src/qemu/qemu_driver.c<br>
> +++ libvirt-acl/src/qemu/qemu_driver.c<br>
[...]</font></tt>
<br><tt><font size=2><br>
> @@ -2624,7 +2624,7 @@ static int qemudStartVMDaemon(virConnect<br>
>                    
            enum virVMOperationType vmop)
{<br>
>       int ret;<br>
>       unsigned long long qemuCmdFlags;<br>
> -    int pos = -1;<br>
> +    off_t pos = -1;<br>
>       char ebuf[1024];<br>
>       char *pidfile = NULL;<br>
>       int logfile = -1;</font></tt>
<br>
<br><tt><font size=2>... actually this is really the only hunk that's necessary
to fix this problem.</font></tt>
<br>
<br><tt><font size=2>  Stefan</font></tt>
<br>