[PATCH RESEND v3 4/8] meson: move iscsiadm check into storage_iscsi condition
Andrea Bolognani
abologna at redhat.com
Tue May 25 09:53:25 UTC 2021
On Tue, May 25, 2021 at 02:36:04AM -0700, Andrea Bolognani wrote:
> 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.
I just realized that you rewrite this check again in 6/8, so no
matter what it looks like in this commit
Reviewed-by: Andrea Bolognani <abologna at redhat.com>
--
Andrea Bolognani / Red Hat / Virtualization
More information about the libvir-list
mailing list