1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-12 13:17:58 +03:00

parallels: set virtType depending on driver name

We remember driver name in a new field 'drivername' within
private parallels connection structure. When a new domain
is defined we use this name to set corresponding virtType.
We set VIR_DOMAIN_VIRT_VZ for 'vz' driver and
VIR_DOMAIN_VIRT_PARALLELS for 'Parallels'.

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 4f20b241bb
commit 0d76794366
3 changed files with 8 additions and 1 deletions

View File

@ -241,6 +241,8 @@ parallelsOpenDefault(virConnectPtr conn)
goto err_free;
}
privconn->drivername = conn->driver->name;
if (prlsdkInit()) {
VIR_DEBUG("%s", _("Can't initialize Parallels SDK"));
goto err_free;

View File

@ -1256,7 +1256,11 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
pdom = olddom->privateData;
}
def->virtType = VIR_DOMAIN_VIRT_PARALLELS;
if (STREQ(privconn->drivername, "vz"))
def->virtType = VIR_DOMAIN_VIRT_VZ;
else
def->virtType = VIR_DOMAIN_VIRT_PARALLELS;
def->id = -1;
/* we will remove this field in the near future, so let's set it

View File

@ -68,6 +68,7 @@ struct _parallelsConn {
virDomainXMLOptionPtr xmlopt;
virObjectEventStatePtr domainEventState;
virStorageDriverStatePtr storageState;
const char *drivername;
};
typedef struct _parallelsConn parallelsConn;