diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 39334b75ecc04e8f8c75af6672c068f634d4397e..4ae38d37ad0ebb8aad3af2bc2b032232c0436474 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -365,6 +365,13 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f if (!xenUnifiedProbe()) 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:///"))) return VIR_DRV_OPEN_ERROR; } else { @@ -374,6 +381,12 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f STRCASENEQ(conn->uri->scheme, "http")) 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 '/' */ 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 * here, don't return DECLINED, always use ERROR */