return str ? _(str) : _("unknown");
}
-struct vshEventCallback {
- const char *name;
- virConnectSecretEventGenericCallback cb;
-};
-typedef struct vshEventCallback vshEventCallback;
-
struct virshSecretEventData {
vshControl *ctl;
bool loop;
bool timestamp;
int count;
- vshEventCallback *cb;
+ virshSecretEventCallback *cb;
};
typedef struct virshSecretEventData virshSecretEventData;
vshEventDone(data->ctl);
}
-static vshEventCallback vshEventCallbacks[] = {
+virshSecretEventCallback virshSecretEventCallbacks[] = {
{ "lifecycle",
VIR_SECRET_EVENT_CALLBACK(vshEventLifecyclePrint), },
{ "value-changed", vshEventGenericPrint, },
};
+verify(VIR_SECRET_EVENT_ID_LAST == ARRAY_CARDINALITY(virshSecretEventCallbacks));
static const vshCmdInfo info_secret_event[] = {
{.name = "help",
size_t i;
for (i = 0; i < VIR_SECRET_EVENT_ID_LAST; i++)
- vshPrint(ctl, "%s\n", vshEventCallbacks[i].name);
+ vshPrint(ctl, "%s\n", virshSecretEventCallbacks[i].name);
return true;
}
return false;
}
for (event = 0; event < VIR_SECRET_EVENT_ID_LAST; event++)
- if (STREQ(eventName, vshEventCallbacks[event].name))
+ if (STREQ(eventName, virshSecretEventCallbacks[event].name))
break;
if (event == VIR_SECRET_EVENT_ID_LAST) {
vshError(ctl, _("unknown event type %s"), eventName);
data.loop = vshCommandOptBool(cmd, "loop");
data.timestamp = vshCommandOptBool(cmd, "timestamp");
data.count = 0;
- data.cb = &vshEventCallbacks[event];
+ data.cb = &virshSecretEventCallbacks[event];
if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0)
return false;
# include "virsh.h"
+struct virshSecretEventCallback {
+ const char *name;
+ virConnectSecretEventGenericCallback cb;
+};
+typedef struct virshSecretEventCallback virshSecretEventCallback;
+
+extern virshSecretEventCallback virshSecretEventCallbacks[];
+
extern const vshCmdDef secretCmds[];
#endif /* VIRSH_SECRET_H */