Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
virStringListFree(ret);
return NULL;
}
+
+
+char **
+virshPoolEventNameCompleter(vshControl *ctl ATTRIBUTE_UNUSED,
+ const vshCmd *cmd ATTRIBUTE_UNUSED,
+ unsigned int flags)
+{
+ size_t i = 0;
+ char **ret = NULL;
+
+ virCheckFlags(0, NULL);
+
+ if (VIR_ALLOC_N(ret, VIR_STORAGE_POOL_EVENT_ID_LAST) < 0)
+ goto error;
+
+ for (i = 0; i < VIR_STORAGE_POOL_EVENT_ID_LAST; i++) {
+ if (VIR_STRDUP(ret[i], virshPoolEventCallbacks[i].name) < 0)
+ goto error;
+ }
+
+ return ret;
+
+ error:
+ virStringListFree(ret);
+ return NULL;
+}
const vshCmd *cmd,
unsigned int flags);
+char ** virshPoolEventNameCompleter(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int flags);
+
#endif
},
{.name = "event",
.type = VSH_OT_STRING,
+ .completer = virshPoolEventNameCompleter,
.help = N_("which event type to wait for")
},
{.name = "loop",