]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Introduce virshEnumComplete()
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 12 Mar 2022 04:37:50 +0000 (05:37 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 15 Mar 2022 12:36:56 +0000 (13:36 +0100)
commitd2e8718f3a7335c45163a9989c4ce2fda89fab3f
tree3910b099dec56d97fea626da18a58eea9bd132c4
parentc21e271d36e71b8c2feef99dfea30562f2c1fbee
virsh: Introduce virshEnumComplete()

We have plenty of completers which iterate over all values of
given enum and do nothing more than translate every member into
string (using corresponding virXXXTypeToString()).

Introduce a convenience function so that callers can pass just
VIR_XXX_LAST and virXXXTypeToString and the rest is taken care
of.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
tools/virsh-completer.c
tools/virsh-completer.h