qemu-e2k/include/block
Francesco Romani e2462113b2 block: add event when disk usage exceeds threshold
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.

[Updated qemu-iotests 067 output to add the new 'write_threshold'
property. --Stefan]
[Changed g_assert_false() to !g_assert() to fix the build on older glib
versions. --Kevin]

Signed-off-by: Francesco Romani <fromani@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1421068273-692-1-git-send-email-fromani@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-02-06 17:24:21 +01:00
..
accounting.h block: add accounting for merged requests 2015-02-06 17:24:21 +01:00
aio.h qemu-timer: rename timer_init to timer_init_tl 2015-01-14 10:38:57 +01:00
block_int.h block: add event when disk usage exceeds threshold 2015-02-06 17:24:21 +01:00
block.h block: Split BLOCK_OP_TYPE_COMMIT to BLOCK_OP_TYPE_COMMIT_{SOURCE, TARGET} 2015-01-13 13:43:29 +00:00
blockjob.h blockjob: add block_job_defer_to_main_loop() 2014-11-03 11:41:49 +00:00
coroutine_int.h coroutine: stop using AioContext in CoQueue 2013-05-24 16:17:56 +02:00
coroutine.h coroutine: drop qemu_coroutine_adjust_pool_size 2015-01-13 13:43:29 +00:00
nbd.h nbd: Change external interface to BlockBackend 2014-12-10 10:31:12 +01:00
qapi.h block/qapi: Convert qmp_query_block() to BlockBackend 2014-10-20 14:03:50 +02:00
scsi.h scsi: Print command name in debug 2014-06-18 08:47:10 +02:00
snapshot.h qemu-nbd: support internal snapshot export 2013-12-04 15:19:00 +01:00
thread-pool.h block: Rename BlockDriverCompletionFunc to BlockCompletionFunc 2014-10-20 13:41:27 +02:00
write-threshold.h block: add event when disk usage exceeds threshold 2015-02-06 17:24:21 +01:00