[PATCH RESEND v3 4/8] meson: move iscsiadm check into storage_iscsi condition

Andrea Bolognani abologna at redhat.com
Tue May 25 09:36:04 UTC 2021


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




More information about the libvir-list mailing list