mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
Simplify the Xen get type driver method
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@redhat.com>
This commit is contained in:
parent
61b7a872cc
commit
1cdc465e0e
@ -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? */
|
||||
|
Loading…
x
Reference in New Issue
Block a user