• M
    conf: Don't format cputune element when not needed · 1f50730e
    Martin Kletzander 提交于
    Commit 60b176c3 introduced a bug that
    when editing an XML with cputune similar to this:
    
    ...
      <vcpu placement='static' current='1'>2</vcpu>
      <cputune>
        <vcpupin vcpu="1" cpuset="0"/>
      </cputune>
    ...
    
    results in formatted XML that looks like this:
    
    ...
      <vcpu placement='static' current='1'>2</vcpu>
      <cputune>
      </cputune>
    ...
    
    That is caused by a condition depending on def->cputune.vcpupin being
    set rather than checking def->cputune.nvcpupin.  Notice that nvcpupin
    can be 0 and vcpupin can still be allocated since it's a pointer to an
    array, so no harm done there.
    
    I also changed it on other places in the code where it depended on the
    wrong variable.
    1f50730e
domain_conf.c 510.6 KB