From nobody Wed May 14 10:46:45 2025 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 1526294559538486.5931028655; Mon, 14 May 2018 03:42:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5373C30C79D6; Mon, 14 May 2018 10:42:37 +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 C26EB99349; Mon, 14 May 2018 10:42:36 +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 3B9781801249; Mon, 14 May 2018 10:42:36 +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 w4EAgKKF003647 for ; Mon, 14 May 2018 06:42:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1329C2026DFD; Mon, 14 May 2018 10:42:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F48E2026E0E; Mon, 14 May 2018 10:42:19 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 14 May 2018 12:41:57 +0200 Message-Id: <166f0eab5d6f6e2431815fe3fc9b8aa4755830de.1526294432.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 06/13] util: storage: Drop virStoragePRDefIsEnabled 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: , MIME-Version: 1.0 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.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 14 May 2018 10:42:38 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The function now does not do anything useful. Replace it by the pointer check. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 - src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 8 ++++---- src/qemu/qemu_hotplug.c | 2 +- src/util/virstoragefile.c | 7 ------- src/util/virstoragefile.h | 1 - 6 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index d28a751ebd..dd10be9753 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2804,7 +2804,6 @@ virStorageNetHostTransportTypeToString; virStorageNetProtocolTypeToString; virStoragePRDefFormat; virStoragePRDefFree; -virStoragePRDefIsEnabled; virStoragePRDefIsEqual; virStoragePRDefIsManaged; virStoragePRDefParseXML; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 29ca2005a0..2bdba7734a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1477,7 +1477,7 @@ qemuBuildDriveSourcePR(virBufferPtr buf, char *alias =3D NULL; const char *defaultAlias =3D NULL; - if (!virStoragePRDefIsEnabled(disk->src->pr)) + if (!disk->src->pr) return 0; if (virStoragePRDefIsManaged(disk->src->pr)) @@ -9690,7 +9690,7 @@ qemuBuildPRManagerInfoProps(virDomainObjPtr vm, *propsret =3D NULL; *aliasret =3D NULL; - if (!virStoragePRDefIsEnabled(disk->src->pr)) + if (!disk->src->pr) return 0; if (!(socketPath =3D qemuDomainGetPRSocketPath(vm, disk->src->pr))) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 611a96d6be..c8d2daa26f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4204,7 +4204,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr s= rc, } } - if (virStoragePRDefIsEnabled(src->pr) && + if (src->pr && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("reservations not supported with this QEMU binary= ")); @@ -10240,7 +10240,7 @@ qemuDomainSetupDisk(virQEMUDriverConfigPtr cfg ATTR= IBUTE_UNUSED, } /* qemu-pr-helper might require access to /dev/mapper/control. */ - if (virStoragePRDefIsEnabled(disk->src->pr) && + if (disk->src->pr && qemuDomainCreateDevice(DEVICE_MAPPER_CONTROL_PATH, data, true) < 0) goto cleanup; @@ -11273,7 +11273,7 @@ qemuDomainNamespaceSetupDisk(virDomainObjPtr vm, } /* qemu-pr-helper might require access to /dev/mapper/control. */ - if (virStoragePRDefIsEnabled(src->pr) && + if (src->pr && (VIR_STRDUP(dmPath, DEVICE_MAPPER_CONTROL_PATH) < 0 || VIR_APPEND_ELEMENT_COPY(paths, npaths, dmPath) < 0)) goto cleanup; @@ -12050,7 +12050,7 @@ qemuDomainGetPRSocketPath(virDomainObjPtr vm, const char *defaultAlias =3D NULL; char *ret =3D NULL; - if (!virStoragePRDefIsEnabled(pr)) + if (!pr) return NULL; if (virStoragePRDefIsManaged(pr)) { diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 52e1abdcd3..39c457e607 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3838,7 +3838,7 @@ qemuDomainDiskNeedRemovePR(virDomainObjPtr vm, *aliasret =3D NULL; *stopDaemon =3D false; - if (!virStoragePRDefIsEnabled(disk->src->pr)) + if (!disk->src->pr) return 0; if (!virStoragePRDefIsManaged(disk->src->pr)) { diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index d6907e47bb..c89bdb9e49 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2018,13 +2018,6 @@ virStoragePRDefIsEqual(virStoragePRDefPtr a, } -bool -virStoragePRDefIsEnabled(virStoragePRDefPtr prd) -{ - return !!prd; -} - - bool virStoragePRDefIsManaged(virStoragePRDefPtr prd) { diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index ec49152880..3a90c60fa5 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -396,7 +396,6 @@ void virStoragePRDefFormat(virBufferPtr buf, virStoragePRDefPtr prd); bool virStoragePRDefIsEqual(virStoragePRDefPtr a, virStoragePRDefPtr b); -bool virStoragePRDefIsEnabled(virStoragePRDefPtr prd); bool virStoragePRDefIsManaged(virStoragePRDefPtr prd); virSecurityDeviceLabelDefPtr --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list