[libvirt] [PATCH 06/23] qemu: monitor: Add support for BLOCK_WRITE_THRESHOLD event

Eric Blake eblake at redhat.com
Thu Mar 23 01:08:09 UTC 2017


On 03/15/2017 11:37 AM, Peter Krempa wrote:
> The event is fired when a given block backend node (identified by the
> node name) experiences a write beyond the bound set via
> block-set-write-threshold QMP command. This wires up the monitor code to
> extract the data and allow us receiving the events and the capability.
> ---

> +static void
> +qemuMonitorJSONHandleBlockThreshold(qemuMonitorPtr mon, virJSONValuePtr data)
> +{
> +    const char *nodename;
> +    unsigned long long threshold;
> +    unsigned long long excess;
> +
> +    if (!(nodename = virJSONValueObjectGetString(data, "node-name")))
> +        goto error;
> +
> +    if (virJSONValueObjectGetNumberUlong(data, "write-threshold", &threshold) < 0)
> +        goto error;
> +
> +    if (virJSONValueObjectGetNumberUlong(data, "amount-exceeded", &excess) < 0)
> +        goto error;
> +
> +    qemuMonitorEmitBlockThreshold(mon, nodename, threshold, excess);

Do we really want to emit the nodename as given by qemu? Or do we want
to map the name into something that matches what is in the user XML?
(Especially important since right now qemu is generating node names
because we are not yet supplying them via blockdev-add commands, and
exposing a randomly-generated name to the user seems fishy)

The rest of the patch looks okay, though

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170322/1814f038/attachment-0001.sig>


More information about the libvir-list mailing list