On Wed, Jul 15, 2026 at 02:56:50PM +0530, Partha Satapathy via Devel wrote:
> The existing per-vCPU 'order' attribute has different semantics and
> cannot be reused for this purpose. It is used to define the order and
> grouping of vCPUs when they are enabled. It applies to online vCPUs and
> is not a policy for selecting offline hotpluggable vCPUs.
> 
> In particular, 'order' is not used to choose which vCPUs are removed by
> a count-based `setvcpus` reduction. Therefore, it cannot express an
> administrator-defined hot-unplug sequence.

Aren't you simply describing a bug in the implementation of "order".

I defined a guest with

  # virsh dumpxml  --inactive 2 --xpath //vcpu
  <vcpu placement="static" current="4">8</vcpu>
  <vcpu id="0" enabled="yes" hotpluggable="no" order="1"/>
  <vcpu id="1" enabled="yes" hotpluggable="yes" order="2"/>
  <vcpu id="2" enabled="no" hotpluggable="yes" order="3"/>
  <vcpu id="3" enabled="no" hotpluggable="yes" order="4"/>
  <vcpu id="4" enabled="no" hotpluggable="yes" order="5"/>
  <vcpu id="5" enabled="no" hotpluggable="yes" order="6"/>
  <vcpu id="6" enabled="yes" hotpluggable="yes" order="7"/>
  <vcpu id="7" enabled="yes" hotpluggable="yes" order="8"/>

Yet when I start this guest, libvirt throws away the order
information I configured

  # virsh setvcpus  rhel92 6

  # virsh dumpxml rhel92 --xpath //vcpu
 <vcpu placement="static" current="4">8</vcpu>
 <vcpu id="0" enabled="yes" hotpluggable="no" order="1"/>
 <vcpu id="1" enabled="yes" hotpluggable="yes" order="2"/>
 <vcpu id="2" enabled="no" hotpluggable="yes"/>
 <vcpu id="3" enabled="no" hotpluggable="yes"/>
 <vcpu id="4" enabled="no" hotpluggable="yes"/>
 <vcpu id="5" enabled="no" hotpluggable="yes"/>
 <vcpu id="6" enabled="yes" hotpluggable="yes" order="3"/>
 <vcpu id="7" enabled="yes" hotpluggable="yes" order="4"/>


and hotplugging CPUs ignores the order I defined

  # virsh setvcpus  rhel92 6

  # virsh dumpxml rhel92 --xpath //vcpu
  <vcpu placement="static" current="6">8</vcpu>
  <vcpu id="0" enabled="yes" hotpluggable="no" order="1"/>
  <vcpu id="1" enabled="yes" hotpluggable="yes" order="2"/>
  <vcpu id="2" enabled="yes" hotpluggable="yes" order="5"/>
  <vcpu id="3" enabled="yes" hotpluggable="yes" order="6"/>
  <vcpu id="4" enabled="no" hotpluggable="yes"/>
  <vcpu id="5" enabled="no" hotpluggable="yes"/>
  <vcpu id="6" enabled="yes" hotpluggable="yes" order="3"/>
  <vcpu id="7" enabled="yes" hotpluggable="yes" order="4"/>

IMHO, that is just broken and we should fix "order" to be honoured,
which would appear to address your use case.


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|

Reply via email to