[PATCH 05/40] Simplify the Xen get type driver method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

There is no point iterating over sub-drivers since the user
would not have a virConnectPtr instance at all if opening
the drivers failed. Just return 'Xen' immediately.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/xen/xen_driver.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index b7f1ad4..109a074 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -491,16 +491,9 @@ unsigned long xenUnifiedVersion(void)
 
 
 static const char *
-xenUnifiedConnectGetType(virConnectPtr conn)
+xenUnifiedConnectGetType(virConnectPtr conn ATTRIBUTE_UNUSED)
 {
-    xenUnifiedPrivatePtr priv = conn->privateData;
-    int i;
-
-    for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
-        if (priv->opened[i])
-            return "Xen";
-
-    return NULL;
+    return "Xen";
 }
 
 /* Which features are supported by this driver? */
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]