[PATCH 0/7] qemu: Various monitor cleanups and removal of legacy cpu hotplug

Peter Krempa (7): qemuMonitorJSONQueryBlock: Reformat function header qemuMonitorJSONBlockInfoAdd: Refactor hash table addition qemuhotplugtest: Remove tests for legacy cpu hotplug on x86 qemuDomainHotplugAddVcpu: Remove legacy hotplug branch qemu: monitor: Remove unused qemuMonitorSetCPU qemuMonitorEjectMedia: Remove stale comment qemuMonitorJSONSave[Physical|Virtual]Memory: Reformat function headers src/qemu/qemu_hotplug.c | 22 +- src/qemu/qemu_monitor.c | 14 -- src/qemu/qemu_monitor.h | 6 - src/qemu/qemu_monitor_json.c | 77 +++---- src/qemu/qemu_monitor_json.h | 1 - tests/qemuhotplugtest.c | 1 - .../x86-old-bulk-domain.xml | 21 -- .../x86-old-bulk-monitor.json | 193 ------------------ .../x86-old-bulk-result-conf.xml | 31 --- .../x86-old-bulk-result-live.xml | 39 ---- tests/qemumonitorjsontest.c | 2 - 11 files changed, 35 insertions(+), 372 deletions(-) delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml -- 2.31.1

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_monitor_json.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e9be9bdabd..19af6219aa 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2036,10 +2036,11 @@ qemuMonitorJSONGetBalloonInfo(qemuMonitor *mon, } -int qemuMonitorJSONGetMemoryStats(qemuMonitor *mon, - char *balloonpath, - virDomainMemoryStatPtr stats, - unsigned int nr_stats) +int +qemuMonitorJSONGetMemoryStats(qemuMonitor *mon, + char *balloonpath, + virDomainMemoryStatPtr stats, + unsigned int nr_stats) { int ret = -1; g_autoptr(virJSONValue) cmd = NULL; -- 2.31.1

Open code virHashAddEntry so that the error code path can be avoided. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_monitor_json.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 19af6219aa..962876b43a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2220,27 +2220,21 @@ qemuMonitorJSONBlockInfoAdd(GHashTable *table, const char *entryname) { struct qemuDomainDiskInfo *tmp = NULL; - int ret = -1; + + if (g_hash_table_contains(table, entryname)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Duplicate block info for '%s'"), entryname); + return -1; + } tmp = g_new0(struct qemuDomainDiskInfo, 1); *tmp = *info; - tmp->nodename = NULL; - - if (info->nodename) - tmp->nodename = g_strdup(info->nodename); + tmp->nodename = g_strdup(info->nodename); - if (virHashAddEntry(table, entryname, tmp) < 0) - goto cleanup; - - tmp = NULL; - ret = 0; + g_hash_table_insert(table, g_strdup(entryname), tmp); - cleanup: - if (tmp) - VIR_FREE(tmp->nodename); - VIR_FREE(tmp); - return ret; + return 0; } -- 2.31.1

Modern cpu hotplug was introduced in qemu-2.7, thus all qemu versions actually support it. Remove the tests for the legacy hotplug. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/qemuhotplugtest.c | 1 - .../x86-old-bulk-domain.xml | 21 -- .../x86-old-bulk-monitor.json | 193 ------------------ .../x86-old-bulk-result-conf.xml | 31 --- .../x86-old-bulk-result-live.xml | 39 ---- 5 files changed, 285 deletions(-) delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index ec448da09e..3484041cc8 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -874,7 +874,6 @@ mymain(void) } while (0) DO_TEST_CPU_GROUP("x86-modern-bulk", 7, true, false); - DO_TEST_CPU_GROUP("x86-old-bulk", 7, false, false); DO_TEST_CPU_GROUP("ppc64-modern-bulk", 24, true, false); DO_TEST_CPU_GROUP("ppc64-modern-bulk", 15, true, true); DO_TEST_CPU_GROUP("ppc64-modern-bulk", 23, true, true); diff --git a/tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml b/tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml deleted file mode 100644 index ef0e39397b..0000000000 --- a/tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml +++ /dev/null @@ -1,21 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static' current='5'>8</vcpu> - <os> - <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='network'/> - </os> - <cpu> - <topology sockets="4" cores="2" threads="1"/> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - </devices> -</domain> diff --git a/tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json b/tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json deleted file mode 100644 index 626c0a5699..0000000000 --- a/tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json +++ /dev/null @@ -1,193 +0,0 @@ -{"execute":"query-cpus-fast","id":"libvirt-1"} - -{ - "return": [ - { - "target": "x86", - "current": true, - "cpu-index": 0, - "qom-path": "/machine/unattached/device[0]", - "pc": -2130415978, - "halted": true, - "thread-id": 518291 - }, - { - "target": "x86", - "current": false, - "cpu-index": 1, - "qom-path": "/machine/unattached/device[2]", - "pc": -2130415978, - "halted": true, - "thread-id": 518292 - }, - { - "target": "x86", - "current": false, - "cpu-index": 2, - "qom-path": "/machine/unattached/device[3]", - "pc": -2130415978, - "halted": true, - "thread-id": 518294 - }, - { - "target": "x86", - "current": false, - "cpu-index": 3, - "qom-path": "/machine/unattached/device[4]", - "pc": -2130415978, - "halted": true, - "thread-id": 518295 - }, - { - "target": "x86", - "current": false, - "cpu-index": 4, - "qom-path": "/machine/unattached/device[5]", - "pc": -2130415978, - "halted": true, - "thread-id": 518296 - } - ], - "id": "libvirt-22" -} - -{"execute":"cpu-add","arguments":{"id":5},"id":"libvirt-2"} - -{"return": {}} - -{"execute":"query-cpus-fast","id":"libvirt-3"} - -{ - "return": [ - { - "target": "x86", - "current": true, - "cpu-index": 0, - "qom-path": "/machine/unattached/device[0]", - "pc": -2130415978, - "halted": true, - "thread-id": 518291 - }, - { - "target": "x86", - "current": false, - "cpu-index": 1, - "qom-path": "/machine/unattached/device[2]", - "pc": -2130415978, - "halted": true, - "thread-id": 518292 - }, - { - "target": "x86", - "current": false, - "cpu-index": 2, - "qom-path": "/machine/unattached/device[3]", - "pc": -2130415978, - "halted": true, - "thread-id": 518294 - }, - { - "target": "x86", - "current": false, - "cpu-index": 3, - "qom-path": "/machine/unattached/device[4]", - "pc": -2130415978, - "halted": true, - "thread-id": 518295 - }, - { - "target": "x86", - "current": false, - "cpu-index": 4, - "qom-path": "/machine/unattached/device[5]", - "pc": -2130415978, - "halted": true, - "thread-id": 518296 - }, - { - "target": "x86", - "current": false, - "cpu-index": 5, - "qom-path": "/machine/peripheral/vcpu5", - "pc": -2130415978, - "halted": true, - "thread-id": 518297 - } - ], - "id": "libvirt-22" -} - -{"execute":"cpu-add","arguments":{"id":6},"id":"libvirt-4"} - -{"return": {}} - -{"execute":"query-cpus-fast","id":"libvirt-5"} - -{ - "return": [ - { - "target": "x86", - "current": true, - "cpu-index": 0, - "qom-path": "/machine/unattached/device[0]", - "pc": -2130415978, - "halted": true, - "thread-id": 518291 - }, - { - "target": "x86", - "current": false, - "cpu-index": 1, - "qom-path": "/machine/unattached/device[2]", - "pc": -2130415978, - "halted": true, - "thread-id": 518292 - }, - { - "target": "x86", - "current": false, - "cpu-index": 2, - "qom-path": "/machine/unattached/device[3]", - "pc": -2130415978, - "halted": true, - "thread-id": 518294 - }, - { - "target": "x86", - "current": false, - "cpu-index": 3, - "qom-path": "/machine/unattached/device[4]", - "pc": -2130415978, - "halted": true, - "thread-id": 518295 - }, - { - "target": "x86", - "current": false, - "cpu-index": 4, - "qom-path": "/machine/unattached/device[5]", - "pc": -2130415978, - "halted": true, - "thread-id": 518296 - }, - { - "target": "x86", - "current": false, - "cpu-index": 5, - "qom-path": "/machine/peripheral/vcpu5", - "pc": -2130415978, - "halted": true, - "thread-id": 518297 - }, - { - "target": "x86", - "current": false, - "cpu-index": 6, - "qom-path": "/machine/peripheral/vcpu6", - "pc": -2130415978, - "halted": true, - "thread-id": 518298 - } - ], - "id": "libvirt-22" -} diff --git a/tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml b/tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml deleted file mode 100644 index a3ca61ce76..0000000000 --- a/tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml +++ /dev/null @@ -1,31 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static' current='7'>8</vcpu> - <os> - <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='network'/> - </os> - <cpu> - <topology sockets='4' dies='1' cores='2' threads='1'/> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> - </devices> -</domain> diff --git a/tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml b/tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml deleted file mode 100644 index 96dd8b5873..0000000000 --- a/tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml +++ /dev/null @@ -1,39 +0,0 @@ -<domain type='qemu' id='7'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219100</memory> - <currentMemory unit='KiB'>219100</currentMemory> - <vcpu placement='static' current='7'>8</vcpu> - <os> - <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='network'/> - </os> - <cpu> - <topology sockets='4' dies='1' cores='2' threads='1'/> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0'> - <alias name='usb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pci-root'> - <alias name='pci.0'/> - </controller> - <input type='mouse' bus='ps2'> - <alias name='input0'/> - </input> - <input type='keyboard' bus='ps2'> - <alias name='input1'/> - </input> - <audio id='1' type='none'/> - <memballoon model='virtio'> - <alias name='balloon0'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </memballoon> - </devices> -</domain> -- 2.31.1

Report an error if the new hotplug is not supported and remove the alternate code paths. The modern cpu-hotplug code was introduced in qemu-2.7. We keep the capability so that proper errors are reported in case a platform doesn't support hotplug. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_hotplug.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a7b432b6f5..51c5b517b4 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6488,25 +6488,24 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver, virDomainVcpuDef *vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); unsigned int nvcpus = vcpupriv->vcpus; - bool newhotplug = qemuDomainSupportsNewVcpuHotplug(vm); int rc; int oldvcpus = virDomainDefGetVcpus(vm->def); size_t i; - if (newhotplug) { - vcpupriv->alias = g_strdup_printf("vcpu%u", vcpu); - - if (!(vcpuprops = qemuBuildHotpluggableCPUProps(vcpuinfo))) + if (!qemuDomainSupportsNewVcpuHotplug(vm)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cpu hotplug is not supported")); return -1; } + vcpupriv->alias = g_strdup_printf("vcpu%u", vcpu); + + if (!(vcpuprops = qemuBuildHotpluggableCPUProps(vcpuinfo))) + return -1; + qemuDomainObjEnterMonitor(driver, vm); - if (newhotplug) { - rc = qemuMonitorAddDeviceProps(qemuDomainGetMonitor(vm), &vcpuprops); - } else { - rc = qemuMonitorSetCPU(qemuDomainGetMonitor(vm), vcpu, true); - } + rc = qemuMonitorAddDeviceProps(qemuDomainGetMonitor(vm), &vcpuprops); if (qemuDomainObjExitMonitor(driver, vm) < 0) return -1; @@ -6517,8 +6516,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver, return -1; /* start outputting of the new XML element to allow keeping unpluggability */ - if (newhotplug) - vm->def->individualvcpus = true; + vm->def->individualvcpus = true; if (qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE, false) < 0) return -1; -- 2.31.1

On a Friday in 2021, Peter Krempa wrote:
Report an error if the new hotplug is not supported and remove the alternate code paths.
The modern cpu-hotplug code was introduced in qemu-2.7. We keep the capability so that proper errors are reported in case a platform doesn't support hotplug.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_hotplug.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a7b432b6f5..51c5b517b4 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6488,25 +6488,24 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver, virDomainVcpuDef *vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); unsigned int nvcpus = vcpupriv->vcpus; - bool newhotplug = qemuDomainSupportsNewVcpuHotplug(vm); int rc; int oldvcpus = virDomainDefGetVcpus(vm->def); size_t i;
- if (newhotplug) { - vcpupriv->alias = g_strdup_printf("vcpu%u", vcpu); - - if (!(vcpuprops = qemuBuildHotpluggableCPUProps(vcpuinfo))) + if (!qemuDomainSupportsNewVcpuHotplug(vm)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cpu hotplug is not supported")); return -1;
Request: reindent return

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_monitor.c | 14 -------------- src/qemu/qemu_monitor.h | 2 -- src/qemu/qemu_monitor_json.c | 25 ------------------------- src/qemu/qemu_monitor_json.h | 1 - tests/qemumonitorjsontest.c | 2 -- 5 files changed, 44 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 908ee0d302..a63915b6d7 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2222,20 +2222,6 @@ qemuMonitorSetBalloon(qemuMonitor *mon, } -/* - * Returns: 0 if CPU modification was successful or -1 on failure - */ -int -qemuMonitorSetCPU(qemuMonitor *mon, int cpu, bool online) -{ - VIR_DEBUG("cpu=%d online=%d", cpu, online); - - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONSetCPU(mon, cpu, online); -} - - int qemuMonitorEjectMedia(qemuMonitor *mon, const char *dev_name, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index b54c1cf87a..5c5df04130 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -794,8 +794,6 @@ int qemuMonitorExpirePassword(qemuMonitor *mon, const char *expire_time); int qemuMonitorSetBalloon(qemuMonitor *mon, unsigned long long newmem); -int qemuMonitorSetCPU(qemuMonitor *mon, int cpu, bool online); - /* XXX should we pass the virDomainDiskDef *instead * and hide dev_name details inside monitor. Reconsider diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 962876b43a..2ba8da454b 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2898,31 +2898,6 @@ qemuMonitorJSONSetBalloon(qemuMonitor *mon, } -int qemuMonitorJSONSetCPU(qemuMonitor *mon, - int cpu, bool online) -{ - g_autoptr(virJSONValue) cmd = NULL; - g_autoptr(virJSONValue) reply = NULL; - - if (online) { - cmd = qemuMonitorJSONMakeCommand("cpu-add", - "i:id", cpu, - NULL); - } else { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("vCPU unplug is not supported by this QEMU")); - return -1; - } - if (!cmd) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return -1; - - return qemuMonitorJSONCheckError(cmd, reply); -} - - /** * Run QMP command to eject a media from ejectable device. * diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index f9e01e5bf5..d91c5928e3 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -104,7 +104,6 @@ int qemuMonitorJSONExpirePassword(qemuMonitor *mon, const char *expire_time); int qemuMonitorJSONSetBalloon(qemuMonitor *mon, unsigned long long newmem); -int qemuMonitorJSONSetCPU(qemuMonitor *mon, int cpu, bool online); int qemuMonitorJSONEjectMedia(qemuMonitor *mon, const char *dev_name, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index e5ba39cd2f..0e6e0fe284 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1168,7 +1168,6 @@ GEN_TEST_FUNC(qemuMonitorJSONBlockResize, "vda", "asdf", 123456) GEN_TEST_FUNC(qemuMonitorJSONSetPassword, "spice", "secret_password", "disconnect") GEN_TEST_FUNC(qemuMonitorJSONExpirePassword, "spice", "123456") GEN_TEST_FUNC(qemuMonitorJSONSetBalloon, 1024) -GEN_TEST_FUNC(qemuMonitorJSONSetCPU, 1, true) GEN_TEST_FUNC(qemuMonitorJSONEjectMedia, "hdc", true) GEN_TEST_FUNC(qemuMonitorJSONChangeMedia, "hdc", "/foo/bar", "formatstr") GEN_TEST_FUNC(qemuMonitorJSONSaveVirtualMemory, 0, 1024, "/foo/bar") @@ -3011,7 +3010,6 @@ mymain(void) DO_TEST_GEN(qemuMonitorJSONSetPassword); DO_TEST_GEN(qemuMonitorJSONExpirePassword); DO_TEST_GEN(qemuMonitorJSONSetBalloon); - DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetCPU, true); DO_TEST_GEN(qemuMonitorJSONEjectMedia); DO_TEST_GEN_DEPRECATED(qemuMonitorJSONChangeMedia, true); DO_TEST_GEN(qemuMonitorJSONSaveVirtualMemory); -- 2.31.1

The QMP implementation didn't use any new approach. The command itself is now only used with legacy qemu versions. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_monitor.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 5c5df04130..cd1c1c4291 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -795,10 +795,6 @@ int qemuMonitorExpirePassword(qemuMonitor *mon, int qemuMonitorSetBalloon(qemuMonitor *mon, unsigned long long newmem); -/* XXX should we pass the virDomainDiskDef *instead - * and hide dev_name details inside monitor. Reconsider - * this when doing the QMP implementation - */ int qemuMonitorEjectMedia(qemuMonitor *mon, const char *dev_name, bool force); -- 2.31.1

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_monitor_json.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 2ba8da454b..7d21e23800 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2981,18 +2981,21 @@ static int qemuMonitorJSONSaveMemory(qemuMonitor *mon, } -int qemuMonitorJSONSaveVirtualMemory(qemuMonitor *mon, - unsigned long long offset, - unsigned long long length, - const char *path) +int +qemuMonitorJSONSaveVirtualMemory(qemuMonitor *mon, + unsigned long long offset, + unsigned long long length, + const char *path) { return qemuMonitorJSONSaveMemory(mon, "memsave", offset, length, path); } -int qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon, - unsigned long long offset, - unsigned long long length, - const char *path) + +int +qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon, + unsigned long long offset, + unsigned long long length, + const char *path) { return qemuMonitorJSONSaveMemory(mon, "pmemsave", offset, length, path); } -- 2.31.1

On a Friday in 2021, Peter Krempa wrote:
Peter Krempa (7): qemuMonitorJSONQueryBlock: Reformat function header qemuMonitorJSONBlockInfoAdd: Refactor hash table addition qemuhotplugtest: Remove tests for legacy cpu hotplug on x86 qemuDomainHotplugAddVcpu: Remove legacy hotplug branch qemu: monitor: Remove unused qemuMonitorSetCPU qemuMonitorEjectMedia: Remove stale comment qemuMonitorJSONSave[Physical|Virtual]Memory: Reformat function headers
src/qemu/qemu_hotplug.c | 22 +- src/qemu/qemu_monitor.c | 14 -- src/qemu/qemu_monitor.h | 6 - src/qemu/qemu_monitor_json.c | 77 +++---- src/qemu/qemu_monitor_json.h | 1 - tests/qemuhotplugtest.c | 1 - .../x86-old-bulk-domain.xml | 21 -- .../x86-old-bulk-monitor.json | 193 ------------------ .../x86-old-bulk-result-conf.xml | 31 --- .../x86-old-bulk-result-live.xml | 39 ---- tests/qemumonitorjsontest.c | 2 - 11 files changed, 35 insertions(+), 372 deletions(-) delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml delete mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Peter Krempa