[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v2 2/3] qemu: graphics support for simultaneous one of each sdl, vnc, spice



---
 src/qemu/qemu_command.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ba99c7a..a1a4523 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6183,9 +6183,26 @@ qemuBuildCommandLine(virConnectPtr conn,
     }
 
     if (def->ngraphics > 1) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("only 1 graphics device is supported"));
-        goto error;
+        int sdl = 0, vnc = 0, spice = 0;
+        for (i = 0 ; i < def->ngraphics ; ++i) {
+            switch (def->graphics[i]->type) {
+            case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
+                ++sdl;
+                break;
+            case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
+                ++vnc;
+                break;
+            case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+                ++spice;
+                break;
+            }
+        }
+        if (sdl > 1 || vnc > 1 || spice > 1) {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           "%s", _("only 1 graphics device of each type "
+                                   "(sdl, vnc, spice) is supported"));
+            goto error;
+        }
     }
 
     for (i = 0 ; i < def->ngraphics ; ++i) {
-- 
1.8.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]