mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00: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)
|
||||
{
|
||||
int actualType = virStorageSourceGetActualType(src);
|
||||
bool blockdev = virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV);
|
||||
|
||||
if (src->format == VIR_STORAGE_FILE_COW) {
|
||||
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
|
||||
* only for detected backing store entries as they are populated
|
||||
* from a place that qemu would be able to read */
|
||||
if (!src->detected &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||
if (!src->detected && !blockdev) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("storage slice is not supported by this QEMU binary"));
|
||||
return -1;
|
||||
@ -5241,8 +5241,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!src->detected &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||
if (!src->detected && !blockdev) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("ssl verification setting is not supported by this QEMU binary"));
|
||||
return -1;
|
||||
@ -5258,8 +5257,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!src->detected &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||
if (!src->detected && !blockdev) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("http cookies are not supported by this QEMU binary"));
|
||||
return -1;
|
||||
@ -5280,8 +5278,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!src->detected &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||
if (!src->detected && !blockdev) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("readahead setting is not supported with this QEMU binary"));
|
||||
return -1;
|
||||
@ -5299,8 +5296,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!src->detected &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
|
||||
if (!src->detected && !blockdev) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("timeout setting is not supported with this QEMU binary"));
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user