aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-20 18:01:24 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-20 18:01:24 +0100
commit0a99aae5fab5ed260aab96049c274b0334eb4085 (patch)
tree7db67e570b622a37a2139da871b79b0386942e4b /qom
parent53001c148340127c2dca1f90329804cd0ac0e236 (diff)
parent705456c0d7f24fbd76733c891525b8eeea332e8b (diff)
downloadqemu-0a99aae5fab5ed260aab96049c274b0334eb4085.zip
qemu-0a99aae5fab5ed260aab96049c274b0334eb4085.tar.gz
qemu-0a99aae5fab5ed260aab96049c274b0334eb4085.tar.bz2
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pc,pci,virtio,hotplug fixes, enhancements numa work by Hu Tao and others memory hotplug by Igor vhost-user by Nikolay, Antonios and others guest virtio announcements by Jason qtest fixes by Sergey qdev hotplug fixes by Paolo misc other fixes mostly by myself Signed-off-by: Michael S. Tsirkin <mst@redhat.com> * remotes/mst/tags/for_upstream: (109 commits) numa: use RAM_ADDR_FMT with ram_addr_t qapi/string-output-visitor: fix bugs tests: simplify code qapi: fix input visitor bugs acpi: rephrase comment qmp: add ACPI_DEVICE_OST event handling qmp: add query-acpi-ospm-status command acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices acpi: introduce TYPE_ACPI_DEVICE_IF interface qmp: add query-memory-devices command numa: handle mmaped memory allocation failure correctly pc: acpi: do not hardcode preprocessor qmp: clean out whitespace qdev: recursively unrealize devices when unrealizing bus qdev: reorganize error reporting in bus_set_realized qapi: fix build on glib < 2.28 qapi: make string output visitor parse int list qapi: make string input visitor parse int list tests: fix memory leak in test of string input visitor hmp: add info memdev ... Conflicts: include/hw/i386/pc.h [PMM: fixed minor conflict in pc.h] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index e42b254..3876618 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -13,6 +13,7 @@
#include "qom/object.h"
#include "qemu-common.h"
#include "qapi/visitor.h"
+#include "qapi-visit.h"
#include "qapi/string-input-visitor.h"
#include "qapi/string-output-visitor.h"
#include "qapi/qmp/qerror.h"
@@ -938,6 +939,40 @@ int64_t object_property_get_int(Object *obj, const char *name,
return retval;
}
+int object_property_get_enum(Object *obj, const char *name,
+ const char *strings[], Error **errp)
+{
+ StringOutputVisitor *sov;
+ StringInputVisitor *siv;
+ int ret;
+
+ sov = string_output_visitor_new(false);
+ object_property_get(obj, string_output_get_visitor(sov), name, errp);
+ siv = string_input_visitor_new(string_output_get_string(sov));
+ string_output_visitor_cleanup(sov);
+ visit_type_enum(string_input_get_visitor(siv),
+ &ret, strings, NULL, name, errp);
+ string_input_visitor_cleanup(siv);
+
+ return ret;
+}
+
+void object_property_get_uint16List(Object *obj, const char *name,
+ uint16List **list, Error **errp)
+{
+ StringOutputVisitor *ov;
+ StringInputVisitor *iv;
+
+ ov = string_output_visitor_new(false);
+ object_property_get(obj, string_output_get_visitor(ov),
+ name, errp);
+ iv = string_input_visitor_new(string_output_get_string(ov));
+ visit_type_uint16List(string_input_get_visitor(iv),
+ list, NULL, errp);
+ string_output_visitor_cleanup(ov);
+ string_input_visitor_cleanup(iv);
+}
+
void object_property_parse(Object *obj, const char *string,
const char *name, Error **errp)
{