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

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

 



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@xxxxxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]