]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: fix parsing of -sdl arg
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 10 Nov 2015 12:18:47 +0000 (12:18 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 10 Nov 2015 12:19:57 +0000 (12:19 +0000)
The previous commit

  commit 4e8993a25006bc5d7c95311d430cc01d8de63564
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Mon Nov 9 16:20:08 2015 +0000

    qemu: assume various QEMU 0.10 features are always available

Added broken handling of -sdl. Instead of duplicating existing
SDL handling code, just ensure it is invoked in the right
scenarios.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_command.c

index c016d438fa2d4ba93ca48c2ee344ed0c66dcd0dd..792ada3122ed05935f05942bcde8eeb0d6a1cfcb 100644 (file)
@@ -12759,6 +12759,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
     qemuDomainCmdlineDefPtr cmd = NULL;
     virDomainDiskDefPtr disk = NULL;
     const char *ceph_args = qemuFindEnv(progenv, "CEPH_ARGS");
+    bool have_sdl = false;
 
     if (pidfile)
         *pidfile = NULL;
@@ -12982,10 +12983,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
                 goto error;
             }
         } else if (STREQ(arg, "-sdl")) {
-            virDomainGraphicsDefPtr sdl;
-            if (VIR_ALLOC(sdl) < 0)
-                goto error;
-            sdl->type = VIR_DOMAIN_GRAPHICS_TYPE_SDL;
+            have_sdl = true;
         } else if (STREQ(arg, "-m")) {
             int mem;
             WANT_VALUE();
@@ -13672,7 +13670,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
         VIR_FREE(capsdata);
     }
 
-    if (!nographics && def->ngraphics == 0) {
+    if (!nographics && (def->ngraphics == 0 || have_sdl)) {
         virDomainGraphicsDefPtr sdl;
         const char *display = qemuFindEnv(progenv, "DISPLAY");
         const char *xauth = qemuFindEnv(progenv, "XAUTHORITY");