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

[libvirt] [PATCH] Fix initialization mismatch



# HG changeset patch
# User john levon sun com
# Date 1229369743 28800
# Node ID 16ceb6f2e00c4639e97440723e57ec0be6d12cd9
# Parent  ead0d1c1d3adacf478db05ee8d6abe270c96c5da
Fix initialization mismatch

Make driver open routines correctly declare their return type.

Signed-off-by: John Levon <john levon sun com>

diff --git a/src/proxy_internal.c b/src/proxy_internal.c
--- a/src/proxy_internal.c
+++ b/src/proxy_internal.c
@@ -36,7 +36,7 @@ static int debug = 0;
 static int debug = 0;
 
 static int xenProxyClose(virConnectPtr conn);
-static int xenProxyOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
+static virDrvOpenStatus xenProxyOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
 static int xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer);
 static int xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
 static char *xenProxyGetCapabilities(virConnectPtr conn);
@@ -477,7 +477,7 @@ retry:
  *
  * Returns 0 in case of success, and -1 in case of failure
  */
-int
+virDrvOpenStatus
 xenProxyOpen(virConnectPtr conn,
              virConnectAuthPtr auth ATTRIBUTE_UNUSED,
              int flags)
diff --git a/src/remote_internal.c b/src/remote_internal.c
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -851,7 +851,7 @@ doRemoteOpen (virConnectPtr conn,
     goto cleanup;
 }
 
-static int
+static virDrvOpenStatus
 remoteOpen (virConnectPtr conn,
             virConnectAuthPtr auth,
             int flags)
@@ -2633,7 +2633,7 @@ remoteDomainMemoryPeek (virDomainPtr dom
 
 /*----------------------------------------------------------------------*/
 
-static int
+static virDrvOpenStatus
 remoteNetworkOpen (virConnectPtr conn,
                    virConnectAuthPtr auth,
                    int flags)
@@ -3033,7 +3033,7 @@ remoteNetworkSetAutostart (virNetworkPtr
 
 /*----------------------------------------------------------------------*/
 
-static int
+static virDrvOpenStatus
 remoteStorageOpen (virConnectPtr conn,
                    virConnectAuthPtr auth,
                    int flags)
diff --git a/src/test.c b/src/test.c
--- a/src/test.c
+++ b/src/test.c
@@ -634,7 +634,7 @@ static int testOpenFromFile(virConnectPt
 }
 
 
-static int testOpen(virConnectPtr conn,
+static virDrvOpenStatus testOpen(virConnectPtr conn,
                     virConnectAuthPtr auth ATTRIBUTE_UNUSED,
                     int flags ATTRIBUTE_UNUSED)
 {
diff --git a/src/xen_inotify.c b/src/xen_inotify.c
--- a/src/xen_inotify.c
+++ b/src/xen_inotify.c
@@ -347,7 +347,7 @@ reread:
  *
  * Returns 0 or -1 in case of error.
  */
-int
+virDrvOpenStatus
 xenInotifyOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
              virConnectAuthPtr auth ATTRIBUTE_UNUSED,
              int flags ATTRIBUTE_UNUSED)
diff --git a/src/xen_inotify.h b/src/xen_inotify.h
--- a/src/xen_inotify.h
+++ b/src/xen_inotify.h
@@ -21,10 +21,13 @@
  */
 #ifndef __VIR_XEN_INOTIFY_H__
 #define __VIR_XEN_INOTIFY_H__
+
 #include "internal.h"
+#include "driver.h"
+
 extern struct xenUnifiedDriver xenInotifyDriver;
 
-int		xenInotifyOpen		(virConnectPtr conn,
+virDrvOpenStatus	xenInotifyOpen	(virConnectPtr conn,
                                          virConnectAuthPtr auth,
                                          int flags);
 int		xenInotifyClose		(virConnectPtr conn);
diff --git a/src/xen_internal.c b/src/xen_internal.c
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -2031,7 +2031,7 @@ xenHypervisorInit(void)
  *
  * Returns 0 or -1 in case of error.
  */
-int
+virDrvOpenStatus
 xenHypervisorOpen(virConnectPtr conn,
                   virConnectAuthPtr auth ATTRIBUTE_UNUSED,
                   int flags ATTRIBUTE_UNUSED)
diff --git a/src/xen_internal.h b/src/xen_internal.h
--- a/src/xen_internal.h
+++ b/src/xen_internal.h
@@ -15,6 +15,7 @@
 
 #include "internal.h"
 #include "capabilities.h"
+#include "driver.h"
 
 extern struct xenUnifiedDriver xenHypervisorDriver;
 int	xenHypervisorInit		(void);
@@ -32,7 +33,8 @@ char *
 char *
         xenHypervisorDomainGetOSType (virDomainPtr dom);
 
-int	xenHypervisorOpen		(virConnectPtr conn,
+virDrvOpenStatus
+	xenHypervisorOpen		(virConnectPtr conn,
                                          virConnectAuthPtr auth,
                                          int flags);
 int	xenHypervisorClose		(virConnectPtr conn);
diff --git a/src/xen_unified.c b/src/xen_unified.c
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -224,7 +224,7 @@ xenUnifiedProbe (void)
     return 0;
 }
 
-static int
+static virDrvOpenStatus
 xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
 {
     int i, ret = VIR_DRV_OPEN_DECLINED;
diff --git a/src/xend_internal.c b/src/xend_internal.c
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -2704,7 +2704,7 @@ error:
  *
  * Returns 0 in case of success, -1 in case of error.
  */
-int
+virDrvOpenStatus
 xenDaemonOpen(virConnectPtr conn,
               virConnectAuthPtr auth ATTRIBUTE_UNUSED,
               int flags ATTRIBUTE_UNUSED)
diff --git a/src/xend_internal.h b/src/xend_internal.h
--- a/src/xend_internal.h
+++ b/src/xend_internal.h
@@ -24,6 +24,7 @@
 #include "internal.h"
 #include "capabilities.h"
 #include "domain_conf.h"
+#include "driver.h"
 #include "buf.h"
 
 int
@@ -129,7 +130,7 @@ xenDaemonFormatSxpr(virConnectPtr conn,
 
 
 /* refactored ones */
-int xenDaemonOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
+virDrvOpenStatus xenDaemonOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
 int xenDaemonClose(virConnectPtr conn);
 int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
 int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
diff --git a/src/xm_internal.c b/src/xm_internal.c
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -581,7 +581,7 @@ int xenXMConfigCacheRefresh (virConnectP
  * We only support a single directory, so repeated calls
  * to open all end up using the same cache of files
  */
-int
+virDrvOpenStatus
 xenXMOpen (virConnectPtr conn ATTRIBUTE_UNUSED,
            virConnectAuthPtr auth ATTRIBUTE_UNUSED,
            int flags ATTRIBUTE_UNUSED)
diff --git a/src/xm_internal.h b/src/xm_internal.h
--- a/src/xm_internal.h
+++ b/src/xm_internal.h
@@ -26,6 +26,7 @@
 #define _LIBVIRT_XM_INTERNAL_H_
 
 #include "internal.h"
+#include "driver.h"
 #include "conf.h"
 #include "domain_conf.h"
 
@@ -38,7 +39,7 @@ int xenXMConfigCacheAddFile(virConnectPt
 int xenXMConfigCacheAddFile(virConnectPtr conn, const char *filename);
 int xenXMConfigCacheRemoveFile(virConnectPtr conn, const char *filename);
 
-int xenXMOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
+virDrvOpenStatus xenXMOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
 int xenXMClose(virConnectPtr conn);
 const char *xenXMGetType(virConnectPtr conn);
 int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
diff --git a/src/xs_internal.c b/src/xs_internal.c
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -281,7 +281,7 @@ virDomainGetVMInfo(virDomainPtr domain, 
  *
  * Returns 0 or -1 in case of error.
  */
-int
+virDrvOpenStatus
 xenStoreOpen(virConnectPtr conn,
              virConnectAuthPtr auth ATTRIBUTE_UNUSED,
              int flags ATTRIBUTE_UNUSED)
diff --git a/src/xs_internal.h b/src/xs_internal.h
--- a/src/xs_internal.h
+++ b/src/xs_internal.h
@@ -12,11 +12,12 @@
 #define __VIR_XS_INTERNAL_H__
 
 #include "internal.h"
+#include "driver.h"
 
 extern struct xenUnifiedDriver xenStoreDriver;
 int xenStoreInit (void);
 
-int		xenStoreOpen		(virConnectPtr conn,
+virDrvOpenStatus	xenStoreOpen	(virConnectPtr conn,
                                          virConnectAuthPtr auth,
                                          int flags);
 int		xenStoreClose		(virConnectPtr conn);


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