The function being introduced is responsibel for excuting 'object_del' command to hot remove memory backend. Signed-off-by: Zhu Guihua <zhugh.fnst@xxxxxxxxxxxxxx> --- src/qemu/qemu_monitor.c | 20 ++++++++++++++++++++ src/qemu/qemu_monitor.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1db8ad0..c94a8d0 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4219,6 +4219,26 @@ int qemuMonitorAddMemoryBackend(qemuMonitorPtr mon, return -1; } +int qemuMonitorDelMemoryBackend(qemuMonitorPtr mon, + const char *objID) +{ + VIR_DEBUG("mon=%p objID=%s", mon, objID); + + if (!mon) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); + return -1; + } + + if (!mon->json) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("JSON monitor is required")); + return -1; + } + + return qemuMonitorDelObject(mon, objID); +} + int qemuMonitorAttachCharDev(qemuMonitorPtr mon, const char *chrID, virDomainChrSourceDefPtr chr) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 9a69611..7f02627 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -866,6 +866,8 @@ int qemuMonitorGetTPMTypes(qemuMonitorPtr mon, int qemuMonitorAddMemoryBackend(qemuMonitorPtr mon, const char *objID, virDomainDimmDefPtr dimm); +int qemuMonitorDelMemoryBackend(qemuMonitorPtr mon, + const char *objID); int qemuMonitorAttachCharDev(qemuMonitorPtr mon, const char *chrID, -- 1.9.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list