aboutsummaryrefslogtreecommitdiff
path: root/hw/block/xen-block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2020-02-24 15:29:55 +0100
committerKevin Wolf <kwolf@redhat.com>2020-03-06 17:21:27 +0100
commit5f07c4d60d091320186e7b0edaf9ed2cc16b2d1e (patch)
tree26dee459d8fc099c99ba98d020ee9820df7df9e1 /hw/block/xen-block.c
parent14837c6493d42f5f85d910935654725217a5770b (diff)
qapi: Flatten object-add
Mapping object-add to the command line as is doesn't result in nice syntax because of the nesting introduced with 'props'. This becomes nicer and more consistent with device_add and netdev_add when we accept properties for the object on the top level instead. 'props' is still accepted after this patch, but marked as deprecated. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20200224143008.13362-8-kwolf@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/block/xen-block.c')
-rw-r--r--hw/block/xen-block.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 686bbc3f0d..3885464513 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -18,6 +18,7 @@
#include "qapi/visitor.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
+#include "qom/object_interfaces.h"
#include "hw/xen/xen_common.h"
#include "hw/block/xen_blkif.h"
#include "hw/qdev-properties.h"
@@ -858,10 +859,18 @@ static XenBlockIOThread *xen_block_iothread_create(const char *id,
{
XenBlockIOThread *iothread = g_new(XenBlockIOThread, 1);
Error *local_err = NULL;
+ QDict *opts;
+ QObject *ret_data;
iothread->id = g_strdup(id);
- qmp_object_add(TYPE_IOTHREAD, id, false, NULL, &local_err);
+ opts = qdict_new();
+ qdict_put_str(opts, "qom-type", TYPE_IOTHREAD);
+ qdict_put_str(opts, "id", id);
+ qmp_object_add(opts, &ret_data, &local_err);
+ qobject_unref(opts);
+ qobject_unref(ret_data);
+
if (local_err) {
error_propagate(errp, local_err);