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: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2018-05-11 14:53:54 +02:00
parent 64e3ae0d51
commit 1efda36765
3 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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",