On 06/15/2015 07:19 AM, Peter Krempa wrote:
On Fri, Jun 12, 2015 at 13:29:25 -0600, Eric Blake wrote:
> qemu 2.3 added a new QMP command block-set-write-threshold,
> which allows callers to get an interrupt when a file hits a
> write threshold, rather than the current approach of repeatedly
> polling for file allocation. This patch prepares the API for
> callers to register to receive the event, as well as a way
> to query the threshold via virDomainListGetStats().
>
> +
> +typedef enum {
> + /* threshold is thousandth of a percentage (0 to 100000) relative to
You managed to choose a unusual unit. Commonly used ones are 1/1000 and
1/1 000 000. Financial world also uses 1/10 000. Your unit of 1/100 000
is not among:
https://en.wikipedia.org/wiki/Parts-per_notation#Parts-per_expressions
I'd again suggest to use 1/1 000 000. Or if you want to be uber preciese
you might choose 1/(2^64 - 1).
Francesco, what precision would you like? Parts per million seems okay
to me, if we want an order of magnitude closer; and I don't think we
need anything beyond that. Or if parts per thousand is sufficient, that
leads to smaller numbers on input. But it's pretty trivial for me to
adjust the code to a different base, for whatever people would like.
> + * The contents of @devAlias will be "vda" when the
threshold is triggered
> + * on the active layer of guest disk vda. Some hypervisors also support
> + * threshold reporting on backing images, such as during a block commit;
> + * when that happens, @devAlias will be "vda[1]" for the backingStore at
> + * index 1 within the chain of host resources for guest disk vda.
Is it perhaps worth to include a optional field that will contain the
file path since most use cases of this event will use a local block
device with the event? iscsi and NBD block devices then could return the
field empty as we now do in the bulk stats API
Good idea - since the input accepts local path names instead of "vda",
the output can display both where a local name is available. I'll
update my code.
> + *
> + * The @disk parameter is either the device target shorthand (the
> + * <target dev='...'/> sub-element, such as "vda"), or
(since 0.9.8)
Since this will be added in 1.3.0 (or 1.2.15) the "since" statement is
not exactly true.
Copy-and-paste strikes again :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org