]> git.proxmox.com Git - mirror_qemu.git/commitdiff
spice: ui_info tweaks
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 13 Mar 2015 11:21:50 +0000 (12:21 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 11 Jun 2015 07:06:14 +0000 (09:06 +0200)
Use the new dpy_ui_info_supported function.
Clarifies the control flow.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/spice-display.c

index 4e6356a96704d5a30e529d1ab27ae3daaa65f682..cc4a6ce98deb75f2fbd742aaded1717f71ed53ea 100644 (file)
@@ -661,7 +661,10 @@ static int interface_client_monitors_config(QXLInstance *sin,
 {
     SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
     QemuUIInfo info;
-    int rc;
+
+    if (!dpy_ui_info_supported(ssd->dcl.con)) {
+        return 0; /* == not supported by guest */
+    }
 
     if (!mc) {
         return 1;
@@ -676,14 +679,10 @@ static int interface_client_monitors_config(QXLInstance *sin,
         info.width  = mc->monitors[0].width;
         info.height = mc->monitors[0].height;
     }
-    rc = dpy_set_ui_info(ssd->dcl.con, &info);
-    dprint(1, "%s/%d: size %dx%d, rc %d   <---   ==========================\n",
-           __func__, ssd->qxl.id, info.width, info.height, rc);
-    if (rc != 0) {
-        return 0; /* == not supported by guest */
-    } else {
-        return 1;
-    }
+    dpy_set_ui_info(ssd->dcl.con, &info);
+    dprint(1, "%s/%d: size %dx%d\n", __func__, ssd->qxl.id,
+           info.width, info.height);
+    return 1;
 }
 
 static const QXLInterface dpy_interface = {