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

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

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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