#include "virsh-nodedev.h"
#include "virsh-util.h"
#include "virsh-secret.h"
+#include "virsh-network.h"
#include "internal.h"
#include "virutil.h"
#include "viralloc.h"
}
+char **
+virshNetworkEventNameCompleter(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_NETWORK_EVENT_ID_LAST + 1) < 0)
+ goto error;
+
+ for (i = 0; i < VIR_NETWORK_EVENT_ID_LAST; i++) {
+ if (VIR_STRDUP(ret[i], virshNetworkEventCallbacks[i].name) < 0)
+ goto error;
+ }
+
+ return ret;
+
+ error:
+ virStringListFree(ret);
+ return NULL;
+}
+
+
char **
virshNodeDeviceNameCompleter(vshControl *ctl,
const vshCmd *cmd ATTRIBUTE_UNUSED,
const vshCmd *cmd,
unsigned int flags);
+char ** virshNetworkEventNameCompleter(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int flags);
+
char ** virshNodeDeviceNameCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
VIRSH_COMMON_OPT_NETWORK_OT_STRING(N_("filter by network name or uuid"), 0),
{.name = "event",
.type = VSH_OT_STRING,
+ .completer = virshNetworkEventNameCompleter,
.help = N_("which event type to wait for")
},
{.name = "loop",