[PATCH] qemu: Fetch info on NVDIMM-s too when updating memory devices

Michal Privoznik mprivozn at redhat.com
Tue Apr 19 08:44:52 UTC 2022


Sometimes it may come handy to learn what address is a NVDIMM
mapped to inside a guest. While users can provide an address they
want to have NVDIMM mapped to, it's optional. Fortunately, when a
domain is being started we issue the 'query-memory-devices'
monitor command and the reply is the same for 'dimm' and 'nvdimm'
types. Therefore, updating NVDIMM address is trivial.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_monitor_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index d5622bd6d9..68ee322ad9 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -7484,7 +7484,7 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitor *mon,
         meminfo = g_new0(qemuMonitorMemoryDeviceInfo, 1);
 
         /* dimm memory devices */
-        if (STREQ(type, "dimm")) {
+        if (STREQ(type, "dimm") || STREQ(type, "nvdimm") ) {
             if (virJSONValueObjectGetNumberUlong(dimminfo, "addr",
                                                  &meminfo->address) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-- 
2.35.1



More information about the libvir-list mailing list