If 'parallels:///system' uri is specified then connection is made to 'Parallels' driver and domain type will be VIR_DOMAIN_VIRT_PARALLELS. In case of 'vz:///system' connection is established to 'vz' driver and domain type will be VIR_DOMAIN_VIRT_VZ. Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx> --- src/parallels/parallels_driver.c | 12 +++++++++++- src/parallels/parallels_network.c | 3 ++- src/parallels/parallels_storage.c | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index b2ce2ef..3db5872 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -296,7 +296,17 @@ parallelsConnectOpen(virConnectPtr conn, if (!conn->uri) return VIR_DRV_OPEN_DECLINED; - if (!conn->uri->scheme || STRNEQ(conn->uri->scheme, "parallels")) + if (!conn->uri->scheme) + return VIR_DRV_OPEN_DECLINED; + + if (STRNEQ(conn->uri->scheme, "vz") && + STRNEQ(conn->uri->scheme, "parallels")) + return VIR_DRV_OPEN_DECLINED; + + if (STREQ(conn->uri->scheme, "vz") && STRNEQ(conn->driver->name, "vz")) + return VIR_DRV_OPEN_DECLINED; + + if (STREQ(conn->uri->scheme, "parallels") && STRNEQ(conn->driver->name, "Parallels")) return VIR_DRV_OPEN_DECLINED; /* Remote driver should handle these. */ diff --git a/src/parallels/parallels_network.c b/src/parallels/parallels_network.c index fb98041..895c706 100644 --- a/src/parallels/parallels_network.c +++ b/src/parallels/parallels_network.c @@ -334,7 +334,8 @@ parallelsNetworkOpen(virConnectPtr conn, virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); - if (STRNEQ(conn->driver->name, "Parallels")) + if (STRNEQ(conn->driver->name, "vz") && + STRNEQ(conn->driver->name, "Parallels")) return VIR_DRV_OPEN_DECLINED; if (!(privconn->networks = virNetworkObjListNew())) diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c index 4091124..3dcc44d 100644 --- a/src/parallels/parallels_storage.c +++ b/src/parallels/parallels_storage.c @@ -470,7 +470,8 @@ parallelsStorageOpen(virConnectPtr conn, virStorageDriverStatePtr storageState; virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); - if (STRNEQ(conn->driver->name, "Parallels")) + if (STRNEQ(conn->driver->name, "vz") && + STRNEQ(conn->driver->name, "Parallels")) return VIR_DRV_OPEN_DECLINED; if (VIR_ALLOC(storageState) < 0) -- 2.1.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list