]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu driver: fix positioning to end of log file
authorStefan Berger <stefanb@us.ibm.com>
Tue, 4 Jan 2011 17:46:10 +0000 (12:46 -0500)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 4 Jan 2011 17:46:10 +0000 (12:46 -0500)
commit0922ff2feaeca786f14f21a369f45aa0f7cc06dc
tree12f6aa498dcd84b3222e11b8b7f4a06dcad6ea3a
parent45829e678ebb7fc7f84db8951fa624e9d8e7464e
qemu driver: fix positioning to end of log file

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 fixes the problem by replacing the previously used 'int' with 'off_t'.

To reproduce this error, you could do the following:

dd if=/dev/zero of=/var/log/libvirt/qemu/<name of VM>.log bs=1024 count=$((1024*2048))

and you should get an error like this:

error: Failed to start domain <name of VM>
error: Unable to seek to -2147482651 in /var/log/libvirt/qemu/<name of VM>.log: Success
src/qemu/qemu_driver.c