[PATCH 1/4] qemu: Don't error out on 'unknown' memory model in qemuMonitorJSONGetMemoryDeviceInfo()

Michal Privoznik posted 4 patches 2 years, 11 months ago
[PATCH 1/4] qemu: Don't error out on 'unknown' memory model in qemuMonitorJSONGetMemoryDeviceInfo()
Posted by Michal Privoznik 2 years, 11 months ago
When starting QEMU (or when reconnecting to a running one),
qemuMonitorJSONGetMemoryDeviceInfo() is called to refresh info on
memory devices. In here, query-memory-devices is called which
returns info on all memory devices. The result is then iterated
over and for some memory models runtime information is updated.
The rest is to be ignored. Except, when introducing SGX support,
this was turned into an error leaving us unable to start any
domain with virtio-pmem memory device (as virtio-pmem is to be
ignored).

Fixes: ddb1bc051959eef4ad7ed6ac47b57056632bdb5e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_monitor_json.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index e81b464eea..d76fea8b00 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -7243,9 +7243,8 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitor *mon,
                 return -1;
             }
         } else {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("%s memory device info is not handled yet"), type);
-                return -1;
+            /* type not handled yet */
+            continue;
         }
 
         meminfo = g_new0(qemuMonitorMemoryDeviceInfo, 1);
-- 
2.39.2
Re: [PATCH 1/4] qemu: Don't error out on 'unknown' memory model in qemuMonitorJSONGetMemoryDeviceInfo()
Posted by Kristina Hanicova 2 years, 11 months ago
On Mon, Feb 27, 2023 at 12:35 PM Michal Privoznik <mprivozn@redhat.com>
wrote:

> When starting QEMU (or when reconnecting to a running one),
> qemuMonitorJSONGetMemoryDeviceInfo() is called to refresh info on
> memory devices. In here, query-memory-devices is called which
> returns info on all memory devices. The result is then iterated
> over and for some memory models runtime information is updated.
> The rest is to be ignored. Except, when introducing SGX support,
> this was turned into an error leaving us unable to start any
> domain with virtio-pmem memory device (as virtio-pmem is to be
> ignored).
>
> Fixes: ddb1bc051959eef4ad7ed6ac47b57056632bdb5e
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_monitor_json.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>


Reviewed-by: Kristina Hanicova <khanicov@redhat.com>