提交 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; ...@@ -2806,7 +2806,6 @@ virStorageNetHostTransportTypeToString;
virStorageNetProtocolTypeToString; virStorageNetProtocolTypeToString;
virStoragePRDefFormat; virStoragePRDefFormat;
virStoragePRDefFree; virStoragePRDefFree;
virStoragePRDefIsEnabled;
virStoragePRDefIsEqual; virStoragePRDefIsEqual;
virStoragePRDefIsManaged; virStoragePRDefIsManaged;
virStoragePRDefParseXML; virStoragePRDefParseXML;
......
...@@ -1477,7 +1477,7 @@ qemuBuildDriveSourcePR(virBufferPtr buf, ...@@ -1477,7 +1477,7 @@ qemuBuildDriveSourcePR(virBufferPtr buf,
char *alias = NULL; char *alias = NULL;
const char *defaultAlias = NULL; const char *defaultAlias = NULL;
if (!virStoragePRDefIsEnabled(disk->src->pr)) if (!disk->src->pr)
return 0; return 0;
if (virStoragePRDefIsManaged(disk->src->pr)) if (virStoragePRDefIsManaged(disk->src->pr))
...@@ -9740,7 +9740,7 @@ qemuBuildPRManagerInfoProps(virDomainObjPtr vm, ...@@ -9740,7 +9740,7 @@ qemuBuildPRManagerInfoProps(virDomainObjPtr vm,
*propsret = NULL; *propsret = NULL;
*aliasret = NULL; *aliasret = NULL;
if (!virStoragePRDefIsEnabled(disk->src->pr)) if (!disk->src->pr)
return 0; return 0;
if (!(socketPath = qemuDomainGetPRSocketPath(vm, disk->src->pr))) if (!(socketPath = qemuDomainGetPRSocketPath(vm, disk->src->pr)))
......
...@@ -4204,7 +4204,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src, ...@@ -4204,7 +4204,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
} }
} }
if (virStoragePRDefIsEnabled(src->pr) && if (src->pr &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) { !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("reservations not supported with this QEMU binary")); _("reservations not supported with this QEMU binary"));
...@@ -10240,7 +10240,7 @@ qemuDomainSetupDisk(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, ...@@ -10240,7 +10240,7 @@ qemuDomainSetupDisk(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED,
} }
/* qemu-pr-helper might require access to /dev/mapper/control. */ /* 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) qemuDomainCreateDevice(DEVICE_MAPPER_CONTROL_PATH, data, true) < 0)
goto cleanup; goto cleanup;
...@@ -11273,7 +11273,7 @@ qemuDomainNamespaceSetupDisk(virDomainObjPtr vm, ...@@ -11273,7 +11273,7 @@ qemuDomainNamespaceSetupDisk(virDomainObjPtr vm,
} }
/* qemu-pr-helper might require access to /dev/mapper/control. */ /* 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_STRDUP(dmPath, DEVICE_MAPPER_CONTROL_PATH) < 0 ||
VIR_APPEND_ELEMENT_COPY(paths, npaths, dmPath) < 0)) VIR_APPEND_ELEMENT_COPY(paths, npaths, dmPath) < 0))
goto cleanup; goto cleanup;
...@@ -12050,7 +12050,7 @@ qemuDomainGetPRSocketPath(virDomainObjPtr vm, ...@@ -12050,7 +12050,7 @@ qemuDomainGetPRSocketPath(virDomainObjPtr vm,
const char *defaultAlias = NULL; const char *defaultAlias = NULL;
char *ret = NULL; char *ret = NULL;
if (!virStoragePRDefIsEnabled(pr)) if (!pr)
return NULL; return NULL;
if (virStoragePRDefIsManaged(pr)) { if (virStoragePRDefIsManaged(pr)) {
......
...@@ -3838,7 +3838,7 @@ qemuDomainDiskNeedRemovePR(virDomainObjPtr vm, ...@@ -3838,7 +3838,7 @@ qemuDomainDiskNeedRemovePR(virDomainObjPtr vm,
*aliasret = NULL; *aliasret = NULL;
*stopDaemon = false; *stopDaemon = false;
if (!virStoragePRDefIsEnabled(disk->src->pr)) if (!disk->src->pr)
return 0; return 0;
if (!virStoragePRDefIsManaged(disk->src->pr)) { if (!virStoragePRDefIsManaged(disk->src->pr)) {
......
...@@ -2018,13 +2018,6 @@ virStoragePRDefIsEqual(virStoragePRDefPtr a, ...@@ -2018,13 +2018,6 @@ virStoragePRDefIsEqual(virStoragePRDefPtr a,
} }
bool
virStoragePRDefIsEnabled(virStoragePRDefPtr prd)
{
return !!prd;
}
bool bool
virStoragePRDefIsManaged(virStoragePRDefPtr prd) virStoragePRDefIsManaged(virStoragePRDefPtr prd)
{ {
......
...@@ -396,7 +396,6 @@ void virStoragePRDefFormat(virBufferPtr buf, ...@@ -396,7 +396,6 @@ void virStoragePRDefFormat(virBufferPtr buf,
virStoragePRDefPtr prd); virStoragePRDefPtr prd);
bool virStoragePRDefIsEqual(virStoragePRDefPtr a, bool virStoragePRDefIsEqual(virStoragePRDefPtr a,
virStoragePRDefPtr b); virStoragePRDefPtr b);
bool virStoragePRDefIsEnabled(virStoragePRDefPtr prd);
bool virStoragePRDefIsManaged(virStoragePRDefPtr prd); bool virStoragePRDefIsManaged(virStoragePRDefPtr prd);
virSecurityDeviceLabelDefPtr virSecurityDeviceLabelDefPtr
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册