diff --git a/tools/virsh.c b/tools/virsh.c index ad0a2c3f97..f2fd9e550d 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -57,7 +58,6 @@ #include "configmake.h" #include "threads.h" #include "command.h" -#include "count-one-bits.h" #include "virkeycode.h" static char *progname; @@ -12852,7 +12852,7 @@ vshCmddefGetData(const vshCmdDef *cmd, uint32_t *opts_need_arg, return NULL; /* Grab least-significant set bit */ - i = count_one_bits(*opts_need_arg ^ (*opts_need_arg - 1)) - 1; + i = ffs(*opts_need_arg) - 1; opt = &cmd->opts[i]; if (opt->type != VSH_OT_ARGV) *opts_need_arg &= ~(1 << i);