]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fetch info on NVDIMM-s too when updating memory devices
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 19 Apr 2022 08:41:07 +0000 (10:41 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 19 Apr 2022 11:31:53 +0000 (13:31 +0200)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor_json.c

index d5622bd6d97caab8f53b241c09690c6953e747d8..776f4ab2ea50235a515d881ffa7aa1192024831e 100644 (file)
@@ -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",