Simplify the Xen get max vcpus / node get info driver methods

Unconditionally call into xenHypervisorGetMaxVcpus and
xenDaemonNodeGetInfo respectively, since those drivers
are both mandatory

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-04-30 14:57:03 +01:00
parent dfda6e1161
commit 17f9852734

View File

@ -552,29 +552,18 @@ xenUnifiedConnectIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED)
int int
xenUnifiedConnectGetMaxVcpus(virConnectPtr conn, const char *type) xenUnifiedConnectGetMaxVcpus(virConnectPtr conn, const char *type)
{ {
xenUnifiedPrivatePtr priv = conn->privateData;
if (type && STRCASENEQ(type, "Xen")) { if (type && STRCASENEQ(type, "Xen")) {
virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__); virReportError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1; return -1;
} }
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) return xenHypervisorGetMaxVcpus(conn, type);
return xenHypervisorGetMaxVcpus(conn, type);
else {
virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
return -1;
}
} }
static int static int
xenUnifiedNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) xenUnifiedNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
{ {
xenUnifiedPrivatePtr priv = conn->privateData; return xenDaemonNodeGetInfo(conn, info);
if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
return xenDaemonNodeGetInfo(conn, info);
return -1;
} }
static char * static char *