From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrPXw-0000xV-L4 for qemu-devel@nongnu.org; Thu, 20 Nov 2014 06:05:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrPXq-0000Xn-Gk for qemu-devel@nongnu.org; Thu, 20 Nov 2014 06:05:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrPXq-0000WK-A8 for qemu-devel@nongnu.org; Thu, 20 Nov 2014 06:05:02 -0500 Date: Thu, 20 Nov 2014 11:04:56 +0000 From: Stefan Hajnoczi Message-ID: <20141120110456.GA11224@stefanha-thinkpad.redhat.com> References: <1415365933-3727-1-git-send-email-fromani@redhat.com> <1415365933-3727-2-git-send-email-fromani@redhat.com> <20141117164936.GL16192@stefanha-thinkpad.redhat.com> <20141120103053.GA9266@noname.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline In-Reply-To: <20141120103053.GA9266@noname.redhat.com> Subject: Re: [Qemu-devel] [RFC][PATCH v2] block: add write threshold reporting for block devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: mdroth@linux.vnet.ibm.com, Stefan Hajnoczi , lcapitulino@redhat.com, qemu-devel@nongnu.org, Francesco Romani --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 20, 2014 at 11:30:53AM +0100, Kevin Wolf wrote: > Am 17.11.2014 um 17:49 hat Stefan Hajnoczi geschrieben: > > On Fri, Nov 07, 2014 at 02:12:13PM +0100, Francesco Romani wrote: > > > +void bdrv_set_usage_threshold(BlockDriverState *bs, int64_t threshol= d_bytes) > > > +{ > > > + BlockDriverState *target_bs =3D bs; > > > + if (bs->file) { > > > + target_bs =3D bs->file; > > > + } > >=20 > > Hmm...I think now I understand why you are trying to use bs->file. This > > is an attempt to make image formats work with the threshold. > >=20 > > Unfortunately the BlockDriverState topology can be more complicated than > > just 1 level. > >=20 > > If we hardcode a strategy to traverse bs->file then it will work in most > > cases: > >=20 > > while (bs->file) { > > bs =3D bs->file; > > } > >=20 > > But there are cases like VMDK extent files where a BlockDriverState > > actually has multiple children. > >=20 > > One way to solve this is to require that the management tool tells QEMU > > which exact BlockDriverState node the threshold applies to. Then QEMU > > doesn't need any hardcoded policy. But I'm not sure how realistic that > > it at the moment (whether management tools are uses node names for each > > node yet), so it may be best to hardcode the bs->file traversal that > > I've suggested. > >=20 > > Kevin: Do you agree? >=20 > I have a feeling that we would regret this in the long run because it > would allow only one special case of a general problem (watching a BDS). > This means that we'll get inconsistent APIs. >=20 > We're "only" talking about an optimisation here, even though a very > useful one, so I wouldn't easily make compromises here. We should > probably insist on using the node-name. Management tools need new code > anyway to make use of the new functionality, so they can implement > node-name support as well while they're at it. Using node-name is the best thing to do. My concern is just whether libvirt and other management tools are actually using node-name yet. Stefan --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUbcrYAAoJEJykq7OBq3PIlB4IAJHQKwJ/pdkMFMdwATQApiCO Z8swbV6tBWg1Kc5IPnWvwbmtXj3CmEvgm9+hE8tFMJFpFcR0+QxdghRJSrh+VSNc /TEeiV/LQDSUwkQ8KTmiN/w4iAscBkcA+KmCMxxGBRPsut5nKUISlFfuJm8AKFj0 UMZrRXaXOXkhRRdI5FCDm/gASdhJmL1RXgJoWbhYw7GNQz2oslD2Acdvtj8QC57D w9SFW5tnMKghy7AVg8dHKlZJdkLdJ165uDyAlw6ooUxMp8Xg/VJZWhUnCqgh82+p bmIcQtJyFSSb5H0GSH1o8cTJHp1E/wVsIqsmbUOJQg5xSSmgrQxbWMjrekX5o24= =F59D -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4--