QEMU has two modes of providing a graphical display, VNC and SDL. Now most
of our tools just use VNC, but occasionally people want to use SDL for
some crazy reason. We already support this in Xen driver, but the QEMU
impl has been rather lacking. At the moment if you ask for a SDL display
it'll only happen to work if you had the $DISPLAY environment variable
set when you started libvirtd - you probably don't.
The generic XML parser allows for two attributes on the <graohics>
element for setting the display and xauth filename, so this patch updates
the QEMU driver to use this data if available. This means we have to
start setting environment variables when invoking QEMU, so this patch
is a little larger than would otherwise be expected.
Now previously since we just use 'execv' the QEMU process would just
inherit all libvirtd's environment variables. When we now use execve()
no variables are inherited - we have to explicitly set all the ones
we need. I'm not sure what we should consider the mimimum required?
I'm merely setting 'LC_ALL=C' to ensure it runs in C locale. Do we
need to set $PATH for QEMU - maybe ? Anything else which is good
practice to set ?
src/qemu_conf.c | 60 +++++++++-
src/qemu_conf.h | 3
src/qemu_driver.c | 19 ++-
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 2
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args | 2
tests/qemuxml2argvdata/qemuxml2argv-boot-network.args | 2
tests/qemuxml2argvdata/qemuxml2argv-bootloader.args | 2
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args | 2
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args | 2
tests/qemuxml2argvdata/qemuxml2argv-console-compat.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args | 2
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args | 2
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args | 2
tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args | 2
tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args | 2
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args | 2
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args | 2
tests/qemuxml2argvdata/qemuxml2argv-input-xen.args | 2
tests/qemuxml2argvdata/qemuxml2argv-minimal.args | 2
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args | 2
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args | 2
tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 2
tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args | 2
tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-file.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-many.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args | 2
tests/qemuxml2argvdata/qemuxml2argv-sound.args | 2
tests/qemuxml2argvtest.c | 31 ++++-
44 files changed, 145 insertions(+), 48 deletions(-)
Daniel
diff -r 194a93a4a942 src/qemu_conf.c
--- a/src/qemu_conf.c Wed Oct 01 11:52:52 2008 +0100
+++ b/src/qemu_conf.c Thu Oct 02 18:03:43 2008 +0100
@@ -710,6 +710,7 @@
virDomainObjPtr vm,
unsigned int qemuCmdFlags,
const char ***retargv,
+ const char ***retenv,
int **tapfds,
int *ntapfds,
const char *migrateFrom) {
@@ -728,6 +729,8 @@
int disableKQEMU = 0;
int qargc = 0, qarga = 0;
const char **qargv = NULL;
+ int qenvc = 0, qenva = 0;
+ const char **qenv = NULL;
const char *emulator;
uname(&ut);
@@ -775,14 +778,39 @@
do { \
ADD_ARG_LIT("-usbdevice"); \
ADD_ARG_SPACE; \
- if ((asprintf((char **)&(qargv[qargc++]), "disk:%s", thisarg)) ==
-1) { \
+ if ((asprintf((char **)&(qargv[qargc++]), \
+ "disk:%s", thisarg)) == -1) { \
qargv[qargc-1] = NULL; \
goto no_memory; \
} \
} while (0)
+#define ADD_ENV_SPACE \
+ do { \
+ if (qenvc == qenva) { \
+ qenva += 10; \
+ if (VIR_REALLOC_N(qenv, qenva) < 0) \
+ goto no_memory; \
+ } \
+ } while (0)
+
+#define ADD_ENV(thisarg) \
+ do { \
+ ADD_ENV_SPACE; \
+ qenv[qenvc++] = thisarg; \
+ } while (0)
+
+#define ADD_ENV_LIT(thisarg) \
+ do { \
+ ADD_ENV_SPACE; \
+ if ((qenv[qenvc++] = strdup(thisarg)) == NULL) \
+ goto no_memory; \
+ } while (0)
+
snprintf(memory, sizeof(memory), "%lu", vm->def->memory/1024);
snprintf(vcpus, sizeof(vcpus), "%lu", vm->def->vcpus);
+
+ ADD_ENV_LIT("LC_ALL=C");
emulator = vm->def->emulator;
if (!emulator)
@@ -1163,7 +1191,24 @@
}
} else if (vm->def->graphics &&
vm->def->graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
- /* SDL is the default. no args needed */
+ char *xauth = NULL;
+ char *display = NULL;
+
+ if (vm->def->graphics->data.sdl.xauth &&
+ asprintf(&xauth, "XAUTHORITY=%s",
+ vm->def->graphics->data.sdl.xauth) < 0)
+ goto no_memory;
+ if (vm->def->graphics->data.sdl.display &&
+ asprintf(&display, "DISPLAY=%s",
+ vm->def->graphics->data.sdl.display) < 0) {
+ VIR_FREE(xauth);
+ goto no_memory;
+ }
+
+ if (xauth)
+ ADD_ENV(xauth);
+ if (display)
+ ADD_ENV(display);
}
/* Add sound hardware */
@@ -1225,8 +1270,10 @@
}
ADD_ARG(NULL);
+ ADD_ENV(NULL);
*retargv = qargv;
+ *retenv = qenv;
return 0;
no_memory:
@@ -1245,9 +1292,18 @@
VIR_FREE((qargv)[i]);
VIR_FREE(qargv);
}
+ if (qenv) {
+ for (i = 0 ; i < qenvc ; i++)
+ VIR_FREE((qenv)[i]);
+ VIR_FREE(qenv);
+ }
return -1;
#undef ADD_ARG
#undef ADD_ARG_LIT
#undef ADD_ARG_SPACE
+#undef ADD_USBDISK
+#undef ADD_ENV
+#undef ADD_ENV_LIT
+#undef ADD_ENV_SPACE
}
diff -r 194a93a4a942 src/qemu_conf.h
--- a/src/qemu_conf.h Wed Oct 01 11:52:52 2008 +0100
+++ b/src/qemu_conf.h Thu Oct 02 18:03:43 2008 +0100
@@ -93,7 +93,8 @@
struct qemud_driver *driver,
virDomainObjPtr dom,
unsigned int qemuCmdFlags,
- const char ***argv,
+ const char ***retargv,
+ const char ***retenv,
int **tapfds,
int *ntapfds,
const char *migrateFrom);
diff -r 194a93a4a942 src/qemu_driver.c
--- a/src/qemu_driver.c Wed Oct 01 11:52:52 2008 +0100
+++ b/src/qemu_driver.c Thu Oct 02 18:03:43 2008 +0100
@@ -844,6 +844,7 @@
virDomainObjPtr vm,
const char *migrateFrom) {
const char **argv = NULL, **tmp;
+ const char **progenv = NULL;
int i, ret;
char logfile[PATH_MAX];
struct stat sb;
@@ -939,13 +940,23 @@
}
if (qemudBuildCommandLine(conn, driver, vm,
- qemuCmdFlags, &argv,
+ qemuCmdFlags, &argv, &progenv,
&tapfds, &ntapfds, migrateFrom) < 0) {
close(vm->logfile);
vm->logfile = -1;
return -1;
}
+ tmp = progenv;
+ while (*tmp) {
+ if (safewrite(vm->logfile, *tmp, strlen(*tmp)) < 0)
+ qemudLog(QEMUD_WARN, _("Unable to write envv to logfile %d:
%s\n"),
+ errno, strerror(errno));
+ if (safewrite(vm->logfile, " ", 1) < 0)
+ qemudLog(QEMUD_WARN, _("Unable to write envv to logfile %d:
%s\n"),
+ errno, strerror(errno));
+ tmp++;
+ }
tmp = argv;
while (*tmp) {
if (safewrite(vm->logfile, *tmp, strlen(*tmp)) < 0)
@@ -966,7 +977,7 @@
for (i = 0 ; i < ntapfds ; i++)
FD_SET(tapfds[i], &keepfd);
- ret = virExec(conn, argv, NULL, &keepfd, &vm->pid,
+ ret = virExec(conn, argv, progenv, &keepfd, &vm->pid,
vm->stdin_fd, &vm->stdout_fd, &vm->stderr_fd,
VIR_EXEC_NONBLOCK);
if (ret == 0) {
@@ -977,6 +988,10 @@
for (i = 0 ; argv[i] ; i++)
VIR_FREE(argv[i]);
VIR_FREE(argv);
+
+ for (i = 0 ; progenv[i] ; i++)
+ VIR_FREE(progenv[i]);
+ VIR_FREE(progenv);
if (tapfds) {
for (i = 0 ; i < ntapfds ; i++) {
diff -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-boot-network.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-bootloader.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-console-compat.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args Wed Oct 01 11:52:52
2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args Thu Oct 02 18:03:43
2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args Wed Oct 01 11:52:52
2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args Thu Oct 02 18:03:43
2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-many.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,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
+LC_ALL=C 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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml Thu Oct 02 18:03:43 2008 +0100
@@ -19,6 +19,6 @@
<target dev='hda' bus='ide'/>
</disk>
<input type='mouse' bus='ps2'/>
- <graphics type='sdl'/>
+ <graphics type='sdl' display=':0.1'
xauth='/root/.Xauthority'/>
</devices>
</domain>
diff -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,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 -vnc 127.0.0.1:3
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args Wed Oct 01 11:52:52
2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args Thu Oct 02 18:03:43
2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args Wed Oct 01 11:52:52
2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args Thu Oct 02 18:03:43
2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-input-xen.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-minimal.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-minimal.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-net-user.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-user.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-user.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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,listen -usb
+LC_ALL=C /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,listen
-usb
diff -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-file.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-many.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args Wed Oct 01 11:52:52 2008
+0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args Thu Oct 02 18:03:43 2008
+0100
@@ -1,1 +1,1 @@
-/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 -parallel none -usb
+LC_ALL=C /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 -parallel none
-usb
diff -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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 -r 194a93a4a942 tests/qemuxml2argvdata/qemuxml2argv-sound.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-sound.args Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvdata/qemuxml2argv-sound.args Thu Oct 02 18:03:43 2008 +0100
@@ -1,1 +1,1 @@
-/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
+LC_ALL=C /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
diff -r 194a93a4a942 tests/qemuxml2argvtest.c
--- a/tests/qemuxml2argvtest.c Wed Oct 01 11:52:52 2008 +0100
+++ b/tests/qemuxml2argvtest.c Thu Oct 02 18:03:43 2008 +0100
@@ -22,11 +22,14 @@
#define MAX_FILE 4096
-static int testCompareXMLToArgvFiles(const char *xml, const char *cmd, int extraFlags) {
+static int testCompareXMLToArgvFiles(const char *xml,
+ const char *cmd,
+ int extraFlags) {
char argvData[MAX_FILE];
char *expectargv = &(argvData[0]);
char *actualargv = NULL;
const char **argv = NULL;
+ const char **qenv = NULL;
const char **tmp = NULL;
int ret = -1, len, flags;
virDomainDefPtr vmdef = NULL;
@@ -48,18 +51,32 @@
extraFlags;
if (qemudBuildCommandLine(NULL, &driver,
- &vm, flags, &argv,
+ &vm, flags, &argv, &qenv,
NULL, NULL, NULL) < 0)
goto fail;
+ len = 1; /* for trailing newline */
+ tmp = qenv;
+ while (*tmp) {
+ len += strlen(*tmp) + 1;
+ tmp++;
+ }
+
tmp = argv;
- len = 1; /* for trailing newline */
while (*tmp) {
len += strlen(*tmp) + 1;
tmp++;
}
actualargv = malloc(sizeof(*actualargv)*len);
actualargv[0] = '\0';
+ tmp = qenv;
+ len = 0;
+ while (*tmp) {
+ if (actualargv[0])
+ strcat(actualargv, " ");
+ strcat(actualargv, *tmp);
+ tmp++;
+ }
tmp = argv;
len = 0;
while (*tmp) {
@@ -86,6 +103,14 @@
tmp++;
}
free(argv);
+ }
+ if (qenv) {
+ tmp = qenv;
+ while (*tmp) {
+ free(*(char**)tmp);
+ tmp++;
+ }
+ free(qenv);
}
virDomainDefFree(vmdef);
return ret;
--
|: 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 :|