From nobody Sun May 5 17:14:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615827127; cv=none; d=zohomail.com; s=zohoarc; b=g8t54NFpEQUFZfy4linhdFaAkHnNk59Y8V28uY5tVqvgvuqF8T5kYQWIXfanJ70lp3iFQX48Na7SuJeRqN2GLtJ72wHTha8Jpa5UWpyr+ArAA+ZpdLpmpdT/xvHrXRSpCTTGqyNJtA2fX2qUQUVXJ1E9b17kVSHelwJTxaOSh94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615827127; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=myO2tKEx7Q4Fz+UqPPAus5cIsBR5G4zZRJCCXkIcncM=; b=kzGbtjxcSWeK3md1dUM/NtRGLOXOu2uzAmdnHX6IIzA4qmh5v9LlF3v3MKPJVzWpGAdsoyLyijdzoN+xEEZGjw7YbP0KO07cqSv3BfWsQRN4ZA1Prw/B75suo6zoe/QADy/ZLaVEG+LeEcaQzzlROL6VwAuDPoFpSBGKbGLEVb8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615827127641954.9436483629319; Mon, 15 Mar 2021 09:52:07 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-587-N5JvdS29NeqVFnsZrmcV4A-1; Mon, 15 Mar 2021 12:51:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 274EC1084CA1; Mon, 15 Mar 2021 16:51:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF0281962E; Mon, 15 Mar 2021 16:51:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8307A18155DE; Mon, 15 Mar 2021 16:51:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12FGppN3032186 for ; Mon, 15 Mar 2021 12:51:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5B94E5D9D3; Mon, 15 Mar 2021 16:51:51 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id D19435D9C0 for ; Mon, 15 Mar 2021 16:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615827121; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=myO2tKEx7Q4Fz+UqPPAus5cIsBR5G4zZRJCCXkIcncM=; b=UGIODYEuBu5QBf5kVcuk0Vn+7y4ssEhDUHgP1UU7x2UICirIT1czteZfD5ViqYkoLyRzzu 4HOlXhQ1G1j1t14JZqV2QCT+9sQNd5VySjdlShwJI4zvmLq/MWkgOSgEXEnZjnqOmpwdzH 41QXuIxusPT2TNWHr8O3h839KUGTXGc= X-MC-Unique: N5JvdS29NeqVFnsZrmcV4A-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_process: Use accessor for def->mem.total_memory Date: Mon, 15 Mar 2021 17:51:44 +0100 Message-Id: <3ac10f7422186cfef78bf594465755ae0d4caca7.1615827104.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- 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 800b7b197d..f6da5afb48 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2077,7 +2077,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomain= ObjPtr 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 =3D vm->def->mem.total_memory / (1024 * 1024); + timeout =3D virDomainDefGetMemoryTotal(vm->def) / (1024 * 1024); =20 ignore_value(virTimeMillisNow(&priv->monStart)); =20 --=20 2.26.2