[PATCH v2 0/5] qemu: support async live vCPU unplug

Akash Kulhalli via Devel posted 5 patches 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20260423115819.1000720-1-akash.kulhalli@oracle.com
There is a newer version of this series
[PATCH v2 0/5] qemu: support async live vCPU unplug
Posted by Akash Kulhalli via Devel 3 weeks ago
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.

Changes from v1:
- split the original patch into five pieces separating event plumbing,
  event emission, internal helper changes, virDomainSetVcpusFlags(),
  and virDomainSetVcpu()
- rename VIR_DOMAIN_VCPU_ASYNC to VIR_DOMAIN_VCPU_ASYNC_UNPLUG
- add a dedicated virDomainSetVcpuBehaviour enum with
  VIR_DOMAIN_SETVCPU_ASYNC_UNPLUG for virDomainSetVcpu()
- add virsh manpage documentation for the new --async option
- this flag is a no-op if the action does not involve a live vcpu hot-unplug,
  and has been documented as such for the relevant functions

Akash Kulhalli (5):
  conf,remote: add vcpu-removed domain event
  qemu: emit vcpu-removed event on unplug completion
  qemu: thread async vcpu unplug through internal helpers
  API/qemu: add async unplug flag to virDomainSetVcpusFlags
  API/qemu: add async unplug flag to virDomainSetVcpu

Related discussion:
RFC: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/2J53UIW4MFGEPANXNXEIFMHZ6X5TO3K4/
v1: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/2J3VVKHGSADGACZ3XBS4LEPL7FGMF2BR/