[PATCH] xenapi_utils: Adapt to enum cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It was just very recently that we transfered from:

  enum virSomeEnumName{
      ...
  };

to:
  typedef enum {
      ...
  } virSomeEnumName;

This change requires some code adaptation, which wasn't done for
xenapi driver. With this fix we are able to build again.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---

Pushed under build breaker rule.

 src/xenapi/xenapi_utils.c | 14 +++++++-------
 src/xenapi/xenapi_utils.h | 10 +++++-----
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index c9a62d9..156e0c8 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -127,7 +127,7 @@ xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri, int *noVerify)
 
 
 enum xen_on_normal_exit
-actionShutdownLibvirt2XenapiEnum(enum virDomainLifecycleAction action)
+actionShutdownLibvirt2XenapiEnum(virDomainLifecycleAction action)
 {
     enum xen_on_normal_exit num = XEN_ON_NORMAL_EXIT_RESTART;
     if (action == VIR_DOMAIN_LIFECYCLE_DESTROY)
@@ -139,7 +139,7 @@ actionShutdownLibvirt2XenapiEnum(enum virDomainLifecycleAction action)
 
 
 enum xen_on_crash_behaviour
-actionCrashLibvirt2XenapiEnum(enum virDomainLifecycleCrashAction action)
+actionCrashLibvirt2XenapiEnum(virDomainLifecycleCrashAction action)
 {
     enum xen_on_crash_behaviour num = XEN_ON_CRASH_BEHAVIOUR_RESTART;
     if (action == VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY)
@@ -180,7 +180,7 @@ createXenAPIBootOrderString(int nboot, int *bootDevs)
 }
 
 /* convert boot order string to libvirt boot order enum */
-enum virDomainBootOrder
+virDomainBootOrder
 map2LibvirtBootOrder(char c)
 {
     switch (c) {
@@ -197,10 +197,10 @@ map2LibvirtBootOrder(char c)
     }
 }
 
-enum virDomainLifecycleAction
+virDomainLifecycleAction
 xenapiNormalExitEnum2virDomainLifecycle(enum xen_on_normal_exit action)
 {
-    enum virDomainLifecycleAction num = VIR_DOMAIN_LIFECYCLE_RESTART;
+    virDomainLifecycleAction num = VIR_DOMAIN_LIFECYCLE_RESTART;
     if (action == XEN_ON_NORMAL_EXIT_DESTROY)
         num = VIR_DOMAIN_LIFECYCLE_DESTROY;
     else if (action == XEN_ON_NORMAL_EXIT_RESTART)
@@ -209,10 +209,10 @@ xenapiNormalExitEnum2virDomainLifecycle(enum xen_on_normal_exit action)
 }
 
 
-enum virDomainLifecycleCrashAction
+virDomainLifecycleCrashAction
 xenapiCrashExitEnum2virDomainLifecycle(enum xen_on_crash_behaviour action)
 {
-    enum virDomainLifecycleCrashAction num = VIR_DOMAIN_LIFECYCLE_CRASH_RESTART;
+    virDomainLifecycleCrashAction num = VIR_DOMAIN_LIFECYCLE_CRASH_RESTART;
     if (action == XEN_ON_CRASH_BEHAVIOUR_DESTROY)
         num = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
     else if (action == XEN_ON_CRASH_BEHAVIOUR_RESTART)
diff --git a/src/xenapi/xenapi_utils.h b/src/xenapi/xenapi_utils.h
index 31b313b..26e1ac2 100644
--- a/src/xenapi/xenapi_utils.h
+++ b/src/xenapi/xenapi_utils.h
@@ -43,20 +43,20 @@ int
 xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri, int *noVerify);
 
 enum xen_on_normal_exit
-actionShutdownLibvirt2XenapiEnum(enum virDomainLifecycleAction action);
+actionShutdownLibvirt2XenapiEnum(virDomainLifecycleAction action);
 
 enum xen_on_crash_behaviour
-actionCrashLibvirt2XenapiEnum(enum virDomainLifecycleCrashAction action);
+actionCrashLibvirt2XenapiEnum(virDomainLifecycleCrashAction action);
 
 char *
 createXenAPIBootOrderString(int nboot, int *bootDevs);
 
-enum virDomainBootOrder map2LibvirtBootOrder(char c);
+virDomainBootOrder map2LibvirtBootOrder(char c);
 
-enum virDomainLifecycleAction
+virDomainLifecycleAction
 xenapiNormalExitEnum2virDomainLifecycle(enum xen_on_normal_exit action);
 
-enum virDomainLifecycleCrashAction
+virDomainLifecycleCrashAction
 xenapiCrashExitEnum2virDomainLifecycle(enum xen_on_crash_behaviour action);
 
 void getCpuBitMapfromString(char *mask, unsigned char *cpumap, int maplen);
-- 
2.0.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]