提交 0922ff2f 编写于 作者: S Stefan Berger

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
上级 45829e67
...@@ -2624,7 +2624,7 @@ static int qemudStartVMDaemon(virConnectPtr conn, ...@@ -2624,7 +2624,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
enum virVMOperationType vmop) { enum virVMOperationType vmop) {
int ret; int ret;
unsigned long long qemuCmdFlags; unsigned long long qemuCmdFlags;
int pos = -1; off_t pos = -1;
char ebuf[1024]; char ebuf[1024];
char *pidfile = NULL; char *pidfile = NULL;
int logfile = -1; int logfile = -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册