]> xenbits.xensource.com Git - libvirt.git/commitdiff
Simplify the Xen get max vcpus / node get info driver methods
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 30 Apr 2013 13:57:03 +0000 (14:57 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 9 May 2013 12:16:19 +0000 (13:16 +0100)
Unconditionally call into xenHypervisorGetMaxVcpus and
xenDaemonNodeGetInfo respectively, since those drivers
are both mandatory

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/xen/xen_driver.c

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