monitor: Add set_link arguments completion.

Make it possible to query all net clients without specifying an ID when calling
qemu_find_net_clients_except().

This also adds the add_completion_option() function which is to be used for
other commands completions as well.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Hani Benhabiles 2014-05-07 23:41:30 +01:00 committed by Luiz Capitulino
parent 13e315dada
commit 40d19394b7
4 changed files with 37 additions and 1 deletions

View file

@ -633,7 +633,7 @@ int qemu_find_net_clients_except(const char *id, NetClientState **ncs,
if (nc->info->type == type) {
continue;
}
if (!strcmp(nc->name, id)) {
if (!id || !strcmp(nc->name, id)) {
if (ret < max) {
ncs[ret] = nc;
}