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 <from...@redhat.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > --- > 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
pgpepPf6dnLX9.pgp
Description: PGP signature