From 6e9c4811be37f1f237f7a5610da22af31f15cb99 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 15 Mar 2021 15:47:04 +0100 Subject: [PATCH] qemu_process: Use accessor for def->mem.total_memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 971a270793..5f31260221 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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));