From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIy56-0006jo-Il for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:29:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIy53-0007mD-Aa for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:29:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIy53-0007m3-52 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 07:29:45 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id BCDB6C0BF2A3 for ; Tue, 12 Jan 2016 12:29:44 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 12 Jan 2016 13:29:35 +0100 Message-Id: <1452601779-5790-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1452601779-5790-1-git-send-email-kraxel@redhat.com> References: <1452601779-5790-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 3/7] console: use qemu_console_lookup_by_device_name in vnc_display_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , Markus Armbruster , Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 09756cd..95ef3bd 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3725,19 +3725,12 @@ void vnc_display_open(const char *id, Error **errp) device_id = qemu_opt_get(opts, "display"); if (device_id) { - DeviceState *dev; int head = qemu_opt_get_number(opts, "head", 0); + Error *err = NULL; - dev = qdev_find_recursive(sysbus_get_default(), device_id); - if (dev == NULL) { - error_setg(errp, "Device '%s' not found", device_id); - goto fail; - } - - con = qemu_console_lookup_by_device(dev, head); - if (con == NULL) { - error_setg(errp, "Device %s is not bound to a QemuConsole", - device_id); + con = qemu_console_lookup_by_device_name(device_id, head, &err); + if (err) { + error_propagate(errp, err); goto fail; } } else { -- 1.8.3.1