mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
4f01592c07
commit
f4e51d9e41
|
@ -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. */
|
||||
|
|
|
@ -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()))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue