From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2xIe-0003tJ-Mj for qemu-devel@nongnu.org; Thu, 11 Jun 2015 03:53:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2xIb-0007W8-H1 for qemu-devel@nongnu.org; Thu, 11 Jun 2015 03:53:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2xIb-0007Vx-Bb for qemu-devel@nongnu.org; Thu, 11 Jun 2015 03:53:17 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 4EC8036B4DC for ; Thu, 11 Jun 2015 07:53:16 +0000 (UTC) From: Gerd Hoffmann Date: Thu, 11 Jun 2015 09:53:00 +0200 Message-Id: <1434009180-16351-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1434009180-16351-1-git-send-email-kraxel@redhat.com> References: <1434009180-16351-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/2] spice: ui_info tweaks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Use the new dpy_ui_info_supported function. Clarifies the control flow. Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index 4e6356a..cc4a6ce 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -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 = { -- 1.8.3.1