[libvirt] [PATCH 0/7] Improve QEMU process startup error reporting

Error reporting for failed QEMU processes isn't too great at the moment. A couple cases I have hit: - Trying to start a VM with a cdrom pointing to a nonexistent file. The svirt hook function choked on this and indicated as much in the domain log, but I still had to wait for the pidfile timeout (10 seconds), and the only error reported was 'Domain did not show up'. - QEMU dies quickly at startup. Happened with the pulse audio issue, or if we build cli args incorrectly. The reporting here varies: if QEMU dies before writing out the pidfile, the above case applies. If the pidfile is written, we timeout in ReadLogOutput, and it's hit or miss whether we even report the logfile output to the user. The following patches improve the above cases by ensuring we never have to wait for a timeout, and that the logfile output is always reported in the error message. Cole Robinson (7): Add documentation for __virExec and virExec virExec: Delay daemonizing as long as possible. Add helper function virExecDaemonize Report qemu log data if we fail to daemonize the process. Add pidfile argument to __virExec Check that QEMU is still alive while reading startup output. Don't throw away QEMU startup errors when migrating. src/libvirt_private.syms | 2 +- src/proxy_internal.c | 16 +-- src/qemu_conf.c | 7 - src/qemu_driver.c | 105 +++++++---- src/remote_internal.c | 15 +-- src/uml_driver.c | 11 +- src/util.c | 186 +++++++++++++++----- src/util.h | 15 ++- .../qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-boot-floppy.args | 2 +- .../qemuxml2argv-boot-network.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-bootloader.args | 2 +- .../qemuxml2argv-clock-localtime.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args | 2 +- .../qemuxml2argv-console-compat.args | 2 +- .../qemuxml2argv-disk-cdrom-empty.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-cdrom.args | 2 +- .../qemuxml2argv-disk-drive-boot-cdrom.args | 2 +- .../qemuxml2argv-disk-drive-boot-disk.args | 2 +- .../qemuxml2argv-disk-drive-cache-v1-none.args | 2 +- .../qemuxml2argv-disk-drive-cache-v1-wb.args | 2 +- .../qemuxml2argv-disk-drive-cache-v1-wt.args | 2 +- .../qemuxml2argv-disk-drive-cache-v2-none.args | 2 +- .../qemuxml2argv-disk-drive-cache-v2-wb.args | 2 +- .../qemuxml2argv-disk-drive-cache-v2-wt.args | 2 +- .../qemuxml2argv-disk-drive-fmt-qcow.args | 2 +- .../qemuxml2argv-disk-drive-shared.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-floppy.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-disk-many.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.args | 2 +- .../qemuxml2argv-graphics-sdl.args | 2 +- .../qemuxml2argv-graphics-vnc-sasl.args | 2 +- .../qemuxml2argv-graphics-vnc-tls.args | 2 +- .../qemuxml2argv-graphics-vnc.args | 2 +- .../qemuxml2argv-hostdev-pci-address.args | 2 +- .../qemuxml2argv-hostdev-usb-address.args | 2 +- .../qemuxml2argv-hostdev-usb-product.args | 2 +- .../qemuxml2argv-input-usbmouse.args | 2 +- .../qemuxml2argv-input-usbtablet.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-input-xen.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-migrate.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-minimal.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args | 2 +- .../qemuxml2argv-misc-no-reboot.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args | 2 +- .../qemuxml2argv-net-eth-ifname.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-net-eth.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-net-virtio.args | 2 +- .../qemuxml2argv-parallel-tcp.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-restore-v1.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-restore-v2.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-dev.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-file.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-many.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-pty.args | 2 +- .../qemuxml2argv-serial-tcp-telnet.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-tcp.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-udp.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-unix.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-sound.args | 2 +- 65 files changed, 288 insertions(+), 183 deletions(-)

--- src/util.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/src/util.c b/src/util.c index b7e0362..87e215d 100644 --- a/src/util.c +++ b/src/util.c @@ -266,6 +266,26 @@ int virSetCloseExec(int fd) { return 0; } +/* + * @conn Connection to report errors against + * @argv argv to exec + * @envp optional enviroment to use for exec + * @keepfd options fd_ret to keep open for child process + * @retpid optional pointer to store child process pid + * @infd optional file descriptor to use as child input, otherwise /dev/null + * @outfd optional pointer to communicate output fd behavior + * outfd == NULL : Use /dev/null + * *outfd == -1 : Use a new fd + * *outfd != -1 : Use *outfd + * @errfd optional pointer to communcate error fd behavior. See outfd + * @flags possible combination of the following: + * VIR_EXEC_NONE : Default function behavior + * VIR_EXEC_NONBLOCK : Set child process output fd's as non-blocking + * VIR_EXEC_DAEMON : Daemonize the child process (don't use directly, + * use virExecDaemonize wrapper) + * @hook optional virExecHook function to call prior to exec + * @data data to pass to the hook function + */ static int __virExec(virConnectPtr conn, const char *const*argv, @@ -550,6 +570,13 @@ virExecWithHook(virConnectPtr conn, flags, hook, data); } +/* + * See __virExec for explanation of the arguments. + * + * Wrapper function for __virExec, with a simpler set of parameters. + * Used to insulate the numerous callers from changes to __virExec argument + * list. + */ int virExec(virConnectPtr conn, const char *const*argv, -- 1.6.2.2

On Tue, Apr 28, 2009 at 11:31:51AM -0400, Cole Robinson wrote:
--- src/util.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/util.c b/src/util.c index b7e0362..87e215d 100644 --- a/src/util.c +++ b/src/util.c @@ -266,6 +266,26 @@ int virSetCloseExec(int fd) { return 0; }
+/* + * @conn Connection to report errors against + * @argv argv to exec + * @envp optional enviroment to use for exec + * @keepfd options fd_ret to keep open for child process + * @retpid optional pointer to store child process pid + * @infd optional file descriptor to use as child input, otherwise /dev/null + * @outfd optional pointer to communicate output fd behavior + * outfd == NULL : Use /dev/null + * *outfd == -1 : Use a new fd + * *outfd != -1 : Use *outfd + * @errfd optional pointer to communcate error fd behavior. See outfd + * @flags possible combination of the following: + * VIR_EXEC_NONE : Default function behavior + * VIR_EXEC_NONBLOCK : Set child process output fd's as non-blocking + * VIR_EXEC_DAEMON : Daemonize the child process (don't use directly, + * use virExecDaemonize wrapper) + * @hook optional virExecHook function to call prior to exec + * @data data to pass to the hook function + */ static int __virExec(virConnectPtr conn, const char *const*argv, @@ -550,6 +570,13 @@ virExecWithHook(virConnectPtr conn, flags, hook, data); }
+/* + * See __virExec for explanation of the arguments. + * + * Wrapper function for __virExec, with a simpler set of parameters. + * Used to insulate the numerous callers from changes to __virExec argument + * list. + */ int virExec(virConnectPtr conn, const char *const*argv, --
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, Apr 28, 2009 at 11:31:51AM -0400, Cole Robinson wrote:
--- src/util.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/util.c b/src/util.c index b7e0362..87e215d 100644 --- a/src/util.c +++ b/src/util.c @@ -266,6 +266,26 @@ int virSetCloseExec(int fd) { return 0; }
+/* + * @conn Connection to report errors against + * @argv argv to exec + * @envp optional enviroment to use for exec + * @keepfd options fd_ret to keep open for child process + * @retpid optional pointer to store child process pid + * @infd optional file descriptor to use as child input, otherwise /dev/null + * @outfd optional pointer to communicate output fd behavior + * outfd == NULL : Use /dev/null + * *outfd == -1 : Use a new fd + * *outfd != -1 : Use *outfd + * @errfd optional pointer to communcate error fd behavior. See outfd + * @flags possible combination of the following: + * VIR_EXEC_NONE : Default function behavior + * VIR_EXEC_NONBLOCK : Set child process output fd's as non-blocking + * VIR_EXEC_DAEMON : Daemonize the child process (don't use directly, + * use virExecDaemonize wrapper) + * @hook optional virExecHook function to call prior to exec + * @data data to pass to the hook function + */ static int __virExec(virConnectPtr conn, const char *const*argv, @@ -550,6 +570,13 @@ virExecWithHook(virConnectPtr conn, flags, hook, data); }
+/* + * See __virExec for explanation of the arguments. + * + * Wrapper function for __virExec, with a simpler set of parameters. + * Used to insulate the numerous callers from changes to __virExec argument + * list. + */ int virExec(virConnectPtr conn, const char *const*argv, --
ACK
Daniel
Thanks, committed. - Cole

This way the caller can catch more errors (e.g. from a hook callback) from the intermediate process. --- src/util.c | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/util.c b/src/util.c index 87e215d..47a1cd3 100644 --- a/src/util.c +++ b/src/util.c @@ -445,7 +445,7 @@ __virExec(virConnectPtr conn, if (pthread_sigmask(SIG_SETMASK, &newmask, NULL) != 0) { virReportSystemError(conn, errno, "%s", _("cannot unblock signals")); - return -1; + _exit(1); } openmax = sysconf (_SC_OPEN_MAX); @@ -458,31 +458,6 @@ __virExec(virConnectPtr conn, !FD_ISSET(i, keepfd))) close(i); - if (flags & VIR_EXEC_DAEMON) { - if (setsid() < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot become session leader")); - _exit(1); - } - - if (chdir("/") < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot change to root directory: %s")); - _exit(1); - } - - pid = fork(); - if (pid < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot fork child process")); - _exit(1); - } - - if (pid > 0) - _exit(0); - } - - if (dup2(infd >= 0 ? infd : null, STDIN_FILENO) < 0) { virReportSystemError(conn, errno, "%s", _("failed to setup stdin file handle")); @@ -513,6 +488,33 @@ __virExec(virConnectPtr conn, if (hook) if ((hook)(data) != 0) _exit(1); + + /* Daemonize as late as possible, so the parent process can detect + * the above errors with wait* */ + if (flags & VIR_EXEC_DAEMON) { + if (setsid() < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot become session leader")); + _exit(1); + } + + if (chdir("/") < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot change to root directory: %s")); + _exit(1); + } + + pid = fork(); + if (pid < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot fork child process")); + _exit(1); + } + + if (pid > 0) + _exit(0); + } + if (envp) execve(argv[0], (char **) argv, (char**)envp); else @@ -524,8 +526,6 @@ __virExec(virConnectPtr conn, _exit(1); - return 0; - cleanup: /* This is cleanup of parent process only - child should never jump here on error */ -- 1.6.2.2

On Tue, Apr 28, 2009 at 11:31:52AM -0400, Cole Robinson wrote:
This way the caller can catch more errors (e.g. from a hook callback) from the intermediate process. --- src/util.c | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/util.c b/src/util.c index 87e215d..47a1cd3 100644 --- a/src/util.c +++ b/src/util.c @@ -445,7 +445,7 @@ __virExec(virConnectPtr conn, if (pthread_sigmask(SIG_SETMASK, &newmask, NULL) != 0) { virReportSystemError(conn, errno, "%s", _("cannot unblock signals")); - return -1; + _exit(1); }
openmax = sysconf (_SC_OPEN_MAX); @@ -458,31 +458,6 @@ __virExec(virConnectPtr conn, !FD_ISSET(i, keepfd))) close(i);
- if (flags & VIR_EXEC_DAEMON) { - if (setsid() < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot become session leader")); - _exit(1); - } - - if (chdir("/") < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot change to root directory: %s")); - _exit(1); - } - - pid = fork(); - if (pid < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot fork child process")); - _exit(1); - } - - if (pid > 0) - _exit(0); - } - - if (dup2(infd >= 0 ? infd : null, STDIN_FILENO) < 0) { virReportSystemError(conn, errno, "%s", _("failed to setup stdin file handle")); @@ -513,6 +488,33 @@ __virExec(virConnectPtr conn, if (hook) if ((hook)(data) != 0) _exit(1); + + /* Daemonize as late as possible, so the parent process can detect + * the above errors with wait* */ + if (flags & VIR_EXEC_DAEMON) { + if (setsid() < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot become session leader")); + _exit(1); + } + + if (chdir("/") < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot change to root directory: %s")); + _exit(1); + } + + pid = fork(); + if (pid < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot fork child process")); + _exit(1); + } + + if (pid > 0) + _exit(0); + } + if (envp) execve(argv[0], (char **) argv, (char**)envp); else @@ -524,8 +526,6 @@ __virExec(virConnectPtr conn,
_exit(1);
- return 0; - cleanup: /* This is cleanup of parent process only - child should never jump here on error */ --
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, Apr 28, 2009 at 11:31:52AM -0400, Cole Robinson wrote:
This way the caller can catch more errors (e.g. from a hook callback) from the intermediate process. --- src/util.c | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/util.c b/src/util.c index 87e215d..47a1cd3 100644 --- a/src/util.c +++ b/src/util.c @@ -445,7 +445,7 @@ __virExec(virConnectPtr conn, if (pthread_sigmask(SIG_SETMASK, &newmask, NULL) != 0) { virReportSystemError(conn, errno, "%s", _("cannot unblock signals")); - return -1; + _exit(1); }
openmax = sysconf (_SC_OPEN_MAX); @@ -458,31 +458,6 @@ __virExec(virConnectPtr conn, !FD_ISSET(i, keepfd))) close(i);
- if (flags & VIR_EXEC_DAEMON) { - if (setsid() < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot become session leader")); - _exit(1); - } - - if (chdir("/") < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot change to root directory: %s")); - _exit(1); - } - - pid = fork(); - if (pid < 0) { - virReportSystemError(conn, errno, - "%s", _("cannot fork child process")); - _exit(1); - } - - if (pid > 0) - _exit(0); - } - - if (dup2(infd >= 0 ? infd : null, STDIN_FILENO) < 0) { virReportSystemError(conn, errno, "%s", _("failed to setup stdin file handle")); @@ -513,6 +488,33 @@ __virExec(virConnectPtr conn, if (hook) if ((hook)(data) != 0) _exit(1); + + /* Daemonize as late as possible, so the parent process can detect + * the above errors with wait* */ + if (flags & VIR_EXEC_DAEMON) { + if (setsid() < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot become session leader")); + _exit(1); + } + + if (chdir("/") < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot change to root directory: %s")); + _exit(1); + } + + pid = fork(); + if (pid < 0) { + virReportSystemError(conn, errno, + "%s", _("cannot fork child process")); + _exit(1); + } + + if (pid > 0) + _exit(0); + } + if (envp) execve(argv[0], (char **) argv, (char**)envp); else @@ -524,8 +526,6 @@ __virExec(virConnectPtr conn,
_exit(1);
- return 0; - cleanup: /* This is cleanup of parent process only - child should never jump here on error */ --
ACK
Daniel
Thanks, committed. - Cole

Wraps __virExec with the VIR_EXEC_DAEMON flag. Waits on the intermediate process to ensure we don't end up with any zombies, and differentiates between original process errors and intermediate process errors. --- src/libvirt_private.syms | 2 +- src/proxy_internal.c | 16 ++------------ src/qemu_driver.c | 40 ++++++++++++++++--------------------- src/remote_internal.c | 15 ++----------- src/uml_driver.c | 11 ++------- src/util.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ src/util.h | 9 ++++++++ 7 files changed, 85 insertions(+), 57 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 599ec0b..ce63869 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -320,7 +320,7 @@ virEnumToString; virEventAddHandle; virEventRemoveHandle; virExec; -virExecWithHook; +virExecDaemonize; virSetCloseExec; virSetNonBlock; virFormatMacAddr; diff --git a/src/proxy_internal.c b/src/proxy_internal.c index 56e8db8..86be004 100644 --- a/src/proxy_internal.c +++ b/src/proxy_internal.c @@ -143,7 +143,6 @@ static int virProxyForkServer(void) { const char *proxyPath = virProxyFindServerPath(); - int ret, status; pid_t pid; const char *proxyarg[2]; @@ -157,20 +156,11 @@ virProxyForkServer(void) proxyarg[0] = proxyPath; proxyarg[1] = NULL; - if (virExec(NULL, proxyarg, NULL, NULL, - &pid, -1, NULL, NULL, VIR_EXEC_DAEMON) < 0) + if (virExecDaemonize(NULL, proxyarg, NULL, NULL, + &pid, -1, NULL, NULL, VIR_EXEC_DAEMON, + NULL, NULL) < 0) VIR_ERROR0("Failed to fork libvirt_proxy\n"); - /* - * do a waitpid on the intermediate process to avoid zombies. - */ -retry_wait: - ret = waitpid(pid, &status, 0); - if (ret < 0) { - if (errno == EINTR) - goto retry_wait; - } - return (0); } diff --git a/src/qemu_driver.c b/src/qemu_driver.c index f9fe2ba..cc510b2 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -1434,38 +1434,32 @@ static int qemudStartVMDaemon(virConnectPtr conn, for (i = 0 ; i < ntapfds ; i++) FD_SET(tapfds[i], &keepfd); - ret = virExecWithHook(conn, argv, progenv, &keepfd, &child, - stdin_fd, &vm->logfile, &vm->logfile, - VIR_EXEC_NONBLOCK | VIR_EXEC_DAEMON, - qemudSecurityHook, &hookData); + ret = virExecDaemonize(conn, argv, progenv, &keepfd, &child, + stdin_fd, &vm->logfile, &vm->logfile, + VIR_EXEC_NONBLOCK | VIR_EXEC_DAEMON, + qemudSecurityHook, &hookData); /* wait for qemu process to to show up */ if (ret == 0) { int retries = 100; - int childstat; - while (waitpid(child, &childstat, 0) == -1 && - errno == EINTR); + while (retries) { + if ((ret = virFileReadPid(driver->stateDir, + vm->def->name, &vm->pid)) == 0) + break; - if (childstat == 0) { - while (retries) { - if ((ret = virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) == 0) - break; - usleep(100*1000); - retries--; - } - if (ret) { - qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, - _("Domain %s didn't show up\n"), vm->def->name); - ret = -1; - } - } else { + usleep(100*1000); + retries--; + } + if (ret) { qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to daemonize QEMU process")); + _("Domain %s didn't show up\n"), vm->def->name); ret = -1; } - vm->state = migrateFrom ? VIR_DOMAIN_PAUSED : VIR_DOMAIN_RUNNING; - } + } else + ret = -1; + + vm->state = migrateFrom ? VIR_DOMAIN_PAUSED : VIR_DOMAIN_RUNNING; for (i = 0 ; argv[i] ; i++) VIR_FREE(argv[i]); diff --git a/src/remote_internal.c b/src/remote_internal.c index 24226e5..8a389bc 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -284,7 +284,6 @@ remoteForkDaemon(virConnectPtr conn) { const char *daemonPath = remoteFindDaemonPath(); const char *const daemonargs[] = { daemonPath, "--timeout=30", NULL }; - int ret, status; pid_t pid; if (!daemonPath) { @@ -292,18 +291,10 @@ remoteForkDaemon(virConnectPtr conn) return -1; } - if (virExec(NULL, daemonargs, NULL, NULL, - &pid, -1, NULL, NULL, VIR_EXEC_DAEMON) < 0) + if (virExecDaemonize(NULL, daemonargs, NULL, NULL, + &pid, -1, NULL, NULL, VIR_EXEC_DAEMON, + NULL, NULL) < 0) return -1; - /* - * do a waitpid on the intermediate process to avoid zombies. - */ - retry_wait: - ret = waitpid(pid, &status, 0); - if (ret < 0) { - if (errno == EINTR) - goto retry_wait; - } return 0; } diff --git a/src/uml_driver.c b/src/uml_driver.c index 0457f13..8673095 100644 --- a/src/uml_driver.c +++ b/src/uml_driver.c @@ -821,16 +821,11 @@ static int umlStartVMDaemon(virConnectPtr conn, for (i = 0 ; i < ntapfds ; i++) FD_SET(tapfds[i], &keepfd); - ret = virExec(conn, argv, progenv, &keepfd, &pid, - -1, &logfd, &logfd, - VIR_EXEC_DAEMON); + ret = virExecDaemonize(conn, argv, progenv, &keepfd, &pid, + -1, &logfd, &logfd, + VIR_EXEC_DAEMON, NULL, NULL); close(logfd); - /* Cleanup intermediate proces */ - if (waitpid(pid, NULL, 0) != pid) - umlLog(VIR_LOG_WARN, _("failed to wait on process: %d: %s\n"), - pid, virStrerror(errno, ebuf, sizeof ebuf)); - for (i = 0 ; argv[i] ; i++) VIR_FREE(argv[i]); VIR_FREE(argv); diff --git a/src/util.c b/src/util.c index 47a1cd3..525b07f 100644 --- a/src/util.c +++ b/src/util.c @@ -591,6 +591,55 @@ virExec(virConnectPtr conn, flags, NULL, NULL); } +/* + * See __virExec for explanation of the arguments. + * + * This function will wait for the intermediate process (between the caller + * and the daemon) to exit. retpid will be the pid of the daemon, which can + * be checked for example to see if the daemon crashed immediately. + * + * Returns 0 on success + * -1 if initial fork failed (will have a reported error) + * -2 if intermediate process failed + * (won't have a reported error. pending on where the failure + * occured and when in the process occured, the error output + * could have gone to stderr or the passed errfd). + */ +int virExecDaemonize(virConnectPtr conn, + const char *const*argv, + const char *const*envp, + const fd_set *keepfd, + pid_t *retpid, + int infd, int *outfd, int *errfd, + int flags, + virExecHook hook, + void *data) { + int ret; + int childstat = 0; + + ret = virExecWithHook(conn, argv, envp, keepfd, retpid, + infd, outfd, errfd, + flags |= VIR_EXEC_DAEMON, + hook, data); + + /* Wait for intermediate process to exit */ + while (waitpid(*retpid, &childstat, 0) == -1 && + errno == EINTR); + + /* __virExec should have set an error */ + if (ret != 0) + return -1; + + if (childstat != 0) { + ReportError(conn, VIR_ERR_INTERNAL_ERROR, + _("Intermediate daemon process exited with status %d."), + WEXITSTATUS(childstat)); + ret = -2; + } + + return ret; +} + static int virPipeReadUntilEOF(virConnectPtr conn, int outfd, int errfd, char **outbuf, char **errbuf) { diff --git a/src/util.h b/src/util.h index 4bed077..bc29b16 100644 --- a/src/util.h +++ b/src/util.h @@ -46,6 +46,15 @@ int virSetCloseExec(int fd); * after fork() but before execve() */ typedef int (*virExecHook)(void *data); +int virExecDaemonize(virConnectPtr conn, + const char *const*argv, + const char *const*envp, + const fd_set *keepfd, + pid_t *retpid, + int infd, int *outfd, int *errfd, + int flags, + virExecHook hook, + void *data); int virExecWithHook(virConnectPtr conn, const char *const*argv, const char *const*envp, -- 1.6.2.2

On Tue, Apr 28, 2009 at 11:31:53AM -0400, Cole Robinson wrote:
Wraps __virExec with the VIR_EXEC_DAEMON flag. Waits on the intermediate process to ensure we don't end up with any zombies, and differentiates between original process errors and intermediate process errors. +int virExecDaemonize(virConnectPtr conn, + const char *const*argv, + const char *const*envp, + const fd_set *keepfd, + pid_t *retpid, + int infd, int *outfd, int *errfd, + int flags, + virExecHook hook, + void *data) { + int ret; + int childstat = 0; + + ret = virExecWithHook(conn, argv, envp, keepfd, retpid, + infd, outfd, errfd, + flags |= VIR_EXEC_DAEMON, + hook, data); + + /* Wait for intermediate process to exit */ + while (waitpid(*retpid, &childstat, 0) == -1 && + errno == EINTR);
I think we should only call waitpid() if 'ret == 0', because if ret is not 0, *retpid won't have been set and will thus contain random garbage.
+ + /* __virExec should have set an error */ + if (ret != 0) + return -1; + + if (childstat != 0) { + ReportError(conn, VIR_ERR_INTERNAL_ERROR, + _("Intermediate daemon process exited with status %d."), + WEXITSTATUS(childstat)); + ret = -2; + } + + return ret; +} +
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, Apr 28, 2009 at 11:31:53AM -0400, Cole Robinson wrote:
Wraps __virExec with the VIR_EXEC_DAEMON flag. Waits on the intermediate process to ensure we don't end up with any zombies, and differentiates between original process errors and intermediate process errors. +int virExecDaemonize(virConnectPtr conn, + const char *const*argv, + const char *const*envp, + const fd_set *keepfd, + pid_t *retpid, + int infd, int *outfd, int *errfd, + int flags, + virExecHook hook, + void *data) { + int ret; + int childstat = 0; + + ret = virExecWithHook(conn, argv, envp, keepfd, retpid, + infd, outfd, errfd, + flags |= VIR_EXEC_DAEMON, + hook, data); + + /* Wait for intermediate process to exit */ + while (waitpid(*retpid, &childstat, 0) == -1 && + errno == EINTR);
I think we should only call waitpid() if 'ret == 0', because if ret is not 0, *retpid won't have been set and will thus contain random garbage.
Good catch. I've resent the series with this and your others comments addressed. Thanks, Cole

This ensures the user will actually see 'hook' function error output. --- src/qemu_driver.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index cc510b2..5200532 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -1456,8 +1456,17 @@ static int qemudStartVMDaemon(virConnectPtr conn, _("Domain %s didn't show up\n"), vm->def->name); ret = -1; } - } else - ret = -1; + } else if (ret == -2) { + /* The virExec process that launches the daemon failed. Pending on + * when it failed (we can't determine for sure), there may be + * extra info in the domain log (if the hook failed for example). + * + * Pretend like things succeeded, and let 'WaitForMonitor' report + * the log contents for us. + */ + vm->pid = child; + ret = 0; + } vm->state = migrateFrom ? VIR_DOMAIN_PAUSED : VIR_DOMAIN_RUNNING; -- 1.6.2.2

On Tue, Apr 28, 2009 at 11:31:54AM -0400, Cole Robinson wrote:
This ensures the user will actually see 'hook' function error output. --- src/qemu_driver.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c index cc510b2..5200532 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -1456,8 +1456,17 @@ static int qemudStartVMDaemon(virConnectPtr conn, _("Domain %s didn't show up\n"), vm->def->name); ret = -1; } - } else - ret = -1; + } else if (ret == -2) { + /* The virExec process that launches the daemon failed. Pending on + * when it failed (we can't determine for sure), there may be + * extra info in the domain log (if the hook failed for example). + * + * Pretend like things succeeded, and let 'WaitForMonitor' report + * the log contents for us. + */ + vm->pid = child; + ret = 0; + }
vm->state = migrateFrom ? VIR_DOMAIN_PAUSED : VIR_DOMAIN_RUNNING;
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

virExec will write out the pid of the daemonized process only. Use this in the QEMU driver, rather than QEMU's pidfile, so we can errors we might miss if the emulator bails early. --- src/proxy_internal.c | 2 +- src/qemu_conf.c | 7 --- src/qemu_driver.c | 19 ++++++-- src/remote_internal.c | 2 +- src/uml_driver.c | 2 +- src/util.c | 45 ++++++++++++++------ src/util.h | 8 +++- .../qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-boot-floppy.args | 2 +- .../qemuxml2argv-boot-network.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-bootloader.args | 2 +- .../qemuxml2argv-clock-localtime.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args | 2 +- .../qemuxml2argv-console-compat.args | 2 +- .../qemuxml2argv-disk-cdrom-empty.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-cdrom.args | 2 +- .../qemuxml2argv-disk-drive-boot-cdrom.args | 2 +- .../qemuxml2argv-disk-drive-boot-disk.args | 2 +- .../qemuxml2argv-disk-drive-cache-v1-none.args | 2 +- .../qemuxml2argv-disk-drive-cache-v1-wb.args | 2 +- .../qemuxml2argv-disk-drive-cache-v1-wt.args | 2 +- .../qemuxml2argv-disk-drive-cache-v2-none.args | 2 +- .../qemuxml2argv-disk-drive-cache-v2-wb.args | 2 +- .../qemuxml2argv-disk-drive-cache-v2-wt.args | 2 +- .../qemuxml2argv-disk-drive-fmt-qcow.args | 2 +- .../qemuxml2argv-disk-drive-shared.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-floppy.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-disk-many.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.args | 2 +- .../qemuxml2argv-graphics-sdl.args | 2 +- .../qemuxml2argv-graphics-vnc-sasl.args | 2 +- .../qemuxml2argv-graphics-vnc-tls.args | 2 +- .../qemuxml2argv-graphics-vnc.args | 2 +- .../qemuxml2argv-hostdev-pci-address.args | 2 +- .../qemuxml2argv-hostdev-usb-address.args | 2 +- .../qemuxml2argv-hostdev-usb-product.args | 2 +- .../qemuxml2argv-input-usbmouse.args | 2 +- .../qemuxml2argv-input-usbtablet.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-input-xen.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-migrate.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-minimal.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args | 2 +- .../qemuxml2argv-misc-no-reboot.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args | 2 +- .../qemuxml2argv-net-eth-ifname.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-net-eth.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-net-virtio.args | 2 +- .../qemuxml2argv-parallel-tcp.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-restore-v1.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-restore-v2.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-dev.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-file.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-many.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-pty.args | 2 +- .../qemuxml2argv-serial-tcp-telnet.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-tcp.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-udp.args | 2 +- .../qemuxml2argvdata/qemuxml2argv-serial-unix.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-sound.args | 2 +- 64 files changed, 112 insertions(+), 87 deletions(-) diff --git a/src/proxy_internal.c b/src/proxy_internal.c index 86be004..b11ec17 100644 --- a/src/proxy_internal.c +++ b/src/proxy_internal.c @@ -158,7 +158,7 @@ virProxyForkServer(void) if (virExecDaemonize(NULL, proxyarg, NULL, NULL, &pid, -1, NULL, NULL, VIR_EXEC_DAEMON, - NULL, NULL) < 0) + NULL, NULL, NULL) < 0) VIR_ERROR0("Failed to fork libvirt_proxy\n"); return (0); diff --git a/src/qemu_conf.c b/src/qemu_conf.c index 64415ec..6a687f2 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -777,7 +777,6 @@ int qemudBuildCommandLine(virConnectPtr conn, const char *emulator; char uuid[VIR_UUID_STRING_BUFLEN]; char domid[50]; - char *pidfile; const char *cpu = NULL; uname_normalize(&ut); @@ -934,9 +933,6 @@ int qemudBuildCommandLine(virConnectPtr conn, snprintf(memory, sizeof(memory), "%lu", def->maxmem/1024); snprintf(vcpus, sizeof(vcpus), "%lu", def->vcpus); snprintf(domid, sizeof(domid), "%d", def->id); - pidfile = virFilePid(driver->stateDir, def->name); - if (!pidfile) - goto error; ADD_ENV_LIT("LC_ALL=C"); @@ -999,9 +995,6 @@ int qemudBuildCommandLine(virConnectPtr conn, ADD_ARG_LIT("-monitor"); ADD_ARG_LIT("pty"); - ADD_ARG_LIT("-pidfile"); - ADD_ARG(pidfile); - if (def->localtime) ADD_ARG_LIT("-localtime"); diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 5200532..2f17f6c 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -952,7 +952,7 @@ static int qemudWaitForMonitor(virConnectPtr conn, struct qemud_driver* driver, virDomainObjPtr vm, off_t pos) { - char buf[1024]; /* Plenty of space to get startup greeting */ + char buf[4096]; /* Plenty of space to get startup greeting */ int logfd; int ret; @@ -964,7 +964,7 @@ static int qemudWaitForMonitor(virConnectPtr conn, qemudFindCharDevicePTYs, "console", 3); if (close(logfd) < 0) { - char ebuf[1024]; + char ebuf[4096]; VIR_WARN(_("Unable to close logfile: %s\n"), virStrerror(errno, ebuf, sizeof ebuf)); } @@ -1316,6 +1316,7 @@ static int qemudStartVMDaemon(virConnectPtr conn, pid_t child; int pos = -1; char ebuf[1024]; + char *pidfile = NULL; struct gemudHookData hookData; hookData.conn = conn; @@ -1396,6 +1397,11 @@ static int qemudStartVMDaemon(virConnectPtr conn, goto cleanup; } + if (!(pidfile = virFilePid(driver->stateDir, vm->def->name))) { + virReportSystemError(conn, errno, + "%s", _("Failed to build pidfile path.")); + goto cleanup; + } vm->def->id = driver->nextvmid++; if (qemudBuildCommandLine(conn, driver, vm->def, @@ -1437,13 +1443,15 @@ static int qemudStartVMDaemon(virConnectPtr conn, ret = virExecDaemonize(conn, argv, progenv, &keepfd, &child, stdin_fd, &vm->logfile, &vm->logfile, VIR_EXEC_NONBLOCK | VIR_EXEC_DAEMON, - qemudSecurityHook, &hookData); + qemudSecurityHook, &hookData, + pidfile); + VIR_FREE(pidfile); /* wait for qemu process to to show up */ if (ret == 0) { - int retries = 100; + int retries = 10; - while (retries) { + while (retries*10) { if ((ret = virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) == 0) break; @@ -1511,6 +1519,7 @@ cleanup: vm->def->graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC && vm->def->graphics->data.vnc.autoport) vm->def->graphics->data.vnc.port = -1; + VIR_FREE(pidfile); if (vm->logfile != -1) { close(vm->logfile); vm->logfile = -1; diff --git a/src/remote_internal.c b/src/remote_internal.c index 8a389bc..b45af25 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -293,7 +293,7 @@ remoteForkDaemon(virConnectPtr conn) if (virExecDaemonize(NULL, daemonargs, NULL, NULL, &pid, -1, NULL, NULL, VIR_EXEC_DAEMON, - NULL, NULL) < 0) + NULL, NULL, NULL) < 0) return -1; return 0; diff --git a/src/uml_driver.c b/src/uml_driver.c index 8673095..f29e227 100644 --- a/src/uml_driver.c +++ b/src/uml_driver.c @@ -823,7 +823,7 @@ static int umlStartVMDaemon(virConnectPtr conn, ret = virExecDaemonize(conn, argv, progenv, &keepfd, &pid, -1, &logfd, &logfd, - VIR_EXEC_DAEMON, NULL, NULL); + VIR_EXEC_DAEMON, NULL, NULL, NULL); close(logfd); for (i = 0 ; argv[i] ; i++) diff --git a/src/util.c b/src/util.c index 525b07f..a35c480 100644 --- a/src/util.c +++ b/src/util.c @@ -285,6 +285,7 @@ int virSetCloseExec(int fd) { * use virExecDaemonize wrapper) * @hook optional virExecHook function to call prior to exec * @data data to pass to the hook function + * @pidfile path to use as pidfile for daemonized process (needs DAEMON flag) */ static int __virExec(virConnectPtr conn, @@ -295,7 +296,8 @@ __virExec(virConnectPtr conn, int infd, int *outfd, int *errfd, int flags, virExecHook hook, - void *data) + void *data, + char *pidfile) { pid_t pid; int null, i, openmax; @@ -511,8 +513,14 @@ __virExec(virConnectPtr conn, _exit(1); } - if (pid > 0) + if (pid > 0) { + if (pidfile && virFileWritePidPath(pidfile,pid)) { + virReportSystemError(conn, errno, + "%s", _("could not write pidfile")); + _exit(1); + } _exit(0); + } } if (envp) @@ -555,7 +563,8 @@ virExecWithHook(virConnectPtr conn, int infd, int *outfd, int *errfd, int flags, virExecHook hook, - void *data) + void *data, + char *pidfile) { char *argv_str; @@ -567,7 +576,7 @@ virExecWithHook(virConnectPtr conn, VIR_FREE(argv_str); return __virExec(conn, argv, envp, keepfd, retpid, infd, outfd, errfd, - flags, hook, data); + flags, hook, data, pidfile); } /* @@ -588,7 +597,7 @@ virExec(virConnectPtr conn, { return virExecWithHook(conn, argv, envp, keepfd, retpid, infd, outfd, errfd, - flags, NULL, NULL); + flags, NULL, NULL, NULL); } /* @@ -613,14 +622,15 @@ int virExecDaemonize(virConnectPtr conn, int infd, int *outfd, int *errfd, int flags, virExecHook hook, - void *data) { + void *data, + char *pidfile) { int ret; int childstat = 0; ret = virExecWithHook(conn, argv, envp, keepfd, retpid, infd, outfd, errfd, flags |= VIR_EXEC_DAEMON, - hook, data); + hook, data, pidfile); /* Wait for intermediate process to exit */ while (waitpid(*retpid, &childstat, 0) == -1 && @@ -755,7 +765,7 @@ virRun(virConnectPtr conn, if ((execret = __virExec(conn, argv, NULL, NULL, &childpid, -1, &outfd, &errfd, - VIR_EXEC_NONE, NULL, NULL)) < 0) { + VIR_EXEC_NONE, NULL, NULL, NULL)) < 0) { ret = execret; goto error; } @@ -1196,7 +1206,6 @@ int virFileOpenTtyAt(const char *ptmx ATTRIBUTE_UNUSED, } #endif - char* virFilePid(const char *dir, const char* name) { char *pidfile; @@ -1204,14 +1213,11 @@ char* virFilePid(const char *dir, const char* name) return pidfile; } - int virFileWritePid(const char *dir, const char *name, pid_t pid) { int rc; - int fd; - FILE *file = NULL; char *pidfile = NULL; if ((rc = virFileMakePath(dir))) @@ -1222,6 +1228,20 @@ int virFileWritePid(const char *dir, goto cleanup; } + rc = virFileWritePidPath(pidfile, pid); + +cleanup: + VIR_FREE(pidfile); + return rc; +} + +int virFileWritePidPath(const char *pidfile, + pid_t pid) +{ + int rc; + int fd; + FILE *file = NULL; + if ((fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) < 0) { @@ -1248,7 +1268,6 @@ cleanup: rc = errno; } - VIR_FREE(pidfile); return rc; } diff --git a/src/util.h b/src/util.h index bc29b16..61e1eb5 100644 --- a/src/util.h +++ b/src/util.h @@ -54,7 +54,8 @@ int virExecDaemonize(virConnectPtr conn, int infd, int *outfd, int *errfd, int flags, virExecHook hook, - void *data); + void *data, + char *pidfile); int virExecWithHook(virConnectPtr conn, const char *const*argv, const char *const*envp, @@ -65,7 +66,8 @@ int virExecWithHook(virConnectPtr conn, int *errfd, int flags, virExecHook hook, - void *data); + void *data, + char *pidfile); int virExec(virConnectPtr conn, const char *const*argv, const char *const*envp, @@ -119,6 +121,8 @@ int virFileOpenTtyAt(const char *ptmx, char* virFilePid(const char *dir, const char *name); +int virFileWritePidPath(const char *path, + pid_t pid); int virFileWritePid(const char *dir, const char *name, pid_t pid); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args index c2f8487..e06b457 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot d -cdrom /dev/cdrom -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot d -cdrom /dev/cdrom -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args index 930c825..e2abdfa 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot a -hda /dev/HostVG/QEMUGuest1 -fda /tmp/firmware.img -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot a -hda /dev/HostVG/QEMUGuest1 -fda /tmp/firmware.img -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args index c16cadd..b5ff1b5 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot n -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot n -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args b/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args index 6b6e753..b40032c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-kvm -S -M xenner -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -bootloader /usr/bin/pygrub -cdrom /dev/cdrom -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu-kvm -S -M xenner -m 214 -smp 1 -nographic -monitor pty -no-acpi -bootloader /usr/bin/pygrub -cdrom /dev/cdrom -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args index c9efcce..e3bd139 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -localtime -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -localtime -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args index 756746b..d1ccbb3 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args index 4333acc..5764c48 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args index 3b0ae3c..a370e1c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -drive file=,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -drive file=,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args index 6f87dd0..d9b6f73 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -cdrom /root/boot.iso -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -cdrom /root/boot.iso -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args index fb80743..4deb217 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot d -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot d -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args index 798151b..41a3019 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.args index 13b5dd5..0f83cf4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=off -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=off -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.args index 2197cd0..70fc83a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.args index 13b5dd5..0f83cf4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=off -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=off -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args index f4e5c1a..1b6754f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=none -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=none -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args index 273f68b..d6a6459 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=writeback -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=writeback -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args index d5791f0..b94eb47 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=writethrough -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=writethrough -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args index 577d353..99090fe 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on,format=qcow2 -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on,format=qcow2 -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args index 13b5dd5..0f83cf4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=off -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,format=qcow2,cache=off -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2,format=raw -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args index 6c4398e..84afc63 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -fda /dev/fd0 -fdb /tmp/firmware.img -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -fda /dev/fd0 -fdb /tmp/firmware.img -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args index c6e2b05..3041f18 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -hdb /dev/HostVG/QEMUGuest2 -hdc /tmp/data.img -hdd /tmp/logs.img -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -hdb /dev/HostVG/QEMUGuest2 -hdc /tmp/data.img -hdd /tmp/logs.img -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args index 576f95e..b948d5d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -usbdevice disk:/tmp/usbdisk.img -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -usbdevice disk:/tmp/usbdisk.img -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args index b30ed10..c0f3143 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=virtio,index=0 -drive file=/tmp/logs.img,if=virtio,index=6 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=virtio,index=0 -drive file=/tmp/logs.img,if=virtio,index=6 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args index fcaea29..08e1856 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=xen,index=0 -drive file=/tmp/logs.img,if=xen,index=6 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=xen,index=0 -drive file=/tmp/logs.img,if=xen,index=6 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args index 33224a6..da2adc0 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test XAUTHORITY=/root/.Xauthority DISPLAY=:0.1 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -full-screen +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test XAUTHORITY=/root/.Xauthority DISPLAY=:0.1 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -full-screen diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args index 3d47c0e..3b2b049 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test XAUTHORITY=/root/.Xauthority DISPLAY=:0.1 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test XAUTHORITY=/root/.Xauthority DISPLAY=:0.1 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args index 29ec4fb..a41a57c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test SASL_CONF_DIR=/root/.sasl2 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3,sasl +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test SASL_CONF_DIR=/root/.sasl2 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3,sasl diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args index bd6a5b0..d0a87a7 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test SASL_CONF_DIR=/root/.sasl2 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3,tls,x509verify=/etc/pki/tls/qemu,sasl +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test SASL_CONF_DIR=/root/.sasl2 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3,tls,x509verify=/etc/pki/tls/qemu,sasl diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args index 95728d0..6ff78c8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args index 2ad66d1..92a81c8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest2.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest2 -net none -serial none -parallel none -usb -pcidevice host=06:12.5 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest2 -net none -serial none -parallel none -usb -pcidevice host=06:12.5 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args index a44968a..3d6c16d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:014.006 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:014.006 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args index d21d5f4..e207871 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:0204:6025 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice host:0204:6025 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args index 5b82e24..477495d 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice mouse +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice mouse diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args index 476a1b6..ababc29 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice tablet +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice tablet diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args index d345613..3ce842a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/xenner -S -M xenner -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -bootloader /foo -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/xenner -S -M xenner -m 214 -smp 1 -monitor pty -no-acpi -bootloader /foo -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-migrate.args b/tests/qemuxml2argvdata/qemuxml2argv-migrate.args index 1b160b1..59fac6f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-migrate.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-migrate.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -incoming tcp:10.0.0.1:5000 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -incoming tcp:10.0.0.1:5000 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal.args b/tests/qemuxml2argvdata/qemuxml2argv-minimal.args index 442b396..4bbb7ab 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-minimal.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -name QEMUGuest1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -name QEMUGuest1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args index c79383d..0f9b1a1 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args index b9ef543..481462f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-reboot -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-reboot -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args index edfa9d4..de9a7df 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -name QEMUGuest1 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 -domid 6 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -name QEMUGuest1 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 -domid 6 -nographic -monitor pty -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args index 89daa99..6063107 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net tap,ifname=nic02,script=/etc/qemu-ifup,vlan=0 -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net tap,ifname=nic02,script=/etc/qemu-ifup,vlan=0 -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args b/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args index 9aa0e13..bf7b7a8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net tap,script=/etc/qemu-ifup,vlan=0 -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net tap,script=/etc/qemu-ifup,vlan=0 -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-user.args b/tests/qemuxml2argvdata/qemuxml2argv-net-user.args index 15dee2c..6c1ca8c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-user.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-user.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net user,vlan=0 -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net user,vlan=0 -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args index 94011e3..bf78071 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0,model=virtio -net user,vlan=0 -serial none -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0,model=virtio -net user,vlan=0 -serial none -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args index 9f0a54a..e9bbc71 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel tcp:127.0.0.1:9999,server,nowait -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel tcp:127.0.0.1:9999,server,nowait -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args index d526a57..40aaf41 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -incoming stdio +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -incoming stdio diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args index c89a9b7..05cb243 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -incoming exec:cat +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -incoming exec:cat diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args index 6265063..7f7f0f6 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial /dev/ttyS2 -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial /dev/ttyS2 -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args index 6469c6a..688ca32 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial file:/tmp/serial.log -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial file:/tmp/serial.log -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args index cd3cc74..d59f708 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -serial file:/tmp/serial.log -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -serial file:/tmp/serial.log -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args index 4333acc..5764c48 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args index 5fd336a..ad37de4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial telnet:127.0.0.1:9999,server,nowait -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial telnet:127.0.0.1:9999,server,nowait -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args index fcf8230..834e47e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial tcp:127.0.0.1:9999 -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial tcp:127.0.0.1:9999 -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args index 2937119..15060aa 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial udp:127.0.0.1:9998@127.0.0.1:9999 -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial udp:127.0.0.1:9998@127.0.0.1:9999 -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args index 54c54df..f38d3cf 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial unix:/tmp/serial.sock -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial unix:/tmp/serial.sock -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args index d40f27c..800c7b3 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial vc -parallel none -usb +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial vc -parallel none -usb diff --git a/tests/qemuxml2argvdata/qemuxml2argv-sound.args b/tests/qemuxml2argvdata/qemuxml2argv-sound.args index dddc587..01f85ad 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-sound.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-sound.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -soundhw pcspk,es1370,sb16,ac97 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -soundhw pcspk,es1370,sb16,ac97 -- 1.6.2.2

On Tue, Apr 28, 2009 at 11:31:55AM -0400, Cole Robinson wrote:
virExec will write out the pid of the daemonized process only. Use this in the QEMU driver, rather than QEMU's pidfile, so we can errors we might miss if the emulator bails early.
diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 5200532..2f17f6c 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -1396,6 +1397,11 @@ static int qemudStartVMDaemon(virConnectPtr conn, goto cleanup; }
+ if (!(pidfile = virFilePid(driver->stateDir, vm->def->name))) { + virReportSystemError(conn, errno, + "%s", _("Failed to build pidfile path.")); + goto cleanup; + }
vm->def->id = driver->nextvmid++; if (qemudBuildCommandLine(conn, driver, vm->def, @@ -1437,13 +1443,15 @@ static int qemudStartVMDaemon(virConnectPtr conn, ret = virExecDaemonize(conn, argv, progenv, &keepfd, &child, stdin_fd, &vm->logfile, &vm->logfile, VIR_EXEC_NONBLOCK | VIR_EXEC_DAEMON, - qemudSecurityHook, &hookData); + qemudSecurityHook, &hookData, + pidfile); + VIR_FREE(pidfile);
/* wait for qemu process to to show up */ if (ret == 0) { - int retries = 100; + int retries = 10;
- while (retries) { + while (retries*10) { if ((ret = virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) == 0) break;
I'm thinking that we don't need to loop here waiting for the pidfile to be created. Since virExeDaemonize is calling waitpid() on the intermediate program, it will block until the intermediate program has exited. Since the intermediate program is now writing the pidfile instead of QEMU, when virExecDaemonize returns, we *must* have written the pidfile (or had a earlier failure). So I believe we just need to check if it exists once, with no need to wait in a loop. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

By checking the pid every retry period, we can quickly determine if the process crashed at startup, rather than make the user wait for the entire timeout (3 seconds). --- src/qemu_driver.c | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 2f17f6c..04df8ae 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -744,29 +744,40 @@ qemudReadLogOutput(virConnectPtr conn, int timeout) { int retries = timeout*10; + int got = 0; buf[0] = '\0'; while (retries) { ssize_t ret; - size_t got = 0; + int isdead = 0; - while((ret = read(fd, buf+got, buflen-got-1)) > 0) { - got += ret; - buf[got] = '\0'; - if ((buflen-got-1) == 0) { - qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, - _("Out of space while reading %s log output"), what); - return -1; - } - } + if (kill(vm->pid, 0) == -1 && errno == ESRCH) + isdead = 1; - if (ret < 0 && errno != EINTR) { + ret = saferead(fd, buf+got, buflen-got-1); + if (ret < 0) { virReportSystemError(conn, errno, _("Failure while reading %s log output"), what); return -1; } + got += ret; + buf[got] = '\0'; + if (got == buflen-1) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + _("Out of space while reading %s log output"), + what); + return -1; + } + + if (isdead) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + _("Process exited while reading %s log output"), + what); + return -1; + } + ret = func(conn, vm, buf, fd); if (ret <= 0) return ret; -- 1.6.2.2

On Tue, Apr 28, 2009 at 11:31:56AM -0400, Cole Robinson wrote:
By checking the pid every retry period, we can quickly determine if the process crashed at startup, rather than make the user wait for the entire timeout (3 seconds).
ACK, this looks good.
--- src/qemu_driver.c | 33 ++++++++++++++++++++++----------- 1 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 2f17f6c..04df8ae 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -744,29 +744,40 @@ qemudReadLogOutput(virConnectPtr conn, int timeout) { int retries = timeout*10; + int got = 0; buf[0] = '\0';
while (retries) { ssize_t ret; - size_t got = 0; + int isdead = 0;
- while((ret = read(fd, buf+got, buflen-got-1)) > 0) { - got += ret; - buf[got] = '\0'; - if ((buflen-got-1) == 0) { - qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, - _("Out of space while reading %s log output"), what); - return -1; - } - } + if (kill(vm->pid, 0) == -1 && errno == ESRCH) + isdead = 1;
- if (ret < 0 && errno != EINTR) { + ret = saferead(fd, buf+got, buflen-got-1); + if (ret < 0) { virReportSystemError(conn, errno, _("Failure while reading %s log output"), what); return -1; }
+ got += ret; + buf[got] = '\0'; + if (got == buflen-1) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + _("Out of space while reading %s log output"), + what); + return -1; + } + + if (isdead) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + _("Process exited while reading %s log output"), + what); + return -1; + } + ret = func(conn, vm, buf, fd); if (ret <= 0) return ret; --
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--- src/qemu_driver.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 04df8ae..b293f72 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -225,7 +225,7 @@ qemudAutostartConfigs(struct qemud_driver *driver) { virErrorPtr err = virGetLastError(); VIR_ERROR(_("Failed to autostart VM '%s': %s\n"), vm->def->name, - err ? err->message : NULL); + err ? err->message : ""); } else { virDomainEventPtr event = virDomainEventNewFromObj(vm, @@ -3293,8 +3293,10 @@ static int qemudDomainRestore(virConnectPtr conn, close(fd); fd = -1; if (ret < 0) { + virErrorPtr err = virGetLastError(); qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED, - "%s", _("failed to start VM")); + _("failed to start VM: %s"), + err ? err->message : ""); if (!vm->persistent) { virDomainRemoveInactive(&driver->domains, vm); @@ -4790,8 +4792,10 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn, */ snprintf (migrateFrom, sizeof (migrateFrom), "tcp:0.0.0.0:%d", this_port); if (qemudStartVMDaemon (dconn, driver, vm, migrateFrom, -1) < 0) { + virErrorPtr err = virGetLastError(); qemudReportError (dconn, NULL, NULL, VIR_ERR_OPERATION_FAILED, - "%s", _("failed to start listening VM")); + _("failed to start listening VM: %s"), + err ? err->message : ""); if (!vm->persistent) { virDomainRemoveInactive(&driver->domains, vm); vm = NULL; -- 1.6.2.2

On Tue, Apr 28, 2009 at 11:31:57AM -0400, Cole Robinson wrote:
--- src/qemu_driver.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 04df8ae..b293f72 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -225,7 +225,7 @@ qemudAutostartConfigs(struct qemud_driver *driver) { virErrorPtr err = virGetLastError(); VIR_ERROR(_("Failed to autostart VM '%s': %s\n"), vm->def->name, - err ? err->message : NULL); + err ? err->message : ""); } else { virDomainEventPtr event = virDomainEventNewFromObj(vm, @@ -3293,8 +3293,10 @@ static int qemudDomainRestore(virConnectPtr conn, close(fd); fd = -1; if (ret < 0) { + virErrorPtr err = virGetLastError(); qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED, - "%s", _("failed to start VM")); + _("failed to start VM: %s"), + err ? err->message : ""); if (!vm->persistent) { virDomainRemoveInactive(&driver->domains, vm); @@ -4790,8 +4792,10 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn, */ snprintf (migrateFrom, sizeof (migrateFrom), "tcp:0.0.0.0:%d", this_port); if (qemudStartVMDaemon (dconn, driver, vm, migrateFrom, -1) < 0) { + virErrorPtr err = virGetLastError(); qemudReportError (dconn, NULL, NULL, VIR_ERR_OPERATION_FAILED, - "%s", _("failed to start listening VM")); + _("failed to start listening VM: %s"), + err ? err->message : ""); if (!vm->persistent) { virDomainRemoveInactive(&driver->domains, vm); vm = NULL;
It think we should just be removing the qemudReportError() calls completely in both these places & let qemudStartVMDaemon take care of reporting errors, since there is no need to have different error messages in each caller. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, Apr 28, 2009 at 11:31:57AM -0400, Cole Robinson wrote:
--- src/qemu_driver.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 04df8ae..b293f72 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -225,7 +225,7 @@ qemudAutostartConfigs(struct qemud_driver *driver) { virErrorPtr err = virGetLastError(); VIR_ERROR(_("Failed to autostart VM '%s': %s\n"), vm->def->name, - err ? err->message : NULL); + err ? err->message : ""); } else { virDomainEventPtr event = virDomainEventNewFromObj(vm, @@ -3293,8 +3293,10 @@ static int qemudDomainRestore(virConnectPtr conn, close(fd); fd = -1; if (ret < 0) { + virErrorPtr err = virGetLastError(); qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED, - "%s", _("failed to start VM")); + _("failed to start VM: %s"), + err ? err->message : ""); if (!vm->persistent) { virDomainRemoveInactive(&driver->domains, vm); @@ -4790,8 +4792,10 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn, */ snprintf (migrateFrom, sizeof (migrateFrom), "tcp:0.0.0.0:%d", this_port); if (qemudStartVMDaemon (dconn, driver, vm, migrateFrom, -1) < 0) { + virErrorPtr err = virGetLastError(); qemudReportError (dconn, NULL, NULL, VIR_ERR_OPERATION_FAILED, - "%s", _("failed to start listening VM")); + _("failed to start listening VM: %s"), + err ? err->message : ""); if (!vm->persistent) { virDomainRemoveInactive(&driver->domains, vm); vm = NULL;
It think we should just be removing the qemudReportError() calls completely in both these places & let qemudStartVMDaemon take care of reporting errors, since there is no need to have different error messages in each caller.
Daniel
Okay, I sent an updated patch outside of this series, since it's an isolated fix. Thanks, Cole
participants (2)
-
Cole Robinson
-
Daniel P. Berrange