From nobody Fri Apr 26 14:52:36 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1562643433; cv=none; d=zoho.com; s=zohoarc; b=IgQ8w8miXCzQmwBQdO6riu35wORlw/jKuZntg5V6Vkfv1F2TAmdSxglmAoi7qgEzaefbxK0rpSclrvWpKk0CXL6mitDkaHLIO8hqrRDNZJ5bjMYRL0F+GSpz63fRGT91U1V6g5wbRp/NtizPIiFsRK4lLgWXtY+Ae6BJRNbrK+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562643433; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lIO1PRF4XOmoNRvPiIhAOTp6U1qHCYS5tfP4osC8zwE=; b=n1NPZ58o/ZVxLKRTf4YhXP1XRsVZnc528wzNnc9Q7zC0TUQpaKeX49oXzE5A55FAGaQs5JfWx4WlMi7Uj5I1moT+uUZG9mpY0Whe/wqRpQ+MLamV5RiKHLfjVlPn4tPlBdY827PhB/6YvQe/p20w8S1LSM93q7gXERD5RqhKt3M= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562643433048311.0567664355327; Mon, 8 Jul 2019 20:37:13 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 33BD8C0587F5; Tue, 9 Jul 2019 03:37:11 +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 F14C37FFE7; Tue, 9 Jul 2019 03:37:10 +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 3CA7C206D4; Tue, 9 Jul 2019 03:37:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x693b6B8017935 for ; Mon, 8 Jul 2019 23:37:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id EB6E453E2C; Tue, 9 Jul 2019 03:37:06 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1FE318A56; Tue, 9 Jul 2019 03:37:06 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 22:36:58 -0500 Message-Id: <20190709033703.1478-2-eblake@redhat.com> In-Reply-To: <20190709033703.1478-1-eblake@redhat.com> References: <20190709033703.1478-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH 1/6] bhyve: Add various vir*Flags API 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 09 Jul 2019 03:37:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake --- src/bhyve/bhyve_driver.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 061888ab0b..ffda7853b8 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -577,17 +577,18 @@ bhyveDomainDefineXML(virConnectPtr conn, const char *= xml) } static int -bhyveDomainUndefine(virDomainPtr domain) +bhyveDomainUndefineFlags(virDomainPtr domain, unsigned int flags) { bhyveConnPtr privconn =3D domain->conn->privateData; virObjectEventPtr event =3D NULL; virDomainObjPtr vm; int ret =3D -1; + virCheckFlags(0, -1); if (!(vm =3D bhyveDomObjFromDomain(domain))) goto cleanup; - if (virDomainUndefineEnsureACL(domain->conn, vm->def) < 0) + if (virDomainUndefineFlagsEnsureACL(domain->conn, vm->def) < 0) goto cleanup; if (!vm->persistent) { @@ -618,6 +619,12 @@ bhyveDomainUndefine(virDomainPtr domain) return ret; } +static int +bhyveDomainUndefine(virDomainPtr domain) +{ + return bhyveDomainUndefineFlags(domain, 0); +} + static int bhyveConnectListDomains(virConnectPtr conn, int *ids, int maxids) { @@ -971,17 +978,19 @@ bhyveDomainCreateXML(virConnectPtr conn, } static int -bhyveDomainDestroy(virDomainPtr dom) +bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { bhyveConnPtr privconn =3D dom->conn->privateData; virDomainObjPtr vm; virObjectEventPtr event =3D NULL; int ret =3D -1; + virCheckFlags(0, -1); + if (!(vm =3D bhyveDomObjFromDomain(dom))) goto cleanup; - if (virDomainDestroyEnsureACL(dom->conn, vm->def) < 0) + if (virDomainDestroyFlagsEnsureACL(dom->conn, vm->def) < 0) goto cleanup; if (virDomainObjCheckActive(vm) < 0) @@ -1002,15 +1011,23 @@ bhyveDomainDestroy(virDomainPtr dom) } static int -bhyveDomainShutdown(virDomainPtr dom) +bhyveDomainDestroy(virDomainPtr dom) +{ + return bhyveDomainDestroyFlags(dom, 0); +} + +static int +bhyveDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { virDomainObjPtr vm; int ret =3D -1; + virCheckFlags(0, -1); + if (!(vm =3D bhyveDomObjFromDomain(dom))) goto cleanup; - if (virDomainShutdownEnsureACL(dom->conn, vm->def) < 0) + if (virDomainShutdownFlagsEnsureACL(dom->conn, vm->def) < 0) goto cleanup; if (virDomainObjCheckActive(vm) < 0) @@ -1023,6 +1040,12 @@ bhyveDomainShutdown(virDomainPtr dom) return ret; } +static int +bhyveDomainShutdown(virDomainPtr dom) +{ + return bhyveDomainShutdownFlags(dom, 0); +} + static int bhyveDomainOpenConsole(virDomainPtr dom, const char *dev_name ATTRIBUTE_UNUSED, @@ -1658,13 +1681,16 @@ static virHypervisorDriver bhyveHypervisorDriver = =3D { .domainCreateWithFlags =3D bhyveDomainCreateWithFlags, /* 1.2.3 */ .domainCreateXML =3D bhyveDomainCreateXML, /* 1.2.4 */ .domainDestroy =3D bhyveDomainDestroy, /* 1.2.2 */ + .domainDestroyFlags =3D bhyveDomainDestroyFlags, /* 5.6.0 */ .domainShutdown =3D bhyveDomainShutdown, /* 1.3.3 */ + .domainShutdownFlags =3D bhyveDomainShutdownFlags, /* 5.6.0 */ .domainLookupByUUID =3D bhyveDomainLookupByUUID, /* 1.2.2 */ .domainLookupByName =3D bhyveDomainLookupByName, /* 1.2.2 */ .domainLookupByID =3D bhyveDomainLookupByID, /* 1.2.3 */ .domainDefineXML =3D bhyveDomainDefineXML, /* 1.2.2 */ .domainDefineXMLFlags =3D bhyveDomainDefineXMLFlags, /* 1.2.12 */ .domainUndefine =3D bhyveDomainUndefine, /* 1.2.2 */ + .domainUndefineFlags =3D bhyveDomainUndefineFlags, /* 5.6.0 */ .domainGetOSType =3D bhyveDomainGetOSType, /* 1.2.21 */ .domainGetXMLDesc =3D bhyveDomainGetXMLDesc, /* 1.2.2 */ .domainIsActive =3D bhyveDomainIsActive, /* 1.2.2 */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 14:52:36 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1562643442; cv=none; d=zoho.com; s=zohoarc; b=ce9+FDoweiRkKVswXk9/ycWmusDcwwJt4KnkTeZP54unTx7RZtGv431DeVryqgMfjfEujpp4h9BEXwrOnha7MSehktK1DYrX6LxP42+4KCMwB5xuxcbCjULJwLZpSIq//gSisSn0GZ5g+PPCe2BlbEUQf0U2rkaNQ/wCpKzmHTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562643442; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=OcyuQE0ZOm1tARX9n02qhvZxanYNRRiHQjrNe2ZDxcY=; b=WX/timTSv/rLlQSRl6vL1pqW4XpQe/vvufEfDvEtx/pPg9dzzWDUDpZACLCWKypuSE1NJvGYw/yXKZyOUh+77vkjjeN8Ivu6McVcgBhB81yGi6956LereDryBXKGO0qewO1LyxBPBoaLE0wDnL1frxsO1bF6IDvxxu79zHjlkAI= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562643442499114.78811283104233; Mon, 8 Jul 2019 20:37:22 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 983BD13A98; Tue, 9 Jul 2019 03:37:20 +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 71F1018A56; Tue, 9 Jul 2019 03:37:20 +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 308B9206DA; Tue, 9 Jul 2019 03:37:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x693b76c017940 for ; Mon, 8 Jul 2019 23:37:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 64ABE53E14; Tue, 9 Jul 2019 03:37:07 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19C2A59D0C; Tue, 9 Jul 2019 03:37:07 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 22:36:59 -0500 Message-Id: <20190709033703.1478-3-eblake@redhat.com> In-Reply-To: <20190709033703.1478-1-eblake@redhat.com> References: <20190709033703.1478-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH 2/6] esx: Add various vir*Flags API 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 09 Jul 2019 03:37:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake --- src/esx/esx_driver.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index deb800a6b7..47d95abd6d 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -1984,7 +1984,9 @@ esxDomainSetMaxMemory(virDomainPtr domain, unsigned l= ong memory) static int -esxDomainSetMemory(virDomainPtr domain, unsigned long memory) +esxDomainSetMemoryFlags(virDomainPtr domain, + unsigned long memory, + unsigned int flags) { int result =3D -1; esxPrivate *priv =3D domain->conn->privateData; @@ -1994,6 +1996,8 @@ esxDomainSetMemory(virDomainPtr domain, unsigned long= memory) esxVI_TaskInfoState taskInfoState; char *taskInfoErrorMessage =3D NULL; + virCheckFlags(0, -1); + if (esxVI_EnsureSession(priv->primary) < 0) return -1; @@ -2037,6 +2041,12 @@ esxDomainSetMemory(virDomainPtr domain, unsigned lon= g memory) } +static int +esxDomainSetMemory(virDomainPtr domain, unsigned long memory) +{ + return esxDomainSetMemoryFlags(domain, memory, 0); +} + /* * libvirt exposed virtual CPU usage in absolute time, ESX doesn't provide= this @@ -5122,6 +5132,7 @@ static virHypervisorDriver esxHypervisorDriver =3D { .domainGetMaxMemory =3D esxDomainGetMaxMemory, /* 0.7.0 */ .domainSetMaxMemory =3D esxDomainSetMaxMemory, /* 0.7.0 */ .domainSetMemory =3D esxDomainSetMemory, /* 0.7.0 */ + .domainSetMemoryFlags =3D esxDomainSetMemoryFlags, /* 5.6.0 */ .domainSetMemoryParameters =3D esxDomainSetMemoryParameters, /* 0.8.6 = */ .domainGetMemoryParameters =3D esxDomainGetMemoryParameters, /* 0.8.6 = */ .domainGetInfo =3D esxDomainGetInfo, /* 0.7.0 */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 14:52:36 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1562643442; cv=none; d=zoho.com; s=zohoarc; b=PnP3nPNcsy5GsgNtz0p6XXiZtOmBB/Nb1O1uvEevb6CCfjXV/thYa9klpTto5KUEAN+G6v6JEFFkviNtuUp67u8CDrgE0xrxumCRM5pypoA+J3vbZxwVBc4Mrxsp43I8ZEvgQS1MQsSXJPnmX1+lXaPQMHfhWm6z25T5muibaVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562643442; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=BgPb7GLRWzdVUcxuiM8CtWMjc+/ugU7iI/ze9bG8TGo=; b=PptUrU5VBHm7h7K4w+tH/yY6qceKh1+OISarfCpdHgd03V7vaHfUW1eWPwBH7MzHCn3zLEr+ZVsPkNGCSVX8ojmY2olPbSlUv/+h4rdTsYmA7K0Qz0QYIwCoYjKlqeqZrRqKDR6SLVNNBCv6MFG8bcloFfc96Yn/BqhaQZid1SU= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562643442326675.0815606962148; Mon, 8 Jul 2019 20:37:22 -0700 (PDT) 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 90E173092669; Tue, 9 Jul 2019 03:37:20 +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 68FAC5D982; Tue, 9 Jul 2019 03:37:20 +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 2C90B206D9; Tue, 9 Jul 2019 03:37:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x693b7YS017956 for ; Mon, 8 Jul 2019 23:37:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id D479753E14; Tue, 9 Jul 2019 03:37:07 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88A2918A56; Tue, 9 Jul 2019 03:37:07 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 22:37:00 -0500 Message-Id: <20190709033703.1478-4-eblake@redhat.com> In-Reply-To: <20190709033703.1478-1-eblake@redhat.com> References: <20190709033703.1478-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH 3/6] phyp: Add various vir*Flags API 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.43]); Tue, 09 Jul 2019 03:37:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake --- src/phyp/phyp_driver.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index e54799dbb4..a4b440a24f 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1657,7 +1657,9 @@ phypGetVIOSFreeSCSIAdapter(virConnectPtr conn) static int -phypDomainAttachDevice(virDomainPtr domain, const char *xml) +phypDomainAttachDeviceFlags(virDomainPtr domain, + const char *xml, + unsigned int flags) { int result =3D -1; virConnectPtr conn =3D domain->conn; @@ -1677,6 +1679,8 @@ phypDomainAttachDevice(virDomainPtr domain, const cha= r *xml) virBuffer buf =3D VIR_BUFFER_INITIALIZER; char *domain_name =3D NULL; + virCheckFlags(0, -1); + if (!(def =3D virDomainDefNew())) goto cleanup; @@ -1808,6 +1812,12 @@ phypDomainAttachDevice(virDomainPtr domain, const ch= ar *xml) return result; } +static int +phypDomainAttachDevice(virDomainPtr domain, const char *xml) +{ + return phypDomainAttachDeviceFlags(domain, xml, 0); +} + static char * phypStorageVolGetKey(virConnectPtr conn, const char *name) { @@ -3330,7 +3340,7 @@ phypDomainReboot(virDomainPtr dom, unsigned int flags) } static int -phypDomainShutdown(virDomainPtr dom) +phypDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { int result =3D -1; virConnectPtr conn =3D dom->conn; @@ -3342,6 +3352,8 @@ phypDomainShutdown(virDomainPtr dom) char *ret =3D NULL; virBuffer buf =3D VIR_BUFFER_INITIALIZER; + virCheckFlags(0, -1); + virBufferAddLit(&buf, "chsysstate"); if (system_type =3D=3D HMC) virBufferAsprintf(&buf, " -m %s", managed_system); @@ -3359,6 +3371,12 @@ phypDomainShutdown(virDomainPtr dom) return result; } +static int +phypDomainShutdown(virDomainPtr dom) +{ + return phypDomainShutdownFlags(dom, 0); +} + static int phypDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { @@ -3675,6 +3693,7 @@ static virHypervisorDriver phypHypervisorDriver =3D { .domainLookupByName =3D phypDomainLookupByName, /* 0.7.0 */ .domainResume =3D phypDomainResume, /* 0.7.0 */ .domainShutdown =3D phypDomainShutdown, /* 0.7.0 */ + .domainShutdownFlags =3D phypDomainShutdownFlags, /* 5.6.0 */ .domainReboot =3D phypDomainReboot, /* 0.9.1 */ .domainDestroy =3D phypDomainDestroy, /* 0.7.3 */ .domainDestroyFlags =3D phypDomainDestroyFlags, /* 0.9.4 */ @@ -3688,6 +3707,7 @@ static virHypervisorDriver phypHypervisorDriver =3D { .connectListDefinedDomains =3D phypConnectListDefinedDomains, /* 0.7.0= */ .connectNumOfDefinedDomains =3D phypConnectNumOfDefinedDomains, /* 0.7= .0 */ .domainAttachDevice =3D phypDomainAttachDevice, /* 0.8.2 */ + .domainAttachDeviceFlags =3D phypDomainAttachDeviceFlags, /* 5.6.0 */ .connectIsEncrypted =3D phypConnectIsEncrypted, /* 0.7.3 */ .connectIsSecure =3D phypConnectIsSecure, /* 0.7.3 */ .domainIsUpdated =3D phypDomainIsUpdated, /* 0.8.6 */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 14:52:36 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1562643445; cv=none; d=zoho.com; s=zohoarc; b=ddRXiFA3SECrz4r9S32oxXaMBuyrXPNpthDtyoxa7p1FINRPMGzSw7WI8U3ZY4unzkBnmnFAw6TPg9r9LhcVRygWngaqB0h86bfQiuRJp1Fc0aArV27mpl4n+ClHMZ0yBbAf0ou3LBvqX//H6BvGn/+Ce+v2NcDmu6psMKdunZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562643445; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=uBDFcXPILtfMURx2QSB+tcC4rNBUg/VJset2myvPd3o=; b=a1AGGnOscuST+w+HuSfRGpLoUHfW678K+UUu6FWkSbl1CyvVqWsXonzlay4KGE1NdXxf8zbEkCzbTYfpmaYjjzrMlpvbD/PKlNDFN+578XFQfjcKf8wJ2SNHZZMRJM2KwArriJQTlmWj18casE61Ng2jFq5vixGObxwAf65g5e0= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562643445294958.1737915658109; Mon, 8 Jul 2019 20:37:25 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id B84AB3082B44; Tue, 9 Jul 2019 03:37:23 +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 961F259D39; Tue, 9 Jul 2019 03:37:23 +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 5E8D718184A5; Tue, 9 Jul 2019 03:37:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x693b82b017963 for ; Mon, 8 Jul 2019 23:37:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4EE3853E14; Tue, 9 Jul 2019 03:37:08 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0302959D0A; Tue, 9 Jul 2019 03:37:07 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 22:37:01 -0500 Message-Id: <20190709033703.1478-5-eblake@redhat.com> In-Reply-To: <20190709033703.1478-1-eblake@redhat.com> References: <20190709033703.1478-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH 4/6] test: Add various vir*Flags API 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 09 Jul 2019 03:37:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Note that virDomainBlockStats does not trivially forward to virDomainBlockStatsFlags, so that one is omitted. Signed-off-by: Eric Blake --- src/test/test_driver.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 7dd448bb20..49d7030d21 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2469,12 +2469,15 @@ static int testDomainSetMaxMemory(virDomainPtr doma= in, return 0; } -static int testDomainSetMemory(virDomainPtr domain, - unsigned long memory) +static int testDomainSetMemoryFlags(virDomainPtr domain, + unsigned long memory, + unsigned int flags) { virDomainObjPtr privdom; int ret =3D -1; + virCheckFlags(0, -1); + if (!(privdom =3D testDomObjFromDomain(domain))) return -1; @@ -2491,6 +2494,12 @@ static int testDomainSetMemory(virDomainPtr domain, return ret; } +static int testDomainSetMemory(virDomainPtr domain, + unsigned long memory) +{ + return testDomainSetMemoryFlags(domain, memory, 0); +} + static int testDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags) { @@ -2679,16 +2688,19 @@ static int testDomainGetVcpus(virDomainPtr domain, return ret; } -static int testDomainPinVcpu(virDomainPtr domain, - unsigned int vcpu, - unsigned char *cpumap, - int maplen) +static int testDomainPinVcpuFlags(virDomainPtr domain, + unsigned int vcpu, + unsigned char *cpumap, + int maplen, + unsigned int flags) { virDomainVcpuDefPtr vcpuinfo; virDomainObjPtr privdom; virDomainDefPtr def; int ret =3D -1; + virCheckFlags(0, -1); + if (!(privdom =3D testDomObjFromDomain(domain))) return -1; @@ -2720,6 +2732,14 @@ static int testDomainPinVcpu(virDomainPtr domain, return ret; } +static int testDomainPinVcpu(virDomainPtr domain, + unsigned int vcpu, + unsigned char *cpumap, + int maplen) +{ + return testDomainPinVcpuFlags(domain, vcpu, cpumap, maplen, 0); +} + static int testDomainGetVcpuPinInfo(virDomainPtr dom, int ncpumaps, @@ -7595,6 +7615,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetMaxMemory =3D testDomainGetMaxMemory, /* 0.1.4 */ .domainSetMaxMemory =3D testDomainSetMaxMemory, /* 0.1.1 */ .domainSetMemory =3D testDomainSetMemory, /* 0.1.4 */ + .domainSetMemoryFlags =3D testDomainSetMemoryFlags, /* 5.6.0 */ .domainGetHostname =3D testDomainGetHostname, /* 5.5.0 */ .domainGetInfo =3D testDomainGetInfo, /* 0.1.1 */ .domainGetState =3D testDomainGetState, /* 0.9.2 */ @@ -7611,6 +7632,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainSetVcpusFlags =3D testDomainSetVcpusFlags, /* 0.8.5 */ .domainGetVcpusFlags =3D testDomainGetVcpusFlags, /* 0.8.5 */ .domainPinVcpu =3D testDomainPinVcpu, /* 0.7.3 */ + .domainPinVcpuFlags =3D testDomainPinVcpuFlags, /* 5.6.0 */ .domainGetVcpus =3D testDomainGetVcpus, /* 0.7.3 */ .domainGetVcpuPinInfo =3D testDomainGetVcpuPinInfo, /* 1.2.18 */ .domainGetMaxVcpus =3D testDomainGetMaxVcpus, /* 0.7.3 */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 14:52:36 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1562643445; cv=none; d=zoho.com; s=zohoarc; b=eJMstgq+sXghBul/KHdruKE0SaLfNGp6B03WDmNn7h2z3tjCwwo75rcrnjKJrv9ELI+3dZcgqBnXPIJvq7Ml6IwZ5cv4Ojqng+KHUguQjNJbchyXVAlKrBBvxgcUIZPv9g5OpgsWtHACH0I6pkHS/bwTryQONVaYmUAbdUmWulA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562643445; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=sqArGzt21MDsQqldrKN4IKguPTMKVXRwZBMUKpkdDbE=; b=JdHjWR+IIyP5wadSod/x14TdT7up9FuRh3nhbASehvSLJ4GdDI3s1cnVjnA0tDKPElG0aN/Pbj2VF2CpxSn8vfHJq799eeYtYaHXBQT/YMDhlmeNZjeQX+J434hMWLlya/mo7Nh15FlZVTSn16KzEyS0mH7uApokuk4KWo7W+nA= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562643445822608.9022679064789; Mon, 8 Jul 2019 20:37:25 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id C3FD37FDF0; Tue, 9 Jul 2019 03:37:23 +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 9919E7FFE1; Tue, 9 Jul 2019 03:37:23 +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 5E7B6206DE; Tue, 9 Jul 2019 03:37:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x693b8M4017968 for ; Mon, 8 Jul 2019 23:37:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD4D153E14; Tue, 9 Jul 2019 03:37:08 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7206618A56; Tue, 9 Jul 2019 03:37:08 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 22:37:02 -0500 Message-Id: <20190709033703.1478-6-eblake@redhat.com> In-Reply-To: <20190709033703.1478-1-eblake@redhat.com> References: <20190709033703.1478-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH 5/6] libvirt: Ensure modern APIs are implemented 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 09 Jul 2019 03:37:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" As shown in recent patches, several drivers provided only an older counterpart of an API, making it harder to uniformly use the newer preferred API form. We can prevent future instances of this by failing the driver at initialization time if a modern API is forgotten when an older API is present. For now, the list includes any interface with a Flags counterpart, except virDomainBlockStatsFlags which is a bit more complex than virDomainBlockStats. Signed-off-by: Eric Blake --- src/libvirt.c | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 7e665b6cba..a12a72a31b 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -567,19 +567,53 @@ int virRegisterConnectDriver(virConnectDriverPtr driver, bool setSharedDrivers) { - VIR_DEBUG("driver=3D%p name=3D%s", driver, - driver ? NULLSTR(driver->hypervisorDriver->name) : "(null)"); + const char *driver_name; + + driver_name =3D driver ? NULLSTR(driver->hypervisorDriver->name) : "(n= ull)"; + VIR_DEBUG("driver=3D%p name=3D%s", driver, driver_name); virCheckNonNullArgReturn(driver, -1); if (virConnectDriverTabCount >=3D MAX_DRIVERS) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Too many drivers, cannot register %s"), - driver->hypervisorDriver->name); + driver_name); return -1; } + /* Check for drivers failing to provide a modern counterpart to an + * older API */ +#define REQUIRE_API(old, new) \ + do { \ + if (driver->hypervisorDriver->old && \ + !driver->hypervisorDriver->new) { \ + fprintf(stderr, " ***FIXME!: driver %s is broken on %s\n", \ + driver ? NULLSTR(driver->hypervisorDriver->name) : "(n= ull)", #new); \ + virReportError(VIR_ERR_INTERNAL_ERROR, \ + _("driver %s is missing %s interface"), \ + driver_name, #new); \ + return -1; \ + } \ + } while (0) + REQUIRE_API(domainShutdown, domainShutdownFlags); + REQUIRE_API(domainDestroy, domainDestroyFlags); + REQUIRE_API(domainSetMemory, domainSetMemoryFlags); + REQUIRE_API(domainSave, domainSaveFlags); + REQUIRE_API(domainRestore, domainRestoreFlags); + REQUIRE_API(domainSetVcpus, domainSetVcpusFlags); + REQUIRE_API(domainGetVcpus, domainGetVcpusFlags); + REQUIRE_API(domainPinVcpu, domainPinVcpuFlags); + REQUIRE_API(domainCreate, domainCreateWithFlags); + REQUIRE_API(domainDefineXML, domainDefineXMLFlags); + REQUIRE_API(domainUndefine, domainUndefineFlags); + REQUIRE_API(domainAttachDevice, domainAttachDeviceFlags); + REQUIRE_API(domainDetachDevice, domainDetachDeviceFlags); + REQUIRE_API(domainGetSchedulerParameters, domainGetSchedulerParameters= Flags); + REQUIRE_API(domainSetSchedulerParameters, domainSetSchedulerParameters= Flags); + REQUIRE_API(nodeDeviceDettach, nodeDeviceDetachFlags); +#undef REQUIRE_API + VIR_DEBUG("registering %s as driver %d", - driver->hypervisorDriver->name, virConnectDriverTabCount); + driver_name, virConnectDriverTabCount); if (setSharedDrivers) { if (driver->interfaceDriver =3D=3D NULL) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 14:52:36 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1562643448; cv=none; d=zoho.com; s=zohoarc; b=g0fccaPPjof+z9cg9dNJaL5qJoe5SkdLcBfbdkAcQQ6lGOpO037Tqyb2azNOQmKARZRFgbaeqe0c7T5Qu0OrUIPhAfynxTQzcFdM0iCfrMHUhldNSjHOeRhsO4RilKfBlhcCn7vvTIl198wXJN2LoXUClXLv/gi7Ebe56xN1BHg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562643448; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vz5XrlO6ypbk/0+5gMJtuyLEWw+rtGHLWuj1xb5jjjY=; b=kCgilMID9Gy59jP6J5UrU5erU9lcIWGd+btkdD04N1HDwxS3S94YAAaQDmiWjm9oFVNDJtPAufiAYXP9YG6pp0dAz5oXETmP3ARjXXbDCTJao6PQ46goagyx9o3wcoaZEysHtZity/ygtvxvNaYMVL5C8br9Sn/gO0cS7bvmESM= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562643448593224.02798606564397; Mon, 8 Jul 2019 20:37:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 328A33086201; Tue, 9 Jul 2019 03:37:27 +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 0BB4683FA6; Tue, 9 Jul 2019 03:37:27 +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 C572118184AD; Tue, 9 Jul 2019 03:37:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x693b9A6017973 for ; Mon, 8 Jul 2019 23:37:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3575D53E14; Tue, 9 Jul 2019 03:37:09 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF7A459D0A; Tue, 9 Jul 2019 03:37:08 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Mon, 8 Jul 2019 22:37:03 -0500 Message-Id: <20190709033703.1478-7-eblake@redhat.com> In-Reply-To: <20190709033703.1478-1-eblake@redhat.com> References: <20190709033703.1478-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH 6/6] bhyve: Ignore no-op flags during virDomainUndefine 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 09 Jul 2019 03:37:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We can ignore flags rather than rejecting them as unknown since a correct implementation of those flags is a no-op given that bhyve lacks managed save or snapshots. Signed-off-by: Eric Blake --- src/bhyve/bhyve_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index ffda7853b8..c2378c536f 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -584,7 +584,10 @@ bhyveDomainUndefineFlags(virDomainPtr domain, unsigned= int flags) virDomainObjPtr vm; int ret =3D -1; - virCheckFlags(0, -1); + /* We have no managed save or snapshots, so we can ignore those flags = */ + virCheckFlags(VIR_DOMAIN_UNDEFINE_MANAGED_SAVE | + VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA, NULL); + if (!(vm =3D bhyveDomObjFromDomain(domain))) goto cleanup; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list