mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-29 02:30:29 -07:00
The QMP device_add monitor command converts the QDict arguments to QemuOpts and then back again to QDict. This process only supports scalar types. Device properties like virtio-blk-pci's iothread-vq-mapping (an array of objects) are silently dropped by qemu_opts_from_qdict() during the QemuOpts conversion even though QAPI is capable of validating them. As a result, hotplugging virtio-blk-pci devices with the iothread-vq-mapping property does not work as expected (the property is ignored). Get rid of the QemuOpts conversion in qmp_device_add() and call qdev_device_add_from_qdict() with from_json=true. Using the QMP command's QDict arguments directly allows non-scalar properties. The HMP is also adjusted since qmp_device_add()'s now expects properly typed JSON arguments and cannot be used from HMP anymore. Move the code that was previously in qmp_device_add() (with QemuOpts conversion and from_json=false) into hmp_device_add() so that its behavior is unchanged. This patch changes the behavior of QMP device_add but not HMP device_add. QMP clients that sent incorrectly typed device_add QMP commands no longer work. This is a breaking change but clients should be using the correct types already. See the netdev_add QAPIfication in commit |
||
|---|---|---|
| .. | ||
| arch_init.c | ||
| async-teardown.c | ||
| balloon.c | ||
| bootdevice.c | ||
| cpu-timers.c | ||
| cpus.c | ||
| datadir.c | ||
| device_tree-stub.c | ||
| device_tree.c | ||
| dirtylimit.c | ||
| dma-helpers.c | ||
| globals.c | ||
| ioport.c | ||
| main.c | ||
| memory.c | ||
| memory_ldst.c.inc | ||
| memory_mapping.c | ||
| meson.build | ||
| physmem.c | ||
| qdev-monitor.c | ||
| qemu-seccomp.c | ||
| qtest.c | ||
| rtc.c | ||
| runstate-action.c | ||
| runstate-hmp-cmds.c | ||
| runstate.c | ||
| tpm-hmp-cmds.c | ||
| tpm.c | ||
| trace-events | ||
| trace.h | ||
| vl.c | ||
| watchpoint.c | ||