From nobody Mon Feb 9 01:21:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15495425061236.273393318814783; Thu, 7 Feb 2019 04:28:26 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88D447FDE6; Thu, 7 Feb 2019 12:28:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44C384145; Thu, 7 Feb 2019 12:28:22 +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 D4AF53F7CD; Thu, 7 Feb 2019 12:28:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x17CSKlL014306 for ; Thu, 7 Feb 2019 07:28:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1925260C65; Thu, 7 Feb 2019 12:28:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92D2560C61 for ; Thu, 7 Feb 2019 12:28:19 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 7 Feb 2019 13:28:06 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/10] qemu: Clean up usage of qemuDomainUpdateCurrentMemorySize 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 07 Feb 2019 12:28:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Remove the uneeded attribute and return value. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 15 ++++----------- src/qemu/qemu_domain.h | 3 +-- src/qemu/qemu_driver.c | 7 ++----- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d9da696a55..ed63a6f33f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10256,25 +10256,18 @@ qemuDomainMachineHasBuiltinIDE(const char *machin= e) * * In case when the balloon is not present for the domain, the function * recalculates the maximum size to reflect possible changes. - * - * Returns 0 on success and updates vm->def->mem.cur_balloon if necessary. */ -int -qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - virDomainObjPtr vm) +void +qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm) { /* inactive domain doesn't need size update */ if (!virDomainObjIsActive(vm)) - return 0; + return; /* if no balloning is available, the current size equals to the current * full memory size */ - if (!virDomainDefHasMemballoon(vm->def)) { + if (!virDomainDefHasMemballoon(vm->def)) vm->def->mem.cur_balloon =3D virDomainDefGetMemoryTotal(vm->def); - return 0; - } - - return 0; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index fe474170dc..6d800a6c9d 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -851,8 +851,7 @@ bool qemuDomainMachineIsPSeries(const char *machine, const virArch arch); bool qemuDomainMachineHasBuiltinIDE(const char *machine); -int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm); unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDefPtr def); int qemuDomainAdjustMaxMemLock(virDomainObjPtr vm); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 97042a972b..af8ef05dd9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2585,7 +2585,6 @@ qemuDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { unsigned long long maxmem; - virQEMUDriverPtr driver =3D dom->conn->privateData; virDomainObjPtr vm; int ret =3D -1; @@ -2595,8 +2594,7 @@ qemuDomainGetInfo(virDomainPtr dom, if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (qemuDomainUpdateCurrentMemorySize(driver, vm) < 0) - goto cleanup; + qemuDomainUpdateCurrentMemorySize(vm); memset(info, 0, sizeof(*info)); @@ -7352,8 +7350,7 @@ static char if (virDomainGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; - if (qemuDomainUpdateCurrentMemorySize(driver, vm) < 0) - goto cleanup; + qemuDomainUpdateCurrentMemorySize(vm); if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) flags |=3D QEMU_DOMAIN_FORMAT_LIVE_FLAGS; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list