summaryrefslogtreecommitdiffstats
path: root/qmp.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-11-19 17:54:46 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-11-19 17:54:46 +0000
commit28c3e6ee72a34d3c2c44ef508b599fa460b273bb (patch)
treee3fa63f74323e330b101798d5a9b3fd54bf0eebc /qmp.c
parent348c32709fdbeb475dd072af49523cfdd75873f1 (diff)
parent9f4aa7cef2214137db192b252f1d4fc1799d05c7 (diff)
downloadhqemu-28c3e6ee72a34d3c2c44ef508b599fa460b273bb.zip
hqemu-28c3e6ee72a34d3c2c44ef508b599fa460b273bb.tar.gz
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions * Fix for properties on objects > 4 GiB * Performance improvements for QOM property handling * Assertion cleanups * MAINTAINERS additions # gpg: Signature made Thu 19 Nov 2015 14:32:16 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: MAINTAINERS: Add check-qom-{interface,proplist} to QOM qom: Clean up assertions to display values on failure qom: Replace object property list with GHashTable qom: Add a test case for complex property finalization net: Convert net filter code to use object property iterators ppc: Convert spapr code to use object property iterators vl: Convert machine help code to use object property iterators qmp: Convert QMP code to use object property iterators qom: Introduce ObjectPropertyIterator struct for iteration qdev: Change Property::offset field to ptrdiff_t type Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/qmp.c b/qmp.c
index ddc63ea..0a1fa19 100644
--- a/qmp.c
+++ b/qmp.c
@@ -210,6 +210,7 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp)
bool ambiguous = false;
ObjectPropertyInfoList *props = NULL;
ObjectProperty *prop;
+ ObjectPropertyIterator *iter;
obj = object_resolve_path(path, &ambiguous);
if (obj == NULL) {
@@ -222,7 +223,8 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp)
return NULL;
}
- QTAILQ_FOREACH(prop, &obj->properties, node) {
+ iter = object_property_iter_init(obj);
+ while ((prop = object_property_iter_next(iter))) {
ObjectPropertyInfoList *entry = g_malloc0(sizeof(*entry));
entry->value = g_malloc0(sizeof(ObjectPropertyInfo));
@@ -232,6 +234,7 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp)
entry->value->name = g_strdup(prop->name);
entry->value->type = g_strdup(prop->type);
}
+ object_property_iter_free(iter);
return props;
}
@@ -503,6 +506,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
ObjectClass *klass;
Object *obj;
ObjectProperty *prop;
+ ObjectPropertyIterator *iter;
DevicePropertyInfoList *prop_list = NULL;
klass = object_class_by_name(typename);
@@ -531,7 +535,8 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
obj = object_new(typename);
- QTAILQ_FOREACH(prop, &obj->properties, node) {
+ iter = object_property_iter_init(obj);
+ while ((prop = object_property_iter_next(iter))) {
DevicePropertyInfo *info;
DevicePropertyInfoList *entry;
@@ -562,6 +567,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
entry->next = prop_list;
prop_list = entry;
}
+ object_property_iter_free(iter);
object_unref(obj);
OpenPOWER on IntegriCloud