From: "Daniel P. Berrange" <berrange(a)redhat.com>
The hypervisor driver is mandatory, so the the call to
xenHypervisorGetVersion must always succeed. Thus there
is no need to ever run xenDaemonGetVersion
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/xen/xen_driver.c | 11 +----------
src/xen/xen_driver.h | 1 -
src/xen/xen_hypervisor.c | 1 -
src/xen/xend_internal.c | 31 -------------------------------
src/xen/xend_internal.h | 1 -
5 files changed, 1 insertion(+), 44 deletions(-)
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 109a074..951f6e7 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -512,16 +512,7 @@ xenUnifiedConnectSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED,
int featur
static int
xenUnifiedConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
{
- xenUnifiedPrivatePtr priv = conn->privateData;
- int i;
-
- for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
- if (priv->opened[i] &&
- drivers[i]->xenVersion &&
- drivers[i]->xenVersion(conn, hvVer) == 0)
- return 0;
-
- return -1;
+ return xenHypervisorGetVersion(conn, hvVer);
}
diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index 70c1226..803fee7 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -93,7 +93,6 @@ extern int xenRegister (void);
* structure with direct calls in xen_unified.c.
*/
struct xenUnifiedDriver {
- virDrvConnectGetVersion xenVersion;
virDrvConnectGetHostname xenGetHostname;
virDrvDomainSuspend xenDomainSuspend;
virDrvDomainResume xenDomainResume;
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 6b41898..012cb0e 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -880,7 +880,6 @@ typedef struct xen_op_v2_dom xen_op_v2_dom;
static unsigned long long xenHypervisorGetMaxMemory(virDomainPtr domain);
struct xenUnifiedDriver xenHypervisorDriver = {
- .xenVersion = xenHypervisorGetVersion,
.xenDomainSuspend = xenHypervisorPauseDomain,
.xenDomainResume = xenHypervisorResumeDomain,
.xenDomainDestroyFlags = xenHypervisorDestroyDomainFlags,
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index eb3e63e..eb11408 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -1861,36 +1861,6 @@ xenDaemonNodeGetTopology(virConnectPtr conn, virCapsPtr caps)
return ret;
}
-/**
- * xenDaemonGetVersion:
- * @conn: pointer to the Xen Daemon block
- * @hvVer: return value for the version of the running hypervisor (OUT)
- *
- * 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
- */
-int
-xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer)
-{
- struct sexpr *root;
- int major, minor;
- unsigned long version;
-
- root = sexpr_get(conn, "/xend/node/");
- if (root == NULL)
- return -1;
-
- major = sexpr_int(root, "node/xen_major");
- minor = sexpr_int(root, "node/xen_minor");
- sexpr_free(root);
- version = major * 1000000 + minor * 1000;
- *hvVer = version;
- return 0;
-}
-
/**
* xenDaemonListDomains:
@@ -3652,7 +3622,6 @@ xenDaemonDomainBlockPeek(virDomainPtr domain,
}
struct xenUnifiedDriver xenDaemonDriver = {
- .xenVersion = xenDaemonGetVersion,
.xenDomainSuspend = xenDaemonDomainSuspend,
.xenDomainResume = xenDaemonDomainResume,
.xenDomainShutdown = xenDaemonDomainShutdown,
diff --git a/src/xen/xend_internal.h b/src/xen/xend_internal.h
index e5c0896..41d8341 100644
--- a/src/xen/xend_internal.h
+++ b/src/xen/xend_internal.h
@@ -98,7 +98,6 @@ xenDaemonDomainFetch(virConnectPtr xend,
int xenDaemonOpen(virConnectPtr conn, virConnectAuthPtr auth,
unsigned int flags);
int xenDaemonClose(virConnectPtr conn);
-int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
int xenDaemonNodeGetTopology(virConnectPtr conn, virCapsPtr caps);
int xenDaemonDomainSuspend(virDomainPtr domain);
--
1.8.1.4