From nobody Sun Feb 8 20:29:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1636554346043303.8141198583004; Wed, 10 Nov 2021 06:25:46 -0800 (PST) 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-197-uxsbpptlNj-ha0L03mA12g-1; Wed, 10 Nov 2021 09:25:43 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7404F5203; Wed, 10 Nov 2021 14:25:35 +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 5006F1970E; Wed, 10 Nov 2021 14:25:35 +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 617231832DD2; Wed, 10 Nov 2021 14:25:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AAEPFub020261 for ; Wed, 10 Nov 2021 09:25:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0A95D2026D48; Wed, 10 Nov 2021 14:25:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 026A12026D65 for ; Wed, 10 Nov 2021 14:25:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 773DE181B7A5 for ; Wed, 10 Nov 2021 14:25:09 +0000 (UTC) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-449-jLG8gkPBOb6oHUpLqzc7sQ-1; Wed, 10 Nov 2021 09:25:07 -0500 Received: by mail-pf1-f177.google.com with SMTP id x64so2800164pfd.6 for ; Wed, 10 Nov 2021 06:25:07 -0800 (PST) Received: from localhost ([2400:ddc0:1000::b373:390c]) by smtp.gmail.com with ESMTPSA id b4sm24268241pfl.60.2021.11.10.06.25.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 06:25:06 -0800 (PST) X-MC-Unique: uxsbpptlNj-ha0L03mA12g-1 X-MC-Unique: jLG8gkPBOb6oHUpLqzc7sQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=50g5NT1J0zqaE8GTuuYsj23bfnifY7jvDP31+Y7vdQI=; b=OmR9XkdX7dGU7lqIaBfXdsu9HEypPyvu5oH48WMAs42ADiDoVt9p0yHJ8Uq+b4u3bU BGmdvkff1JZNxcsO21d+AX4T5I7EaIJEx2GCPSh0HZGwS/1th73ThEf016Bc4KyUrjkF +s70FHnO7ruEwJuWAbM7sMyWyeQNErfCFD2xPuq7WroAZdf0lXVTIxXPo9dmqGJQRsVv /M/tB5NWGBm/udxf4d2YaJGGzITd/VK5Vq4PqM7OD6GQfRby/+yvfF2EovbxzsLdU3+k Sv/xEX2gyWbn560/unb3g7qwo0t4uCIoCJFOFP+e70NHxYImrLNkTThxhPcO0w4WpnwS fbLw== X-Gm-Message-State: AOAM5321QXnZP5aPLzdbAP4anDJdqvqI22DJY9XpJiiBIa76/izrWAtm d2I0udFlAt+MuOwJT+yPgcxQMYt053ZxPl0f X-Google-Smtp-Source: ABdhPJzLA97iZB8A08bFNW7lUw+RhgewmgUnoQBc7avnWGD0peu8Kqd1KChetESnPQzSRR5SiYcI/g== X-Received: by 2002:a62:1b86:0:b0:47b:d112:96d4 with SMTP id b128-20020a621b86000000b0047bd11296d4mr244917pfb.52.1636554306382; Wed, 10 Nov 2021 06:25:06 -0800 (PST) From: Luke Yue To: libvir-list@redhat.com Subject: [PATCH v3 08/12] conf: Add a memballoon helper for future use Date: Wed, 10 Nov 2021 22:24:27 +0800 Message-Id: <20211110142431.10622-9-lukedyue@gmail.com> In-Reply-To: <20211110142431.10622-1-lukedyue@gmail.com> References: <20211110142431.10622-1-lukedyue@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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.84 on 10.5.11.23 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-ZM-MESSAGEID: 1636554346986100001 Content-Type: text/plain; charset="utf-8" Currently it will only be used in test driver. Signed-off-by: Luke Yue --- src/conf/domain_conf.c | 24 ++++++++++++++++++++++++ src/conf/domain_conf.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 29 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 512bfab9e9..92a8bd63f3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16998,6 +16998,30 @@ virDomainTPMDefRemove(virDomainDef *def, } =20 =20 +bool +virDomainMemballoonDefEquals(const virDomainMemballoonDef *a, + const virDomainMemballoonDef *b) +{ + if (a->model !=3D b->model) + return false; + + if (a->period !=3D b->period) + return false; + + if (a->autodeflate !=3D b->autodeflate) + return false; + + if (a->free_page_reporting !=3D b->free_page_reporting) + return false; + + if (a->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + !virDomainDeviceInfoAddressIsEqual(&a->info, &b->info)) + return false; + + return true; +} + + char * virDomainDefGetDefaultEmulator(virDomainDef *def, virCaps *caps) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 715c8fbd16..f60ba37d19 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3863,6 +3863,10 @@ ssize_t virDomainTPMDefFind(const virDomainDef *def, virDomainTPMDef *virDomainTPMDefRemove(virDomainDef *def, size_t idx) ATTRIBUTE_NONNULL(1); =20 +bool virDomainMemballoonDefEquals(const virDomainMemballoonDef *a, + const virDomainMemballoonDef *b) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; + VIR_ENUM_DECL(virDomainTaint); VIR_ENUM_DECL(virDomainTaintMessage); VIR_ENUM_DECL(virDomainVirt); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index cfda58320a..b143537bb4 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -506,6 +506,7 @@ virDomainLoaderTypeFromString; virDomainLoaderTypeToString; virDomainLockFailureTypeFromString; virDomainLockFailureTypeToString; +virDomainMemballoonDefEquals; virDomainMemballoonModelTypeFromString; virDomainMemballoonModelTypeToString; virDomainMemoryDefFree; --=20 2.33.1