[libvirt] [ [PATCH v3 3/8] virsh: Move vshEventCallback structure definition to virsh-domain.h

Lin Ma lma at suse.com
Wed May 23 06:19:20 UTC 2018


The next patch will use it in virsh-completer.c for returning the strings
of domain event name.

Signed-off-by: Lin Ma <lma at suse.com>
---
 tools/virsh-domain.c | 8 +-------
 tools/virsh-domain.h | 8 ++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index cfbbf5a7bc..347c744bc9 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -12832,12 +12832,6 @@ virshDomainEventTrayChangeToString(int reason)
     return str ? _(str) : _("unknown");
 }
 
-struct vshEventCallback {
-    const char *name;
-    virConnectDomainEventGenericCallback cb;
-};
-typedef struct vshEventCallback vshEventCallback;
-
 struct virshDomEventData {
     vshControl *ctl;
     bool loop;
@@ -13278,7 +13272,7 @@ virshEventBlockThresholdPrint(virConnectPtr conn ATTRIBUTE_UNUSED,
 }
 
 
-static vshEventCallback vshEventCallbacks[] = {
+vshEventCallback vshEventCallbacks[] = {
     { "lifecycle",
       VIR_DOMAIN_EVENT_CALLBACK(virshEventLifecyclePrint), },
     { "reboot", virshEventGenericPrint, },
diff --git a/tools/virsh-domain.h b/tools/virsh-domain.h
index 3f9d12a5ff..e8e5611244 100644
--- a/tools/virsh-domain.h
+++ b/tools/virsh-domain.h
@@ -28,6 +28,14 @@
 
 # include "virsh.h"
 
+struct vshEventCallback {
+    const char *name;
+    virConnectDomainEventGenericCallback cb;
+};
+typedef struct vshEventCallback vshEventCallback;
+
+extern vshEventCallback vshEventCallbacks[];
+
 extern const vshCmdDef domManagementCmds[];
 
 #endif /* VIRSH_DOMAIN_H */
-- 
2.16.2




More information about the libvir-list mailing list