qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5] block: add event when disk usage exceeds thr


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v5] block: add event when disk usage exceeds threshold
Date: Tue, 13 Jan 2015 13:54:41 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jan 12, 2015 at 02:11:13PM +0100, Francesco Romani wrote:
> Managing applications, like oVirt (http://www.ovirt.org), make extensive
> use of thin-provisioned disk images.
> To let the guest run smoothly and be not unnecessarily paused, oVirt sets
> a disk usage threshold (so called 'high water mark') based on the occupation
> of the device,  and automatically extends the image once the threshold
> is reached or exceeded.
> 
> In order to detect the crossing of the threshold, oVirt has no choice but
> aggressively polling the QEMU monitor using the query-blockstats command.
> This lead to unnecessary system load, and is made even worse under scale:
> deployments with hundreds of VMs are no longer rare.
> 
> To fix this, this patch adds:
> * A new monitor command `block-set-write-threshold', to set a mark for
>   a given block device.
> * A new event `BLOCK_WRITE_THRESHOLD', to report if a block device
>   usage exceeds the threshold.
> * A new `write_threshold' field into the `BlockDeviceInfo' structure,
>   to report the configured threshold.
> 
> This will allow the managing application to use smarter and more
> efficient monitoring, greatly reducing the need of polling.
> 
> Signed-off-by: Francesco Romani <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
>  block/Makefile.objs             |   1 +
>  block/qapi.c                    |   3 +
>  block/write-threshold.c         | 125 
> ++++++++++++++++++++++++++++++++++++++++
>  include/block/block_int.h       |   4 ++
>  include/block/write-threshold.h |  64 ++++++++++++++++++++
>  qapi/block-core.json            |  51 +++++++++++++++-
>  qmp-commands.hx                 |  32 ++++++++++
>  tests/Makefile                  |   3 +
>  tests/test-write-threshold.c    | 119 ++++++++++++++++++++++++++++++++++++++
>  9 files changed, 401 insertions(+), 1 deletion(-)
>  create mode 100644 block/write-threshold.c
>  create mode 100644 include/block/write-threshold.h
>  create mode 100644 tests/test-write-threshold.c

Thanks, applied to my block branch:
https://github.com/stefanha/qemu/tree/block

Stefan

Attachment: pgpVqsB9R1g2o.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]