diff --git a/ChangeLog b/ChangeLog index ad5f279de3..ba1cc573d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Dec 3 10:32:10 CET 2007 Daniel Veillard + + * src/xen_unified.[ch] src/proxy_internal.c src/xen_internal.c + src/xend_internal.c src/xm_internal.c src/xs_internal.c: + cleanup the xen subdriver table, remove the type entry and + always return "Xen" from the unified entry point. + Sat Dec 1 10:42:34 EST 2007 Daniel P. Berrange * src/hash.c: reset error object when releasing connection diff --git a/src/proxy_internal.c b/src/proxy_internal.c index 04400459ac..95ff673767 100644 --- a/src/proxy_internal.c +++ b/src/proxy_internal.c @@ -42,7 +42,6 @@ static char *xenProxyDomainGetOSType(virDomainPtr domain); struct xenUnifiedDriver xenProxyDriver = { xenProxyOpen, /* open */ xenProxyClose, /* close */ - NULL, /* type */ xenProxyGetVersion, /* version */ NULL, /* hostname */ NULL, /* URI */ diff --git a/src/xen_internal.c b/src/xen_internal.c index 72cf1e32b1..e2cb9c2f34 100644 --- a/src/xen_internal.c +++ b/src/xen_internal.c @@ -671,7 +671,6 @@ typedef struct xen_op_v2_dom xen_op_v2_dom; #endif #ifndef PROXY -static const char * xenHypervisorGetType(virConnectPtr conn); static unsigned long xenHypervisorGetMaxMemory(virDomainPtr domain); #endif @@ -679,7 +678,6 @@ static unsigned long xenHypervisorGetMaxMemory(virDomainPtr domain); struct xenUnifiedDriver xenHypervisorDriver = { xenHypervisorOpen, /* open */ xenHypervisorClose, /* close */ - xenHypervisorGetType, /* type */ xenHypervisorGetVersion, /* version */ NULL, /* hostname */ NULL, /* URI */ @@ -2112,28 +2110,6 @@ xenHypervisorClose(virConnectPtr conn) } -#ifndef PROXY -/** - * xenHypervisorGetType: - * @conn: pointer to the Xen Hypervisor block - * - * Get the version level of the Hypervisor running. - * - * Returns -1 in case of error, 0 otherwise. if the version can't be - * extracted by lack of capacities returns 0 and @hvVer is 0, otherwise - * @hvVer value is major * 1,000,000 + minor * 1,000 + release - */ -static const char * -xenHypervisorGetType(virConnectPtr conn) -{ - if (!VIR_IS_CONNECT(conn)) { - virXenError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__, 0); - return (NULL); - } - return("Xen"); -} -#endif - /** * xenHypervisorGetVersion: * @conn: pointer to the connection block diff --git a/src/xen_unified.c b/src/xen_unified.c index 88dff9d8c2..336b7ec8a3 100644 --- a/src/xen_unified.c +++ b/src/xen_unified.c @@ -321,13 +321,10 @@ xenUnifiedType (virConnectPtr conn) { GET_PRIVATE(conn); int i; - const char *ret; for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) - if (priv->opened[i] && drivers[i]->type) { - ret = drivers[i]->type (conn); - if (ret) return ret; - } + if (priv->opened[i]) + return "Xen"; return NULL; } diff --git a/src/xen_unified.h b/src/xen_unified.h index 9ee0c38ea0..5d5e073449 100644 --- a/src/xen_unified.h +++ b/src/xen_unified.h @@ -39,7 +39,6 @@ extern int xenUnifiedRegister (void); struct xenUnifiedDriver { virDrvOpen open; virDrvClose close; - virDrvGetType type; virDrvGetVersion version; virDrvGetHostname getHostname; virDrvGetURI getURI; diff --git a/src/xend_internal.c b/src/xend_internal.c index 4cddb09b3d..295f8d09e2 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -49,7 +49,6 @@ #include #ifndef PROXY -static const char * xenDaemonGetType(virConnectPtr conn); static int xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids); static int xenDaemonNumOfDomains(virConnectPtr conn); static int xenDaemonListDefinedDomains(virConnectPtr conn, char **const names, int maxnames); @@ -68,7 +67,6 @@ static int xenDaemonDomainCoreDump(virDomainPtr domain, const char *filename, struct xenUnifiedDriver xenDaemonDriver = { xenDaemonOpen, /* open */ xenDaemonClose, /* close */ - xenDaemonGetType, /* type */ xenDaemonGetVersion, /* version */ NULL, /* hostname */ NULL, /* URI */ @@ -2705,28 +2703,6 @@ xenDaemonNodeGetTopology(virConnectPtr conn, virBufferPtr xml) { return (ret); } -#ifndef PROXY -/** - * xenDaemonGetType: - * @conn: pointer to the Xen Daemon block - * - * Get the version level of the Hypervisor running. - * - * Returns -1 in case of error, 0 otherwise. if the version can't be - * extracted by lack of capacities returns 0 and @hvVer is 0, otherwise - * @hvVer value is major * 1,000,000 + minor * 1,000 + release - */ -static const char * -xenDaemonGetType(virConnectPtr conn) -{ - if (!VIR_IS_CONNECT(conn)) { - virXendError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__); - return (NULL); - } - return("XenDaemon"); -} -#endif /* ! PROXY */ - /** * xenDaemonGetVersion: * @conn: pointer to the Xen Daemon block diff --git a/src/xm_internal.c b/src/xm_internal.c index ce886fc982..a9dab4f4eb 100644 --- a/src/xm_internal.c +++ b/src/xm_internal.c @@ -81,7 +81,6 @@ static time_t lastRefresh = 0; struct xenUnifiedDriver xenXMDriver = { xenXMOpen, /* open */ xenXMClose, /* close */ - xenXMGetType, /* type */ NULL, /* version */ NULL, /* hostname */ NULL, /* URI */ @@ -510,13 +509,6 @@ int xenXMClose(virConnectPtr conn ATTRIBUTE_UNUSED) { return (0); } -/* - * Our backend type - */ -const char *xenXMGetType(virConnectPtr conn ATTRIBUTE_UNUSED) { - return ("XenXM"); -} - /* * Since these are all offline domains, we only return info about * VCPUs and memory. diff --git a/src/xs_internal.c b/src/xs_internal.c index d735079a8c..a2d42bf3a0 100644 --- a/src/xs_internal.c +++ b/src/xs_internal.c @@ -45,7 +45,6 @@ static char *xenStoreDomainGetOSType(virDomainPtr domain); struct xenUnifiedDriver xenStoreDriver = { xenStoreOpen, /* open */ xenStoreClose, /* close */ - NULL, /* type */ NULL, /* version */ NULL, /* hostname */ NULL, /* URI */