Re: [PATCH v2 09/13] Introduce MEMORY_DEVICE_SIZE_CHANGE event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 18, 2021 at 14:31:04 +0100, Michal Privoznik wrote:
> New event is introduced that is emitted whenever guest
> acknowledges allocation change request of a virtio-mem.
> The aim is to let applications know when that happens,
> because changes in allocation are not synchronous with
> issuing the request. Under the hood, the event is
> emitted whenever QEMU emits MEMORY_DEVICE_SIZE_CHANGE
> event.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  examples/c/misc/event-test.c        | 17 ++++++
>  include/libvirt/libvirt-domain.h    | 23 ++++++++
>  src/conf/domain_event.c             | 84 +++++++++++++++++++++++++++++
>  src/conf/domain_event.h             | 10 ++++
>  src/libvirt_private.syms            |  2 +
>  src/qemu/qemu_driver.c              |  6 +++
>  src/remote/remote_daemon_dispatch.c | 30 +++++++++++
>  src/remote/remote_driver.c          | 32 +++++++++++
>  src/remote/remote_protocol.x        | 15 +++++-
>  src/remote_protocol-structs         |  7 +++
>  tools/virsh-domain.c                | 20 +++++++
>  11 files changed, 245 insertions(+), 1 deletion(-)

[...]

> diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
> index 8011cf9fe1..2c449b4f31 100644
> --- a/include/libvirt/libvirt-domain.h
> +++ b/include/libvirt/libvirt-domain.h
> @@ -4651,6 +4651,28 @@ typedef void (*virConnectDomainEventMemoryFailureCallback)(virConnectPtr conn,
>                                                             unsigned int flags,
>                                                             void *opaque);
>  
> +/**
> + * virConnectDomainEventMemoryDeviceSizeChangeCallback:
> + * @conn: connection object
> + * @dom: domain on which the event occurred
> + * @alias: memory device alias
> + * @size: new actual size of memory device (in KiB)

I'd specifically call this actualsize or something to maybe add one more
layer to avoid confuision with the 'size'

> + * @opaque: application specified data
> + *
> + * The callback occurs when the guest acknowledges request to change size of
> + * memory device (so far only virtio-mem model supports this). The @size then
> + * reflects the new amount of guest visible memory (in kibibytes).
> + *
> + * The callback signature to use when registering for an event of type
> + * VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE with
> + * virConnectDomainEventRegisterAny().
> + */
> +typedef void (*virConnectDomainEventMemoryDeviceSizeChangeCallback)(virConnectPtr conn,
> +                                                                    virDomainPtr dom,
> +                                                                    const char *alias,
> +                                                                    unsigned long long size,
> +                                                                    void *opaque);
> +
>  
>  /**
>   * VIR_DOMAIN_EVENT_CALLBACK:

But I don't think it needs to be changed in the internals though.




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux