From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoqIf-0004vd-Uc for qemu-devel@nongnu.org; Wed, 21 Oct 2015 06:08:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoqHY-0007Xl-PD for qemu-devel@nongnu.org; Wed, 21 Oct 2015 06:07:17 -0400 Date: Wed, 21 Oct 2015 11:01:24 +0100 From: Stefan Hajnoczi Message-ID: <20151021100124.GA13408@stefanha-thinkpad.redhat.com> References: <87909e13adeb2eb2c71d6613b40d3c9b534db9eb.1443793122.git.berto@igalia.com> <20151013153830.GI3057@stefanha-thinkpad.redhat.com> <20151015145822.GB21733@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org, Max Reitz On Fri, Oct 16, 2015 at 11:49:00AM +0200, Alberto Garcia wrote: > On Thu 15 Oct 2015 04:58:22 PM CEST, Stefan Hajnoczi wrote: > >> > If I/O accounting isn't being used then all fields will be 0? > >> > >> Yes, but there's no way to tell if that happens because I/O > >> accounting is not supported or because there hasn't been any I/O yet. > >> > >> There's one additional problem: this patch assumes that accounting is > >> supported if this BDS is attached to a BlockBackend. But we don't > >> know if the device model supports accounting or not, I still need to > >> figure out what's the best way to do it. > > > > Is there a corresponding libvirt patch or why does it matter whether > > the QMP client can detect whether blockstats are available? > > I'm thinking that keeping this patch as it is now is probably not very > useful. > > Block statistics are kept in the BlockBackend, so the only BDS that is > going to have data != 0 when you call query-blockstats is the topmost > one. There's probably no need to have an additional flag for this. > > If you disconnect a BlockBackend from a device model that implements > accounting and then connect it to one that does not, there's no way for > the client to know that. That's probably worth exposing in the API, but > this patch does not do that yet, so I think we can skip it for now. Okay. Stefan