mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
Fix probing of legacy Xen driver to not leave URI set
When the legacy Xen driver probes with a NULL URI, and finds itself running on Xen, it will set conn->uri. A little bit later though it checks to see if libxl support exists, and if so declines the driver. This leaves the conn->uri set to 'xen:///', so if libxl also declines it, it prevents probing of the QEMU driver. Once a driver has set the conn->uri, it must *never* decline an open request. So we must move the libxl check earlier Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
18398cfde5
commit
b7caae92e1
@ -365,6 +365,13 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f
|
|||||||
if (!xenUnifiedProbe())
|
if (!xenUnifiedProbe())
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
|
#ifdef WITH_LIBXL
|
||||||
|
/* Decline xen:// URI if xend is not running and libxenlight
|
||||||
|
* driver is potentially available. */
|
||||||
|
if (!xenUnifiedXendProbe())
|
||||||
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(conn->uri = virURIParse("xen:///")))
|
if (!(conn->uri = virURIParse("xen:///")))
|
||||||
return VIR_DRV_OPEN_ERROR;
|
return VIR_DRV_OPEN_ERROR;
|
||||||
} else {
|
} else {
|
||||||
@ -374,6 +381,12 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f
|
|||||||
STRCASENEQ(conn->uri->scheme, "http"))
|
STRCASENEQ(conn->uri->scheme, "http"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
|
#ifdef WITH_LIBXL
|
||||||
|
/* Decline xen:// URI if xend is not running and libxenlight
|
||||||
|
* driver is potentially available. */
|
||||||
|
if (!xenUnifiedXendProbe())
|
||||||
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return an error if the path isn't '' or '/' */
|
/* Return an error if the path isn't '' or '/' */
|
||||||
if (conn->uri->path &&
|
if (conn->uri->path &&
|
||||||
@ -395,13 +408,6 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_LIBXL
|
|
||||||
/* Decline xen:// URI if xend is not running and libxenlight
|
|
||||||
* driver is potentially available. */
|
|
||||||
if (!xenUnifiedXendProbe())
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We now know the URI is definitely for this driver, so beyond
|
/* We now know the URI is definitely for this driver, so beyond
|
||||||
* here, don't return DECLINED, always use ERROR */
|
* here, don't return DECLINED, always use ERROR */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user