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

Michal Privoznik posted 1 patch 2 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/5e43e82be348ad4094ce42c756ea3e977f310a02.1650357892.git.mprivozn@redhat.com
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] qemu: Fetch info on NVDIMM-s too when updating memory devices
Posted by Michal Privoznik 2 years ago
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>
---
 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
Re: [PATCH] qemu: Fetch info on NVDIMM-s too when updating memory devices
Posted by Ján Tomko 2 years ago
On a Tuesday in 2022, Michal Privoznik wrote:
>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>
>---
> src/qemu/qemu_monitor_json.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano