]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Support SDL config with QEMU guests
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 10 Oct 2008 16:52:20 +0000 (16:52 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 10 Oct 2008 16:52:20 +0000 (16:52 +0000)
46 files changed:
ChangeLog
docs/libvirt.rng
src/qemu_conf.c
src/qemu_conf.h
src/qemu_driver.c
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args
tests/qemuxml2argvdata/qemuxml2argv-boot-network.args
tests/qemuxml2argvdata/qemuxml2argv-bootloader.args
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args
tests/qemuxml2argvdata/qemuxml2argv-console-compat.args
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args
tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args
tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args
tests/qemuxml2argvdata/qemuxml2argv-input-xen.args
tests/qemuxml2argvdata/qemuxml2argv-minimal.args
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args
tests/qemuxml2argvdata/qemuxml2argv-net-user.args
tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args
tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args
tests/qemuxml2argvdata/qemuxml2argv-serial-file.args
tests/qemuxml2argvdata/qemuxml2argv-serial-many.args
tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args
tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args
tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args
tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args
tests/qemuxml2argvdata/qemuxml2argv-sound.args
tests/qemuxml2argvtest.c

index c46769e46713d75dba4bf1f4214baf0b5bbd9bf4..1f0d26530bb8760dc366567ec7774a5f7f15e434 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Fri Oct 10 17:51:00 BST 2008 Daniel P. Berrange <berrange@redhat.com>
+
+       * docs/libvirt.rng: Document SDL attributes in schema
+       * src/qemu_conf.c, src/qemu_conf.h, src/qemu_driver.c: Support
+       SDL display configuration
+       * tests/qemuxml2argvtest.c: Set predictable env vars for SDL
+       tests.
+       * tests/qemuxml2argvdata/*.args: Add new env vars now set
+       explicitly
+
 Fri Oct 10 17:03:00 BST 2008 Daniel P. Berrange <berrange@redhat.com>
 
        * src/domain_conf.c, src/domain_conf.h, src/lxc_container.c,
index 81ec33babcfaad218e16bed1e30ba9a1d7656f0b..fdc841506dd432f22c864bd0d2fd42182e4d11a8 100644 (file)
   <define name='graphic'>
     <element name='graphics'>
       <choice>
-        <attribute name='type'>
-         <value>sdl</value>
-       </attribute>
+       <group>
+          <attribute name='type'>
+           <value>sdl</value>
+         </attribute>
+         <optional>
+           <attribute name='display'>
+             <text/>
+           </attribute>
+         </optional>
+         <optional>
+           <attribute name='xauth'>
+             <text/>
+           </attribute>
+         </optional>
+       </group>
        <group>
           <attribute name='type'>
            <value>vnc</value>
index 673ea6db5b0047242f8b28d0216ddaf14529b06e..c7168a3be7909541de56b115b4a305dd0b83bc64 100644 (file)
@@ -28,6 +28,7 @@
 #include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -694,6 +695,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
                           virDomainObjPtr vm,
                           unsigned int qemuCmdFlags,
                           const char ***retargv,
+                          const char ***retenv,
                           int **tapfds,
                           int *ntapfds,
                           const char *migrateFrom) {
@@ -705,6 +707,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
     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);
@@ -752,15 +756,60 @@ int qemudBuildCommandLine(virConnectPtr conn,
     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)
+
+#define ADD_ENV_COPY(envname)                                           \
+    do {                                                                \
+        char *val = getenv(envname);                                    \
+        char *envval;                                                   \
+        ADD_ENV_SPACE;                                                  \
+        if (val != NULL) {                                              \
+            if (asprintf(&envval, "%s=%s", envname, val) < 0)           \
+                goto no_memory;                                         \
+            qenv[qenvc++] = envval;                                     \
+        }                                                               \
+    } 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");
+
+    ADD_ENV_COPY("LD_PRELOAD");
+    ADD_ENV_COPY("LD_LIBRARY_PATH");
+    ADD_ENV_COPY("PATH");
+    ADD_ENV_COPY("HOME");
+    ADD_ENV_COPY("USER");
+    ADD_ENV_COPY("LOGNAME");
+    ADD_ENV_COPY("TMPDIR");
+
     emulator = vm->def->emulator;
     if (!emulator)
         emulator = virDomainDefDefaultEmulator(conn, vm->def, driver->caps);
@@ -1134,7 +1183,24 @@ int qemudBuildCommandLine(virConnectPtr conn,
         }
     } 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 */
@@ -1196,8 +1262,10 @@ int qemudBuildCommandLine(virConnectPtr conn,
     }
 
     ADD_ARG(NULL);
+    ADD_ENV(NULL);
 
     *retargv = qargv;
+    *retenv = qenv;
     return 0;
 
  no_memory:
@@ -1216,9 +1284,19 @@ int qemudBuildCommandLine(virConnectPtr conn,
             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_COPY
+#undef ADD_ENV_LIT
+#undef ADD_ENV_SPACE
 }
index d6e84ae1acdb5e24ae0ef5514702bf4e4dfff416..cfd7d3560999b74664d9ee9d03ea6e4356682b4b 100644 (file)
@@ -86,7 +86,8 @@ int         qemudBuildCommandLine       (virConnectPtr conn,
                                          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);
index 22a81c51f2eef98f870619e1ac63f0d9f03bd106..689c992b263bcb1dcf22eb195eec9168a3effb56 100644 (file)
@@ -747,6 +747,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
                               virDomainObjPtr vm,
                               const char *migrateFrom) {
     const char **argv = NULL, **tmp;
+    const char **progenv = NULL;
     int i, ret;
     char logfile[PATH_MAX];
     struct stat sb;
@@ -842,13 +843,23 @@ static int qemudStartVMDaemon(virConnectPtr conn,
     }
 
     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)
@@ -869,7 +880,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
     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) {
@@ -881,6 +892,10 @@ static int qemudStartVMDaemon(virConnectPtr conn,
         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++) {
             close(tapfds[i]);
index 6c062ae706eb4b94e447f8a8fb7d3e724cf8e39c..e06b457de46fa7a74913d28c99034165bb67c52c 100644 (file)
@@ -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 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
index 51b95b46c9ac5d3d7c41a6c9d2e726af92f80772..e2abdfa003156fe54ca160e7dcde662a2571096c 100644 (file)
@@ -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 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
index d600a318bcfdb3d11201a7eb01359f1453db93c7..b5ff1b50794b61d9233a3f31d2b05ca133a7dd01 100644 (file)
@@ -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 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
index 056cff2cef8423e2c3c7a18681c96cf7d843e761..b40032c4f1a309a01320c80d5dd24d8ddaf959d9 100644 (file)
@@ -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 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
index f367f422c4f48ff6925cf51741bab3f07425c0e3..e3bd139c5dd8783a78ba7b9950e2d1a4b81a13ac 100644 (file)
@@ -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 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
index 3ffcca2cd5bfac6ec1f21d98c2d9ed56840c23ad..d1ccbb3c5065948a353745bf58e01be03b484a10 100644 (file)
@@ -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 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
index 3403b26bf8d457e57dba35b6fe2f5886bbf1a1ae..5764c48330e4c29ee3038ec62753c98abfce7aa5 100644 (file)
@@ -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 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
index 513e9c1127121268f0668ef382a4ef358a4194ca..a370e1cd9b4966f55933c71865ee08a3817ac7f1 100644 (file)
@@ -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 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
index 5c3d988aafabbc89931f3ef34ca8af255d1a6870..d9b6f733e299d8d64d5d08768b1e24ec42e1c93b 100644 (file)
@@ -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 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
index fafce381c23260599b3a4bdb4374414690bb8143..4deb217c2cee3edbfdc2cc1b716280fe359beb2f 100644 (file)
@@ -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 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
index 218a86d44712e66d3e22773f1bb750c4ca23ec6c..41a3019a0501bc1d80275cf5028774c5659f72e9 100644 (file)
@@ -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 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
index c2b99090f0256a9faffbf07c6b5eb88159ffd112..84afc63185c3be1c9d432bc586c399ce9060fad5 100644 (file)
@@ -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 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
index 94448d016f044fdf7d73fb416ae02d9a2e2b59ad..3041f1823381c8c6c0279f7deaa7b95d3d14436c 100644 (file)
@@ -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 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
index 518b54e1723ce9c479db73a5ff92011f4cbd2530..b948d5d06b6757dee9144a1565289109cc072922 100644 (file)
@@ -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 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
index 111018a1329c2c7bdf6ce340c554f89645dffafa..c0f3143c9968cd37db97161ddf1b5c3c12a285ed 100644 (file)
@@ -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 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
index 71aef7e29a04c05a340a533971289ab91895ec2d..08e18567478a3f6e227bb3d7667ebfea52d66b8c 100644 (file)
@@ -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 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
index 08aeb6853da67264ca8f76e5cdfcd0cbeaacd308..3b2b0497e5c7f5c513390162173551b281899abf 100644 (file)
@@ -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 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
index 87817c342c8b66c681124381476d21edc272b816..1e04f12071e11ab7ad8793d87302288695957d31 100644 (file)
@@ -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>
index 9235fb7da032ebed7cc986d7e568332598e8e42f..6ff78c8f363f296ea514d3ffbf4b7ecb5fe553f3 100644 (file)
@@ -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 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
index 18508fa3b72d8522776bb1475d894b0ba065d77d..3d6c16de2872a24a1c39b4954e1d8d4f6f88a2e6 100644 (file)
@@ -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 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
index 13fe3d048ca37ab35e9604a3c2ddc080c8907cae..e207871a7554ddcdb118c2b77f2d75c17b05af98 100644 (file)
@@ -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 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
index 6222131626e707e88b489a486aa5644775d593d3..477495ddbc91a34a6493244fea7278e5ea39c22a 100644 (file)
@@ -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 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
index 9d88953ac96b3d92207bb09abc0b60eca6491962..ababc2935fb70b82fc44c3b362a30523162df77a 100644 (file)
@@ -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 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
index 59bcb6a8fe4f9701ee8be62daa972f448ca31ee7..3ce842adf72b27fc992714f625949da4febd8e7d 100644 (file)
@@ -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 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
index 3c2f6e84177d696338a62f181c2fe9f36b881e02..4bbb7ab4b3d21702077c6731b0376373499e9fde 100644 (file)
@@ -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 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
index 4b5796f714ce15dec081472b05b4c451fca2f810..0f9b1a1c65c55d4da98bf039c4c4ac513cfe1ad0 100644 (file)
@@ -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 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
index af6f65225c9c24817df50b2ee91fecf7facd2501..481462f6b7a7260ba76994dbe7ed017f1b741649 100644 (file)
@@ -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 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
index cfaa98d7bb8eb5c01734ff9a8abbe71318c9a3d4..6c1ca8cbc028b7493350f2bbca69d9d79820ed6d 100644 (file)
@@ -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 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
index e7d9489f50c21084943637ef8de70f43bbce3360..bf780719e80f8654458419027a429ac7ab379569 100644 (file)
@@ -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 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
index f61f1fa056f6ea2d26593970edf7eedf924fb1ef..1a08bbbcbf96f255401c5b0b45f7d6564ec19003 100644 (file)
@@ -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 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,listen -usb
index f17f8b55762b249b3a7ab7adcc8a9ec0313fedec..7f7f0f6e724f70a5f06b66110534904934d798bf 100644 (file)
@@ -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 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
index b929f50ecafa8078371d1912c98f6984c0694677..688ca32fffd52f1220f450c98f10b0b36c955665 100644 (file)
@@ -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 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
index 8a4ec20d9b37c48b0ff32ee1bda15d585f8fb577..d59f708d6e64e3727b04a455b77e7445e551a72e 100644 (file)
@@ -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 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
index 3403b26bf8d457e57dba35b6fe2f5886bbf1a1ae..5764c48330e4c29ee3038ec62753c98abfce7aa5 100644 (file)
@@ -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 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
index e3d1848cee23f72121727776f119571f1a8d0de4..f2d1f17b7849f9be1151312369e4435c62f288ac 100644 (file)
@@ -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 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 -parallel none -usb
index 25ff57332f695d817d9572e43805dec3779e51fc..834e47eef60cef413140051ac21025155ee09f9b 100644 (file)
@@ -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 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
index 98faa38e1eeaaacf202debb397cd6225ceaf754e..15060aa2a7a2cdb27e3c26413cea6df42df19c3b 100644 (file)
@@ -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 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
index c85b7b75e2ebc706e6a4b25c60b1eadbbe43858e..f38d3cfd7528985acc873061fd1aff5819eda340 100644 (file)
@@ -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 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
index bdfc371038c711b5c204d3eb2439854228f807cf..800c7b348929bbcbf57324b43f3ebf581a470bf6 100644 (file)
@@ -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 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
index d7ccbfc2024567cb1c299134a52f792003aaac53..c018e94af58929bc5a42aedad4e6c3566781471d 100644 (file)
@@ -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 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
index 864d9818708f83c55456f1bab405b3ac5f6141bc..263eaec8f3636bd5f72ddd6f75bb6b7e07945b35 100644 (file)
@@ -22,11 +22,14 @@ static struct qemud_driver driver;
 
 #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,20 +51,32 @@ static int testCompareXMLToArgvFiles(const char *xml, const char *cmd, int extra
         extraFlags;
 
     if (qemudBuildCommandLine(NULL, &driver,
-                              &vm, flags, &argv,
+                              &vm, flags, &argv, &qenv,
                               NULL, NULL, NULL) < 0)
         goto fail;
 
-    tmp = argv;
     len = 1; /* for trailing newline */
+    tmp = qenv;
+    while (*tmp) {
+        len += strlen(*tmp) + 1;
+        tmp++;
+    }
+
+    tmp = argv;
     while (*tmp) {
         len += strlen(*tmp) + 1;
         tmp++;
     }
     actualargv = malloc(sizeof(*actualargv)*len);
     actualargv[0] = '\0';
+    tmp = qenv;
+    while (*tmp) {
+        if (actualargv[0])
+            strcat(actualargv, " ");
+        strcat(actualargv, *tmp);
+        tmp++;
+    }
     tmp = argv;
-    len = 0;
     while (*tmp) {
         if (actualargv[0])
             strcat(actualargv, " ");
@@ -87,6 +102,14 @@ static int testCompareXMLToArgvFiles(const char *xml, const char *cmd, int extra
         }
         free(argv);
     }
+    if (qenv) {
+        tmp = qenv;
+        while (*tmp) {
+            free(*(char**)tmp);
+            tmp++;
+        }
+        free(qenv);
+    }
     virDomainDefFree(vmdef);
     return ret;
 }
@@ -138,6 +161,14 @@ mymain(int argc, char **argv)
             ret = -1;                                                   \
     } while (0)
 
+    setenv("PATH", "/bin", 1);
+    setenv("USER", "test", 1);
+    setenv("LOGNAME", "test", 1);
+    setenv("HOME", "/home/test", 1);
+    unsetenv("TMPDIR");
+    unsetenv("LD_PRELOAD");
+    unsetenv("LD_LIBRARY_PATH");
+
     DO_TEST("minimal", QEMUD_CMD_FLAG_NAME);
     DO_TEST("boot-cdrom", 0);
     DO_TEST("boot-network", 0);