提交 1efda367 编写于 作者: P Peter Krempa

qemu: Move validation of PR manager support

Disk source definition should be validated in
qemuDomainValidateStorageSource rather than in individual generators of
command line arguments.

Change to the XML2XML test is required since now the definition is
actually validated at define time.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 64e3ae0d
......@@ -9733,7 +9733,6 @@ qemuBuildPRManagerInfoProps(virDomainObjPtr vm,
virJSONValuePtr *propsret,
char **aliasret)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
char *socketPath = NULL;
char *alias = NULL;
int ret = -1;
......@@ -9744,12 +9743,6 @@ qemuBuildPRManagerInfoProps(virDomainObjPtr vm,
if (!virStoragePRDefIsEnabled(disk->src->pr))
return 0;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("reservations not supported with this QEMU binary"));
return ret;
}
if (!(socketPath = qemuDomainGetPRSocketPath(vm, disk->src->pr)))
return ret;
......
......@@ -4204,6 +4204,13 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
}
}
if (virStoragePRDefIsEnabled(src->pr) &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("reservations not supported with this QEMU binary"));
return -1;
}
return 0;
}
......
......@@ -388,7 +388,7 @@ mymain(void)
DO_TEST("disk-virtio-scsi-num_queues",
QEMU_CAPS_VIRTIO_SCSI);
DO_TEST("disk-virtio-scsi-reservations",
QEMU_CAPS_VIRTIO_SCSI);
QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_PR_MANAGER_HELPER);
DO_TEST("disk-virtio-scsi-cmd_per_lun",
QEMU_CAPS_VIRTIO_SCSI);
DO_TEST("disk-virtio-scsi-max_sectors",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册