[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constrain
From: |
Laszlo Ersek |
Subject: |
[Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error |
Date: |
Thu, 31 Jan 2013 16:42:25 +0100 |
When searching for a bus by name, lookup failure means different things
for qbus_find_bus() and qbus_find_recursive(); distinguish them by error
codes as well.
Signed-off-by: Laszlo Ersek <address@hidden>
---
include/qapi/qmp/qerror.h | 3 +++
hw/qdev-monitor.c | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 6c0a18d..940ac21 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -69,6 +69,9 @@ void assert_no_error(Error *err);
#define QERR_BUS_NOT_FOUND \
ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found"
+#define QERR_BUS_WITH_SLOTS_NOT_FOUND \
+ ERROR_CLASS_GENERIC_ERROR, "No bus called '%s' with free slots was found"
+
#define QERR_COMMAND_DISABLED \
ERROR_CLASS_GENERIC_ERROR, "The command %s has been disabled for this
instance"
diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 34f5014..f18fe50 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -331,7 +331,7 @@ static BusState *qbus_find(const char *path)
}
bus = qbus_find_recursive(sysbus_get_default(), elem, NULL);
if (!bus) {
- qerror_report(QERR_BUS_NOT_FOUND, elem);
+ qerror_report(QERR_BUS_WITH_SLOTS_NOT_FOUND, elem);
return NULL;
}
pos = len;
--
1.7.1
Re: [Qemu-devel] traversal termination in qbus_find_recursive() due to "max_dev", Laszlo Ersek, 2013/01/31
[Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error,
Laszlo Ersek <=
- Re: [Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error, Peter Maydell, 2013/01/31
- Re: [Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error, Laszlo Ersek, 2013/01/31
- Re: [Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error, Peter Maydell, 2013/01/31
- Re: [Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error, Laszlo Ersek, 2013/01/31
- Re: [Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error, Peter Maydell, 2013/01/31
- Re: [Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error, Laszlo Ersek, 2013/01/31
- Re: [Qemu-devel] [RFC 2/2] qbus_find_recursive(): the "free slots" constraint needs a dedicated error, Peter Maydell, 2013/01/31