]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainStorageSourceHasAuth: Don't decide based on protocol
authorPeter Krempa <pkrempa@redhat.com>
Wed, 20 Apr 2022 07:31:47 +0000 (09:31 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 25 Apr 2022 14:34:59 +0000 (16:34 +0200)
The validation should be the only point to decide whether authentication
is supported for a disk backing protocol. The rest of the code can then
simply always enable it.

This also fixes a crash when authentication is requested e.g. for a HTTP
backed disk as the blockdev props formatter expects that it was already
set up.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c

index b5abf99951572f9984b7ce3d7e4f6c0b99ff9e66..0486826fc74f905fa9ce4dd600ff0b2831060343 100644 (file)
@@ -1236,9 +1236,7 @@ qemuDomainStorageSourceHasAuth(virStorageSource *src)
 {
     if (!virStorageSourceIsEmpty(src) &&
         virStorageSourceGetActualType(src) == VIR_STORAGE_TYPE_NETWORK &&
-        src->auth &&
-        (src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI ||
-         src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD))
+        src->auth)
         return true;
 
     return false;