[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 5/8] parallels: add a new vz connection driver and hypervisor structures



We add this connection driver just as an exact copy with different
name to keep backward compatibility.
Vz stands for Virtuozzo, which is a new name of Parallels Cloud Server.

Signed-off-by: Maxim Nestratov <mnestratov parallels com>
---
 src/parallels/parallels_driver.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 03e50e0..1404167 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -1207,8 +1207,8 @@ parallelsDomainGetMaxMemory(virDomainPtr domain)
     return ret;
 }
 
-static virHypervisorDriver parallelsDriver = {
-    .name = "Parallels",
+static virHypervisorDriver vzDriver = {
+    .name = "vz",
     .connectOpen = parallelsConnectOpen,            /* 0.10.0 */
     .connectClose = parallelsConnectClose,          /* 0.10.0 */
     .connectGetVersion = parallelsConnectGetVersion,   /* 0.10.0 */
@@ -1258,12 +1258,16 @@ static virHypervisorDriver parallelsDriver = {
     .domainGetMaxMemory = parallelsDomainGetMaxMemory, /* 1.2.15 */
 };
 
-static virConnectDriver parallelsConnectDriver = {
-    .hypervisorDriver = &parallelsDriver,
+static virConnectDriver vzConnectDriver = {
+    .hypervisorDriver = &vzDriver,
     .storageDriver = &parallelsStorageDriver,
     .networkDriver = &parallelsNetworkDriver,
 };
 
+/* Parallels domain type backward compatibility*/
+static virHypervisorDriver parallelsDriver;
+static virConnectDriver parallelsConnectDriver;
+
 /**
  * parallelsRegister:
  *
@@ -1282,8 +1286,16 @@ parallelsRegister(void)
 
     VIR_FREE(prlctl_path);
 
+    /* Backward compatibility with Parallels domain type */
+    parallelsDriver = vzDriver;
+    parallelsDriver.name = "Parallels";
+    parallelsConnectDriver = vzConnectDriver;
+    parallelsConnectDriver.hypervisorDriver = &parallelsDriver;
     if (virRegisterConnectDriver(&parallelsConnectDriver, false) < 0)
         return -1;
 
+    if (virRegisterConnectDriver(&vzConnectDriver, false) < 0)
+        return -1;
+
     return 0;
 }
-- 
2.1.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]