spice: ui_info tweaks

Use the new dpy_ui_info_supported function.
Clarifies the control flow.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2015-03-13 12:21:50 +01:00
parent c6e484707f
commit 5a9259a0b5

View File

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