Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
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(a)redhat.com>
---
src/xen/xen_driver.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
ACK.
Regards,
Jim
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? */