mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuDomainValidateStorageSource: Extract check for BLOCKDEV capability
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
9fdf6aeb7a
commit
6cd8234f08
@ -5140,6 +5140,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
|||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
int actualType = virStorageSourceGetActualType(src);
|
int actualType = virStorageSourceGetActualType(src);
|
||||||
|
bool blockdev = virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV);
|
||||||
|
|
||||||
if (src->format == VIR_STORAGE_FILE_COW) {
|
if (src->format == VIR_STORAGE_FILE_COW) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
@ -5224,8 +5225,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
|||||||
/* In pre-blockdev era we can't configure the slice so we can allow them
|
/* In pre-blockdev era we can't configure the slice so we can allow them
|
||||||
* only for detected backing store entries as they are populated
|
* only for detected backing store entries as they are populated
|
||||||
* from a place that qemu would be able to read */
|
* from a place that qemu would be able to read */
|
||||||
if (!src->detected &&
|
if (!src->detected && !blockdev) {
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("storage slice is not supported by this QEMU binary"));
|
_("storage slice is not supported by this QEMU binary"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -5241,8 +5241,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src->detected &&
|
if (!src->detected && !blockdev) {
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("ssl verification setting is not supported by this QEMU binary"));
|
_("ssl verification setting is not supported by this QEMU binary"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -5258,8 +5257,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src->detected &&
|
if (!src->detected && !blockdev) {
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("http cookies are not supported by this QEMU binary"));
|
_("http cookies are not supported by this QEMU binary"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -5280,8 +5278,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src->detected &&
|
if (!src->detected && !blockdev) {
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("readahead setting is not supported with this QEMU binary"));
|
_("readahead setting is not supported with this QEMU binary"));
|
||||||
return -1;
|
return -1;
|
||||||
@ -5299,8 +5296,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src->detected &&
|
if (!src->detected && !blockdev) {
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("timeout setting is not supported with this QEMU binary"));
|
_("timeout setting is not supported with this QEMU binary"));
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user