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@xxxxxxxxxxxxx> --- src/parallels/parallels_driver.c | 2 ++ src/parallels/parallels_sdk.c | 6 +++++- src/parallels/parallels_utils.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index 44b4de8..e3ac90d 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -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; diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c index 2a44504..83117ef 100644 --- a/src/parallels/parallels_sdk.c +++ b/src/parallels/parallels_sdk.c @@ -1253,7 +1253,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 diff --git a/src/parallels/parallels_utils.h b/src/parallels/parallels_utils.h index 2d1d405..e8a92bb 100644 --- a/src/parallels/parallels_utils.h +++ b/src/parallels/parallels_utils.h @@ -68,6 +68,7 @@ struct _parallelsConn { virDomainXMLOptionPtr xmlopt; virObjectEventStatePtr domainEventState; virStorageDriverStatePtr storageState; + const char *drivername; }; typedef struct _parallelsConn parallelsConn; -- 2.1.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list