On Thu, Apr 23, 2026 at 17:27:25 +0530, Akash Kulhalli via Devel wrote:
> Add a new domain event for completed vCPU removal.
>
> Wire the event through the internal event framework and extend the
> remote protocol so remote clients can receive it. Update virsh and
> the event-test example accordingly.
>
> The event is not emitted anywhere yet.
>
> Signed-off-by: Akash Kulhalli <[email protected]>
> ---
> examples/c/misc/event-test.c | 12 ++++++
> include/libvirt/libvirt-domain.h | 22 ++++++++++
> src/conf/domain_event.c | 66 +++++++++++++++++++++++++++++
> src/conf/domain_event.h | 6 +++
> src/libvirt_private.syms | 2 +
> src/remote/remote_daemon_dispatch.c | 26 ++++++++++++
> src/remote/remote_driver.c | 29 +++++++++++++
> src/remote/remote_protocol.x | 14 +++++-
> src/remote_protocol-structs | 6 +++
> tools/virsh-domain-event.c | 16 +++++++
> 10 files changed, 198 insertions(+), 1 deletion(-)
[...]
> +/**
> + * virConnectDomainEventVcpuRemovedCallback:
> + * @conn: connection object
> + * @dom: domain on which the event occurred
> + * @vcpuid: libvirt XML vCPU id
> + * @opaque: application specified data
> + *
> + * This callback occurs when a vCPU is removed from the domain.
> + *
> + * The @vcpuid value matches the ``<vcpu id='...'>`` value from the domain
> XML.
> + *
> + * The callback signature to use when registering for an event of type
> + * VIR_DOMAIN_EVENT_ID_VCPU_REMOVED with virConnectDomainEventRegisterAny().
> + *
> + * Since: 12.3.0
Since we've entered freeze for the 12.3.0 release on friday, all of the
version info will need to be bumped to 12.4.0.
For now please do not send another version, if this is the only change
needed I'll do it without the need for another version.
[...]
> @@ -251,6 +253,13 @@ struct _virDomainEventDeviceRemovalFailed {
> };
> typedef struct _virDomainEventDeviceRemovalFailed
> virDomainEventDeviceRemovalFailed;
>
> +struct _virDomainEventVcpuRemoved {
> + virDomainEvent parent;
> +
> + unsigned int vcpuid;
> +};
Platforms such as PowerPC can hot(un)plug CPUs in groups which represent
just one device in qemu. With the callback data desinged as this it
will require that we fire off/synthethize the event for all other vcpu
ids which belong to the same group.
(I think I trimmed too much text) The above fact shouold be
documented in the docs for the new event - that multiple events are
delivered representing vcpus in the same hotpluggable group
Alternatively we could add a list of vcpu ids.
Anyways, for now (with one of the approaches above):
Reviewed-by: Peter Krempa <[email protected]>