On 03/22/2017 08:08 PM, Eric Blake wrote:
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
After looking at 9/23, I think I understand what's going on. This is
not the user-visible event, but the internal layer from the qemu monitor
back to the part of the qemu driver that generates user-visible events,
and there is still another round of translation to happen.
ACK.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org