<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
DIV.FoxDiv20130909164156297646 {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 微 COLOR: #000000; FONT-SIZE: 11pt; 36719: ; 38597: ; 40657: 
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.7601.17514"></HEAD>
<BODY style="MARGIN: 10px" text=#000000>
<DIV>Hi Peeyush,</DIV>
<DIV>I also added vcpupin setting for my vm started by openstack.</DIV>
<DIV>You can add the configure into xml just like one of the following two 
formats:</DIV>
<DIV>         <SPAN 
style="FONT-SIZE: 8pt"><vcpu placement='static' 
cpuset='4-5'>3</vcpu> </SPAN></DIV>
<DIV>OR</DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
  <DIV>
  <DIV style="FONT-SIZE: 8pt">  <cputune></DIV>
  <DIV style="FONT-SIZE: 8pt">    <vcpupin vcpu='0' 
  cpuset='4'/></DIV>
  <DIV style="FONT-SIZE: 8pt">    <vcpupin vcpu='1' 
  cpuset='5'/></DIV>
  <DIV style="FONT-SIZE: 8pt">  </cputune></DIV></DIV></BLOCKQUOTE>
<DIV style="FONT-SIZE: 8pt" dir=ltr> </DIV>
<DIV style="FONT-SIZE: 10.5pt" dir=ltr>Wish this can help you.</DIV>
<DIV style="FONT-SIZE: 10.5pt" dir=ltr> </DIV>
<DIV>On 2013-09-09 11:39 , <A 
href="mailto:honzhang@redhat.com">hongming</A> wrote:</DIV>
<DIV>
<TABLE width="100%">
  <TBODY>
  <TR>
    <TD width="100%">
      <BLOCKQUOTE 
      style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
        <DIV style="BACKGROUND-COLOR: white" class=FoxDiv20130909164156297646>
        <DIV class=moz-cite-prefix>On 07/19/2013 04:51 PM, Peeyush Gupta 
        wrote:<BR></DIV>
        <BLOCKQUOTE 
        cite=mid:1374223862.34534.YahooMailNeo@web194601.mail.sg3.yahoo.com 
        type="cite">
          <DIV style="BACKGROUND-COLOR: #fff; FONT-FAMILY: times
                  new roman, new york, times, serif; COLOR: #000; FONT-SIZE: 12pt">
          <DIV style="FONT-FAMILY: 'times new roman', 'new york', times,
                    serif; FONT-SIZE: 12pt"><SPAN>Hi all,</SPAN></DIV>
          <DIV 
          style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: 'times new roman', 'new york', times,
                    serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px"><SPAN><BR></SPAN></DIV>
          <DIV 
          style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: 'times new roman', 'new york',
                    times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px"><SPAN>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.</SPAN></DIV></DIV></BLOCKQUOTE>Hi Peeyush <BR><BR>In libvirt 
        python -binding . You can find the following functions for pining  
        vcpus.<BR><BR><BR>class virDomain:<BR>.....<BR><BR>    
        def pinVcpu(self, vcpu, 
        cpumap):<BR>        """Dynamically 
        change the real CPUs which can be allocated to a virtual CPU. This 
        function requires privileged access to the hypervisor. 
        """<BR>        ret = 
        libvirtmod.virDomainPinVcpu(self._o, vcpu, 
        cpumap)<BR>        if ret == -1: 
        raise libvirtError ('virDomainPinVcpu() failed', 
        dom=self)<BR>        return 
        ret<BR><BR>    def pinVcpuFlags(self, vcpu, cpumap, 
        flags):<BR>        """Dynamically 
        change the real CPUs which can be allocated to a virtual CPU. This 
        function requires privileged access to the hypervisor. 
        """<BR>        ret = 
        libvirtmod.virDomainPinVcpuFlags(self._o, vcpu, cpumap, 
        flags)<BR>        if ret == -1: raise 
        libvirtError ('virDomainPinVcpuFlags() failed', 
        dom=self)<BR>        return 
        ret<BR><BR>.......<BR>
        <BLOCKQUOTE 
        cite=mid:1374223862.34534.YahooMailNeo@web194601.mail.sg3.yahoo.com 
        type="cite">
          <DIV style="BACKGROUND-COLOR: #fff; FONT-FAMILY: times
                  new roman, new york, times, serif; COLOR: #000; FONT-SIZE: 12pt">
          <DIV 
          style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: 'times new roman', 'new york',
                    times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px"><SPAN><BR></SPAN></DIV>
          <DIV 
          style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: 'times new roman', 'new york',
                    times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px"><SPAN>Help 
          me out, please!</SPAN></DIV>
          <DIV 
          style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: 'times new roman', 'new york',
                    times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px">Thanks.</DIV>
          <DIV style="FONT-FAMILY: 'times new roman', 'new york', times,
                    serif; FONT-SIZE: 12pt"> </DIV>
          <DIV style="FONT-FAMILY: 'times new roman', 'new york', times,
                    serif; FONT-SIZE: 12pt"><FONT class=Apple-style-span 
          color=#9e8fa9>~Peeyush Gupta</FONT></DIV></DIV><BR>
          <FIELDSET class=mimeAttachmentHeader></FIELDSET> <BR><PRE wrap="">_______________________________________________
libvirt-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</A>
<A class=moz-txt-link-freetext href="https://www.redhat.com/mailman/listinfo/libvirt-users">https://www.redhat.com/mailman/listinfo/libvirt-users</A></PRE></BLOCKQUOTE><BR></DIV></BLOCKQUOTE></TD></TR></TBODY></TABLE></DIV>
<DIV> </DIV>
<DIV><SPAN>
<DIV style="FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<DIV>------------------     <BR>Best 
regards!<BR>GuanQiang</DIV></DIV></SPAN></DIV>
<DIV>16:41:56</DIV></BODY></HTML>