[libvirt] [PATCH 11/23] virsh: Implement 'domblkthreshold' command to call virDomainSetBlockThreshold

Eric Blake eblake at redhat.com
Thu Mar 23 19:34:04 UTC 2017


On 03/15/2017 11:37 AM, Peter Krempa wrote:
> Add a simple wrapper which will allow to set the threshold for
> delivering the event.
> ---
>  tools/virsh-domain.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tools/virsh.pod      |  8 +++++++
>  2 files changed, 72 insertions(+)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index ee702f3c4..36629523b 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -7097,6 +7097,64 @@ cmdSetvcpu(vshControl *ctl, const vshCmd *cmd)
> 
> 
>  /*
> + * "domblkthreshold" command
> + */
> +static const vshCmdInfo info_domblkthreshold[] = {
> +    {.name = "help",
> +     .data = N_("set the threshold for block-threshold event for a given block "
> +                "device or it's backing chain element")
> +    },
> +    {.name = "desc",
> +     .data = N_("set threshold for ")

Incomplete thought?

> +
> +=item B<domblkthreshold> I<domain> I<dev> I<threshold>
> +
> +Set the threshold value for delivering the block-threshold event. I<dev>
> +specifies the disk device target or backing chain element of given device using
> +the 'target[1]' syntax. I<threshold> is a scaled value of the offset. If the
> +block device should write beyond that offset the event will be delivered.
> +

Should virsh check that the event is actually available from the server
(that is, that a registration for the event succeeds) before trying the
threshold?  Or are we not worried about that?  At the lower level, it is
reasonable to assume that any driver will either implement all or none
of the threshold setting and event in the same release, so if the
command succeeds, then you are right that the event should work.

So, once you fix the "desc" text, ACK.

-- 
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/20170323/490577f0/attachment-0001.sig>


More information about the libvir-list mailing list