qemuBlockStorageSourceGetBackendProps: Remove unnecessary indent for non-nbdkit code path

Formatting of the 'nbdkit' driven backend breaks out of the switch
statement so we don't need to have an unnecessary block and indentation
level for the case when nbdkit is not in use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-10-18 09:38:56 +02:00
parent d38f32cb4e
commit 01e35b452b

View File

@ -1028,75 +1028,75 @@ qemuBlockStorageSourceGetBackendProps(virStorageSource *src,
return NULL; return NULL;
case VIR_STORAGE_TYPE_NETWORK: case VIR_STORAGE_TYPE_NETWORK:
/* prefer using nbdkit for sources that are supported */ /* prefer using nbdkit if configured for sources that are supported */
if ((fileprops = qemuBlockStorageSourceGetNbdkitProps(src))) { if ((fileprops = qemuBlockStorageSourceGetNbdkitProps(src))) {
driver = "nbd"; driver = "nbd";
break; break;
} else { }
switch ((virStorageNetProtocol) src->protocol) {
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
driver = "gluster";
if (!(fileprops = qemuBlockStorageSourceGetGlusterProps(src, onlytarget)))
return NULL;
break;
case VIR_STORAGE_NET_PROTOCOL_VXHS: switch ((virStorageNetProtocol) src->protocol) {
driver = "vxhs"; case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
if (!(fileprops = qemuBlockStorageSourceGetVxHSProps(src, onlytarget))) driver = "gluster";
return NULL; if (!(fileprops = qemuBlockStorageSourceGetGlusterProps(src, onlytarget)))
break; return NULL;
break;
case VIR_STORAGE_NET_PROTOCOL_HTTP: case VIR_STORAGE_NET_PROTOCOL_VXHS:
case VIR_STORAGE_NET_PROTOCOL_HTTPS: driver = "vxhs";
case VIR_STORAGE_NET_PROTOCOL_FTP: if (!(fileprops = qemuBlockStorageSourceGetVxHSProps(src, onlytarget)))
case VIR_STORAGE_NET_PROTOCOL_FTPS: return NULL;
case VIR_STORAGE_NET_PROTOCOL_TFTP: break;
driver = virStorageNetProtocolTypeToString(src->protocol);
if (!(fileprops = qemuBlockStorageSourceGetCURLProps(src, onlytarget)))
return NULL;
break;
case VIR_STORAGE_NET_PROTOCOL_ISCSI: case VIR_STORAGE_NET_PROTOCOL_HTTP:
driver = "iscsi"; case VIR_STORAGE_NET_PROTOCOL_HTTPS:
if (!(fileprops = qemuBlockStorageSourceGetISCSIProps(src, onlytarget))) case VIR_STORAGE_NET_PROTOCOL_FTP:
return NULL; case VIR_STORAGE_NET_PROTOCOL_FTPS:
break; case VIR_STORAGE_NET_PROTOCOL_TFTP:
driver = virStorageNetProtocolTypeToString(src->protocol);
if (!(fileprops = qemuBlockStorageSourceGetCURLProps(src, onlytarget)))
return NULL;
break;
case VIR_STORAGE_NET_PROTOCOL_NBD: case VIR_STORAGE_NET_PROTOCOL_ISCSI:
driver = "nbd"; driver = "iscsi";
if (!(fileprops = qemuBlockStorageSourceGetNBDProps(src, onlytarget))) if (!(fileprops = qemuBlockStorageSourceGetISCSIProps(src, onlytarget)))
return NULL; return NULL;
break; break;
case VIR_STORAGE_NET_PROTOCOL_RBD: case VIR_STORAGE_NET_PROTOCOL_NBD:
driver = "rbd"; driver = "nbd";
if (!(fileprops = qemuBlockStorageSourceGetRBDProps(src, onlytarget))) if (!(fileprops = qemuBlockStorageSourceGetNBDProps(src, onlytarget)))
return NULL; return NULL;
break; break;
case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG: case VIR_STORAGE_NET_PROTOCOL_RBD:
driver = "sheepdog"; driver = "rbd";
if (!(fileprops = qemuBlockStorageSourceGetSheepdogProps(src))) if (!(fileprops = qemuBlockStorageSourceGetRBDProps(src, onlytarget)))
return NULL; return NULL;
break; break;
case VIR_STORAGE_NET_PROTOCOL_SSH: case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
driver = "ssh"; driver = "sheepdog";
if (!(fileprops = qemuBlockStorageSourceGetSshProps(src))) if (!(fileprops = qemuBlockStorageSourceGetSheepdogProps(src)))
return NULL; return NULL;
break; break;
case VIR_STORAGE_NET_PROTOCOL_NFS: case VIR_STORAGE_NET_PROTOCOL_SSH:
driver = "nfs"; driver = "ssh";
if (!(fileprops = qemuBlockStorageSourceGetNFSProps(src))) if (!(fileprops = qemuBlockStorageSourceGetSshProps(src)))
return NULL; return NULL;
break; break;
case VIR_STORAGE_NET_PROTOCOL_NONE: case VIR_STORAGE_NET_PROTOCOL_NFS:
case VIR_STORAGE_NET_PROTOCOL_LAST: driver = "nfs";
virReportEnumRangeError(virStorageNetProtocol, src->protocol); if (!(fileprops = qemuBlockStorageSourceGetNFSProps(src)))
return NULL; return NULL;
} break;
case VIR_STORAGE_NET_PROTOCOL_NONE:
case VIR_STORAGE_NET_PROTOCOL_LAST:
virReportEnumRangeError(virStorageNetProtocol, src->protocol);
return NULL;
} }
break; break;
} }