On Thu, Feb 23, 2017 at 16:32:45 -0600, Eric Blake wrote:
On 02/23/2017 01:21 PM, Peter Krempa wrote:
> When using thin provisioning, management tools need to resize the disk
> in certain cases. To avoid having them to poll disk fillng introduce an
Typo, but a different word sounds better:
s/fillng/usage/
> event whic will be fired when a given offset of the storage is written
s/whic/which/
> by the hypervisor. Together with the API which will be added later, it
> will allow to register thresholds for given storage backing volumes and
s/to register/registering/
> this event will then notify management if the threshold is exceeded.
> ---
> daemon/remote.c | 43 ++++++++++++++++
> examples/object-events/event-test.c | 19 ++++++++
> include/libvirt/libvirt-domain.h | 31 ++++++++++++
> src/conf/domain_event.c | 97 +++++++++++++++++++++++++++++++++++++
> src/conf/domain_event.h | 15 ++++++
> src/libvirt_private.syms | 2 +
> src/remote/remote_driver.c | 33 +++++++++++++
> src/remote/remote_protocol.x | 18 ++++++-
> src/remote_protocol-structs | 9 ++++
> tools/virsh-domain.c | 21 ++++++++
> 10 files changed, 287 insertions(+), 1 deletion(-)
>
> +++ b/include/libvirt/libvirt-domain.h
> @@ -4175,6 +4175,36 @@ typedef void
(*virConnectDomainEventAgentLifecycleCallback)(virConnectPtr conn,
>
>
> /**
> + * virConnectDomainEventBlockThresholdCallback:
> + * @conn: connection object
> + * @dom: domain on which the event occurred
> + * @dev: name associated with the affected disk or storage backing chain
> + * element
> + * @path: for local storage, the path of the backing chain element
> + * @threshold: threshold
> + * @excess: WTF
Supposedly, how much beyond the threshold a write was detected at the
time the event was fired. (For example, if I have an 8M file with a
threshold at 6M, then the guest does a 2M write at offset 5M, threshold
would be 1M, because the write from 5-7M is 1M beyond my threshold of 6M).
Ummm, yes, I just forgot to update it once I actually written the docs.
> + * @opaque: application specified data
> + *
> + * The callback occurs when the hypervisor detects that the given storage
> + * element was written beyond the point specified by @threshold. The excess
> + * data size written beyond @threshold is reported by @excess (if supported
> + * by the hypervisor, 0 otherwise). The event is useful for thin-provisioned
> + * storage.
This description is better than the WTF above :)
Maybe I should pick better strings to make the docs generator shut up
for work in progress code :D
> + *
> + * The threshold size can be set via the virDomainSetBlockThreshold API.
(added later in the series, but documenting now is fine)
Looks okay
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list