On Tue, May 25, 2021 at 10:00:43AM +0200, Pavel Hrdina wrote:
+ if not get_option('storage_iscsi').disabled()
+ iscsi_enable = true
+ iscsiadm_prog = find_program('iscsiadm', required: false, dirs:
libvirt_sbin_path)
+
+ if not iscsiadm_prog.found()
+ if get_option('storage_iscsi').enabled()
+ error('We need iscsiadm for iSCSI storage driver')
+ else
+ iscsi_enable = false
+ endif
+ endif
I believe this could be rewritten as
if not get_option('storage_iscsi').disabled()
iscsi_enable = true
iscsiadm_prog = find_program('iscsiadm', required:
get_option('storage_iscsi'), dirs: libvirt_sbin_path)
if not iscsiadm_prog.found()
iscsi_enable = false
endif
I see this pattern used elsewhere in the file and it's more concise
while achieving the same result AFAICT.
--
Andrea Bolognani / Red Hat / Virtualization