Received: from eggs.gnu.org ([2001:4830:134:3::10]:35211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmiFD-0003wo-Cn for qemu-devel@nongnu.org; Thu, 15 Oct 2015 09:06:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmiF7-00084H-Ov for qemu-devel@nongnu.org; Thu, 15 Oct 2015 09:06:55 -0400 From: Alberto Garcia In-Reply-To: <20151013153830.GI3057@stefanha-thinkpad.redhat.com> References: <87909e13adeb2eb2c71d6613b40d3c9b534db9eb.1443793122.git.berto@igalia.com> <20151013153830.GI3057@stefanha-thinkpad.redhat.com> Date: Thu, 15 Oct 2015 15:06:19 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Stefan Hajnoczi Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org, Max Reitz On Tue 13 Oct 2015 05:38:30 PM CEST, Stefan Hajnoczi wrote: >> query-blockstats always returns a BlockDeviceStats structure for each >> BDS, regardless of whether it implements accounting or not. Since the >> field is mandatory there's no way to tell that from the values alone. >> >> This field solves that problem by indicating which BDSs support I/O >> accounting. > > I'm not sure I understand the problem. > > 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. Berto