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

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>
This commit is contained in:
Michal Privoznik 2022-04-19 10:41:07 +02:00
parent 6be7beb3bd
commit 48b9a6ae31

View 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",