aboutsummaryrefslogtreecommitdiff
path: root/include/monitor
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2021-10-08 15:34:41 +0200
committerKevin Wolf <kwolf@redhat.com>2021-10-15 16:11:22 +0200
commitf3558b1b763683bb877f7dd5b282469cdadc65c3 (patch)
treedee581ad0e79dad1278e280071ccc49fb68b30e9 /include/monitor
parent12b2fad7dcc8d08b6a59d1b14caa392ea614c6d9 (diff)
downloadqemu-f3558b1b763683bb877f7dd5b282469cdadc65c3.zip
qemu-f3558b1b763683bb877f7dd5b282469cdadc65c3.tar.gz
qemu-f3558b1b763683bb877f7dd5b282469cdadc65c3.tar.bz2
qdev: Base object creation on QDict rather than QemuOpts
QDicts are both what QMP natively uses and what the keyval parser produces. Going through QemuOpts isn't useful for either one, so switch the main device creation function to QDicts. By sharing more code with the -object/object-add code path, we can even reduce the code size a bit. This commit doesn't remove the detour through QemuOpts from any code path yet, but it allows the following commits to do so. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20211008133442.141332-15-kwolf@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/monitor')
-rw-r--r--include/monitor/qdev.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/monitor/qdev.h b/include/monitor/qdev.h
index 74e6c55..1d57bf6 100644
--- a/include/monitor/qdev.h
+++ b/include/monitor/qdev.h
@@ -9,6 +9,8 @@ void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp);
int qdev_device_help(QemuOpts *opts);
DeviceState *qdev_device_add(QemuOpts *opts, Error **errp);
+DeviceState *qdev_device_add_from_qdict(const QDict *opts,
+ bool from_json, Error **errp);
/**
* qdev_set_id: parent the device and set its id if provided.