From 0922ff2feaeca786f14f21a369f45aa0f7cc06dc Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 4 Jan 2011 12:46:10 -0500 Subject: [PATCH] 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/.log bs=1024 count=$((1024*2048)) and you should get an error like this: error: Failed to start domain error: Unable to seek to -2147482651 in /var/log/libvirt/qemu/.log: Success --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e24ee41bb2..e915705b18 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2624,7 +2624,7 @@ static int qemudStartVMDaemon(virConnectPtr conn, 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;