[PATCH] qemu: Reject SDL graphic if it's not supported by qemu

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

 



If the emulator doesn't support SDL graphic, we should reject
the use of SDL graphic xml with error messages, but not ignore
it silently.

* src/qemu/qemu_command.c
---
 src/qemu/qemu_command.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7dd8e03..cf4ae01 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3567,6 +3567,14 @@ qemuBuildCommandLine(virConnectPtr conn,
         }
     } else if ((def->ngraphics == 1) &&
                def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
+        if (!(qemuCmdFlags & QEMUD_CMD_FLAG_SDL)) {
+            qemuReportError(VIR_ERR_INTERNAL_ERROR,
+                            _("sdl not supported by '%s'"),
+                            def->emulator);
+
+            goto error;
+        }
+
         if (def->graphics[0]->data.sdl.xauth)
             virCommandAddEnvPair(cmd, "XAUTHORITY",
                                  def->graphics[0]->data.sdl.xauth);
@@ -3586,9 +3594,7 @@ qemuBuildCommandLine(virConnectPtr conn,
         /* New QEMU has this flag to let us explicitly ask for
          * SDL graphics. This is better than relying on the
          * default, since the default changes :-( */
-        if (qemuCmdFlags & QEMUD_CMD_FLAG_SDL)
-            virCommandAddArg(cmd, "-sdl");
-
+        virCommandAddArg(cmd, "-sdl");
     } else if ((def->ngraphics == 1) &&
                def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
         virBuffer opt = VIR_BUFFER_INITIALIZER;
--
1.7.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]