]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Error on unsupported graphics config
authorCole Robinson <crobinso@redhat.com>
Mon, 26 Jul 2010 14:30:01 +0000 (10:30 -0400)
committerCole Robinson <crobinso@redhat.com>
Tue, 27 Jul 2010 19:41:36 +0000 (15:41 -0400)
Throw an explicit error if multiple graphics devices are specified, or
an unsupported type is specified (rdp).

src/qemu/qemu_conf.c

index 0dbab48351eb81a6fae4347ecd390baf1cbca542..05ad67de6de9f65757677994cb2831c0a9baf289 100644 (file)
@@ -4542,6 +4542,12 @@ int qemudBuildCommandLine(virConnectPtr conn,
         }
     }
 
+    if (def->ngraphics > 1) {
+        qemuReportError(VIR_ERR_INTERNAL_ERROR,
+                        "%s", _("only 1 graphics device is supported"));
+        goto error;
+    }
+
     if ((def->ngraphics == 1) &&
         def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
         virBuffer opt = VIR_BUFFER_INITIALIZER;
@@ -4641,6 +4647,12 @@ int qemudBuildCommandLine(virConnectPtr conn,
          * default, since the default changes :-( */
         if (qemuCmdFlags & QEMUD_CMD_FLAG_SDL)
             ADD_ARG_LIT("-sdl");
+
+    } else if ((def->ngraphics == 1)) {
+        qemuReportError(VIR_ERR_INTERNAL_ERROR,
+                    _("unsupported graphics type '%s'"),
+                    virDomainGraphicsTypeToString(def->graphics[0]->type));
+        goto error;
     }
 
     if (def->nvideos) {