提交 900fc661 编写于 作者: P Peter Krempa

util: storage: Drop virStoragePRDefIsEnabled

The function now does not do anything useful. Replace it by the pointer
check.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 e72b3f0b
......@@ -2806,7 +2806,6 @@ virStorageNetHostTransportTypeToString;
virStorageNetProtocolTypeToString;
virStoragePRDefFormat;
virStoragePRDefFree;
virStoragePRDefIsEnabled;
virStoragePRDefIsEqual;
virStoragePRDefIsManaged;
virStoragePRDefParseXML;
......
......@@ -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))
......@@ -9740,7 +9740,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)))
......
......@@ -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)) {
......
......@@ -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)) {
......
......@@ -2018,13 +2018,6 @@ virStoragePRDefIsEqual(virStoragePRDefPtr a,
}
bool
virStoragePRDefIsEnabled(virStoragePRDefPtr prd)
{
return !!prd;
}
bool
virStoragePRDefIsManaged(virStoragePRDefPtr prd)
{
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册