mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
64e3ae0d51
commit
1efda36765
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue