Re: [PATCH v2 10/13] qemu: Refresh the actual size of virtio-mem on monitor reconnect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 18, 2021 at 14:31:05 +0100, Michal Privoznik wrote:
> If the QEMU driver restarts it loses the track of the actual size
> of virtio-mem (because it's runtime type of information and thus
> not stored in XML) and therefore, we have to refresh it when
> reconnecting to the domain monitor.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c       | 37 ++++++++++++++++++++----
>  src/qemu/qemu_monitor.h      |  3 ++
>  src/qemu/qemu_monitor_json.c | 56 ++++++++++++++++++++++--------------
>  src/qemu/qemu_process.c      |  3 ++
>  4 files changed, 72 insertions(+), 27 deletions(-)

[...]

>  int qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon,
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index 9ce7ba52ba..09e898442d 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -8238,7 +8238,6 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
>      virJSONValuePtr cmd;
>      virJSONValuePtr reply = NULL;
>      virJSONValuePtr data = NULL;
> -    qemuMonitorMemoryDeviceInfoPtr meminfo = NULL;
>      size_t i;
>  
>      if (!(cmd = qemuMonitorJSONMakeCommand("query-memory-devices", NULL)))
> @@ -8259,6 +8258,9 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
>  
>      for (i = 0; i < virJSONValueArraySize(data); i++) {
>          virJSONValuePtr elem = virJSONValueArrayGet(data, i);
> +        g_autofree qemuMonitorMemoryDeviceInfoPtr meminfo = NULL;
> +        virJSONValuePtr dimminfo;
> +        const char *devalias;
>          const char *type;

../../../libvirt/src/qemu/qemu_monitor_json.c:8335:13: error: ‘devalias’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 8335 |         if (virHashAddEntry(info, devalias, meminfo) < 0)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux