[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/7] console: use qemu_console_lookup_by_device_name
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 3/7] console: use qemu_console_lookup_by_device_name in vnc_display_open |
Date: |
Tue, 12 Jan 2016 13:29:35 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
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