From nobody Mon Feb 9 08:28:00 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 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