Re: [PATCH 2/4] parallels: set cpu mode when applying xml configuration

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

 



On 30.01.2015 20:58, Maxim Nestratov wrote:
> 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 b9d5ddf..795ba31 100644
> --- a/src/parallels/parallels_sdk.c
> +++ b/src/parallels/parallels_sdk.c
> @@ -2802,6 +2802,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;
>  
> 

ACK

Michal

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