[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/7] console: use qemu_console_lookup_by_device_name
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 2/7] console: use qemu_console_lookup_by_device_name in qemu_input_handler_bind |
Date: |
Tue, 12 Jan 2016 13:29:34 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/input.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/ui/input.c b/ui/input.c
index 006667b..1409e01 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -81,19 +81,12 @@ void qemu_input_handler_bind(QemuInputHandlerState *s,
const char *device_id, int head,
Error **errp)
{
- DeviceState *dev;
QemuConsole *con;
+ Error *err = NULL;
- dev = qdev_find_recursive(sysbus_get_default(), device_id);
- if (dev == NULL) {
- error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
- "Device '%s' not found", device_id);
- return;
- }
-
- 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);
return;
}
--
1.8.3.1