This series adds support for asynchronous live vCPU unplug in the QEMU
driver.
For live vCPU unplug libvirt currently waits only for a short
synchronous completion window. If the unplug completes later there is
no dedicated event reporting successful removal of the vCPU. This
series adds a new domain event for successful unplug completion and
extends the public APIs to allow requesting asynchronous unplug.
As recommended, this changeset is split into five parts-
Patch 1 adds the new event and the required public/internal plumbing.
Patch 2 wires the event into the existing QEMU unplug completion path.
Patch 3 adds the internal QEMU plumbing needed to skip waiting for
unplug completion, but leaves it unused for now.
Patches 4 and 5 then expose the new behaviour through virDomainSetVcpusFlags()
and virDomainSetVcpu() together with the corresponding virsh changes.
The new public flags are limited to live unplug. Rejected unplug
requests continue to be reported via device-removal-failed.
Most impactful change from the previous iteration is that event emission moves
from 1 vcpu-removed per qemu event model to one vcpu-removed per vcpu actually
removed. This change is effectively a no-op for x86 (because there is a 1:1
mapping), but is relevant for architectures where more than 1 vcpu might be
grouped under a single logical qemu vcpu object.
Changes from v2:
- s/virDomainSetVcpuBehaviour/virDomainSetVcpuFlags/g
- Reduce redundant phrasing
- emit `vcpu-removed` for every vcpu removed instead of per qemu event
- bump version ton 12.4.0
All test runs are still passing cleanly.
Akash Kulhalli (5):
API/qemu: add async unplug flag to virDomainSetVcpu
API/qemu: add async unplug flag to virDomainSetVcpusFlags
qemu: thread async vcpu unplug through internal helpers
qemu: emit vcpu-removed event on unplug completion
conf,remote: add vcpu-removed domain event
Related discussion:
RFC: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/2J53UIW4MFGEPANXNXEIFMHZ6X5TO3K4/
v2: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/YZID6OR72HNMKQNVELLIUJC2LDC4MPWF/