parallels: accept vz as a driver uri and name

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@parallels.com>
This commit is contained in:
Maxim Nestratov 2015-05-26 20:12:00 +03:00 committed by Dmitry Guryanov
parent 4f01592c07
commit f4e51d9e41
3 changed files with 15 additions and 3 deletions

View File

@ -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. */

View File

@ -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()))

View File

@ -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)