mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
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:
parent
dfda6e1161
commit
17f9852734
@ -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 *
|
||||||
|
Loading…
Reference in New Issue
Block a user