[PATCH 1/5] parallels: set cpu mode when applying xml configuration

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

 



From: Mikhail Feoktistov <mfeoktistov@xxxxxxxxxxxxx>

Otherwise exporting existing domain config and defining a new one like this:
virsh -c parallels:///system dumpxml instance01 > my.xml
virsh -c parallels:///system define my.xml
leads to an error because PCS default x64 mode turns to x32.
Thus, we need to set correct cpuMode in prlsdkDoApplyConfig() explicitly.

Signed-off-by: Mikhail Feoktistov <mfeoktistov@xxxxxxxxxxxxx>
Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
 src/parallels/parallels_sdk.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index d0d2ce2..f49155b 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -2794,6 +2794,19 @@ prlsdkDoApplyConfig(PRL_HANDLE sdkdom,
     pret = PrlVmCfg_SetCpuCount(sdkdom, def->vcpus);
     prlsdkCheckRetGoto(pret, error);
 
+    switch (def->os.arch) {
+        case VIR_ARCH_X86_64:
+            pret = PrlVmCfg_SetCpuMode(sdkdom, PCM_CPU_MODE_64);
+            break;
+        case VIR_ARCH_I686:
+            pret = PrlVmCfg_SetCpuMode(sdkdom, PCM_CPU_MODE_32);
+            break;
+        default:
+            virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown CPU mode: %X"), def->os.arch);
+            goto error;
+    }
+    prlsdkCheckRetGoto(pret, error);
+
     if (prlsdkClearDevices(sdkdom) < 0)
         goto error;
 
-- 
1.7.1

--
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]