diff options
author | Kevin Wolf <kwolf@redhat.com> | 2021-10-08 15:34:41 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2021-10-15 16:11:22 +0200 |
commit | f3558b1b763683bb877f7dd5b282469cdadc65c3 (patch) | |
tree | dee581ad0e79dad1278e280071ccc49fb68b30e9 /hw/vfio | |
parent | 12b2fad7dcc8d08b6a59d1b14caa392ea614c6d9 (diff) | |
download | qemu-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 'hw/vfio')
-rw-r--r-- | hw/vfio/pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 4feaa1c..5cdf1d4 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -29,10 +29,10 @@ #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h" +#include "qapi/qmp/qdict.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/module.h" -#include "qemu/option.h" #include "qemu/range.h" #include "qemu/units.h" #include "sysemu/kvm.h" @@ -941,7 +941,7 @@ static void vfio_pci_size_rom(VFIOPCIDevice *vdev) } if (vfio_opt_rom_in_denylist(vdev)) { - if (dev->opts && qemu_opt_get(dev->opts, "rombar")) { + if (dev->opts && qdict_haskey(dev->opts, "rombar")) { warn_report("Device at %s is known to cause system instability" " issues during option rom execution", vdev->vbasedev.name); |