The function now does not do anything useful. Replace it by the pointer
check.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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 = NULL;
const char *defaultAlias = 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 = NULL;
*aliasret = NULL;
- if (!virStoragePRDefIsEnabled(disk->src->pr))
+ if (!disk->src->pr)
return 0;
if (!(socketPath = 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 src,
}
}
- 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 ATTRIBUTE_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 = NULL;
char *ret = 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 = NULL;
*stopDaemon = 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
--
2.16.2