提交 f4e51d9e 编写于 作者: M Maxim Nestratov 提交者: Dmitry Guryanov

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: NMaxim Nestratov <mnestratov@parallels.com>
上级 4f01592c
...@@ -296,7 +296,17 @@ parallelsConnectOpen(virConnectPtr conn, ...@@ -296,7 +296,17 @@ parallelsConnectOpen(virConnectPtr conn,
if (!conn->uri) if (!conn->uri)
return VIR_DRV_OPEN_DECLINED; 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; return VIR_DRV_OPEN_DECLINED;
/* Remote driver should handle these. */ /* Remote driver should handle these. */
......
...@@ -334,7 +334,8 @@ parallelsNetworkOpen(virConnectPtr conn, ...@@ -334,7 +334,8 @@ parallelsNetworkOpen(virConnectPtr conn,
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); 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; return VIR_DRV_OPEN_DECLINED;
if (!(privconn->networks = virNetworkObjListNew())) if (!(privconn->networks = virNetworkObjListNew()))
......
...@@ -470,7 +470,8 @@ parallelsStorageOpen(virConnectPtr conn, ...@@ -470,7 +470,8 @@ parallelsStorageOpen(virConnectPtr conn,
virStorageDriverStatePtr storageState; virStorageDriverStatePtr storageState;
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); 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; return VIR_DRV_OPEN_DECLINED;
if (VIR_ALLOC(storageState) < 0) if (VIR_ALLOC(storageState) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册