Re: [PATCH] virsh-network: Don't check for virshXXXTypeFromString() >= VIR_XXX_LAST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 10, 2022 at 02:12:55PM +0100, Michal Privoznik wrote:
> They way our VIR_ENUM_IMPL() and virXXXTypeFromString() work is
> that for any string that's not recognized a negative one is
> returned. And, since VIR_XXX_LAST is passed to VIR_ENUM_IMPL() we
> can be sure that all enum members are covered. Therefore, there
> is no way that virXXXTypeFromString() can return a value that's
> bigger or equal to VIR_XXX_LAST.
>
> I've noticed two places where such comparison was made, both in
> cmdNetworkUpdate(). Drop them.
>
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  tools/virsh-network.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux