[libvirt-users] How to insert vcpupin in guest xml file

hzguanqiang at corp.netease.com hzguanqiang at corp.netease.com
Mon Sep 9 08:54:41 UTC 2013


Hi Peeyush,
I also added vcpupin setting for my vm started by openstack.
You can add the configure into xml just like one of the following two formats:
         <vcpu placement='static' cpuset='4-5'>3</vcpu> 
OR
  <cputune>
    <vcpupin vcpu='0' cpuset='4'/>
    <vcpupin vcpu='1' cpuset='5'/>
  </cputune>

Wish this can help you.

On 2013-09-09 11:39 , hongming wrote:
On 07/19/2013 04:51 PM, Peeyush Gupta wrote:

Hi all,


I am trying to add vcpupin in the guest xml file. I am working with openstack and the code I have is python bound. I investigated through the code and found that the elemets in xml file are set in get_guest_config function. Now the thing is I am not able to set vcpupin element. I mean I tried guest.cputune_vcpupin but it's not working.
Hi Peeyush 

In libvirt python -binding . You can find the following functions for pining  vcpus.


class virDomain:
.....

    def pinVcpu(self, vcpu, cpumap):
        """Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor. """
        ret = libvirtmod.virDomainPinVcpu(self._o, vcpu, cpumap)
        if ret == -1: raise libvirtError ('virDomainPinVcpu() failed', dom=self)
        return ret

    def pinVcpuFlags(self, vcpu, cpumap, flags):
        """Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor. """
        ret = libvirtmod.virDomainPinVcpuFlags(self._o, vcpu, cpumap, flags)
        if ret == -1: raise libvirtError ('virDomainPinVcpuFlags() failed', dom=self)
        return ret

.......



Help me out, please!
Thanks.

~Peeyush Gupta

 

_______________________________________________
libvirt-users mailing list
libvirt-users at redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users




------------------     
Best regards!
GuanQiang
16:41:56
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130909/bdcdb5a2/attachment.htm>


More information about the libvirt-users mailing list