From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB1vm-0003Ow-Vn for qemu-devel@nongnu.org; Tue, 13 Jan 2015 08:54:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YB1vi-00008b-JJ for qemu-devel@nongnu.org; Tue, 13 Jan 2015 08:54:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB1vi-00008X-BS for qemu-devel@nongnu.org; Tue, 13 Jan 2015 08:54:46 -0500 Date: Tue, 13 Jan 2015 13:54:41 +0000 From: Stefan Hajnoczi Message-ID: <20150113135441.GD21941@stefanha-thinkpad.redhat.com> References: <1421068273-692-1-git-send-email-fromani@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="T7mxYSe680VjQnyC" Content-Disposition: inline In-Reply-To: <1421068273-692-1-git-send-email-fromani@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5] block: add event when disk usage exceeds threshold List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Francesco Romani Cc: kwolf@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com --T7mxYSe680VjQnyC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 occupat= ion > of the device, and automatically extends the image once the threshold > is reached or exceeded. >=20 > 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. >=20 > 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. >=20 > This will allow the managing application to use smarter and more > efficient monitoring, greatly reducing the need of polling. >=20 > Signed-off-by: Francesco Romani > Reviewed-by: Eric Blake > --- > 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 --T7mxYSe680VjQnyC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUtSOhAAoJEJykq7OBq3PIo8QH/2BrtCxDhugczxId9qkr7yBH iXBEejzr0KOP8lskQl50f3IdWqsM0RJZQuOiSZwvPOFvIgOCUKIC58gZuzzH5zDk oVqXWU1F6RignYMgKMeswJwceoJUizUhSdU3H1m/stsPGP8mtPL565bP3C/5Azb6 Kl+n2fyloL9izfRbOStSUYU0mUTWjP7NXZpgyS7t/UdZMP2lx0NSHpny5HLaoc2r rro+R2kaQ9LdZUynpWzYPPomn4vuiWeqdvdgtsuvH8Ol0tPS/VLGhqJygus/Qjcs d+R7nUHdSsE4oAhhY1FLsM1oVzcyFiKXtHK6S4zw/xfEs/8LXsIUTQtZU+EAYsE= =rPes -----END PGP SIGNATURE----- --T7mxYSe680VjQnyC--