]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_process: Use accessor for def->mem.total_memory
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Mar 2021 14:47:04 +0000 (15:47 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 16 Mar 2021 08:16:13 +0000 (09:16 +0100)
When connecting to the monitor, a timeout is calculated that is
bigger the more memory guest has (because QEMU has to allocate
and possibly zero out the memory and what not, empirically
deducted). However, when computing the timeout the @total_memory
mmember is accessed directly even though
virDomainDefGetMemoryTotal() should have been used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index 971a270793c49adb3f635555477f8c716b9011e0..5f3126022102298bf5313d57e9ad753d81293605 100644 (file)
@@ -2026,7 +2026,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
      * handing them over to qemu. This can be very time
      * consuming. Therefore, add a second to timeout for each
      * 1GiB of guest RAM. */
-    timeout = vm->def->mem.total_memory / (1024 * 1024);
+    timeout = virDomainDefGetMemoryTotal(vm->def) / (1024 * 1024);
 
     ignore_value(virTimeMillisNow(&priv->monStart));