From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgdr8-00032K-Pw for qemu-devel@nongnu.org; Tue, 12 Jul 2011 10:22:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qgdr6-0004GO-FL for qemu-devel@nongnu.org; Tue, 12 Jul 2011 10:22:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgdr5-0004GF-J0 for qemu-devel@nongnu.org; Tue, 12 Jul 2011 10:22:32 -0400 Message-ID: <4E1C5952.1040901@redhat.com> Date: Tue, 12 Jul 2011 16:25:22 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1309889871-6267-1-git-send-email-lcapitulino@redhat.com> <1309889871-6267-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1309889871-6267-4-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/8] block: Support to keep track of I/O status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: stefanha@gmail.com, jan.kiszka@siemens.com, jdenemar@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com Am 05.07.2011 20:17, schrieb Luiz Capitulino: > This commit adds support to the BlockDriverState type to keep track > of the last I/O status. That is, at every I/O operation we update > a status field in the BlockDriverState instance. Valid statuses are: > OK, FAILED and ENOSPC. > > ENOSPC is distinguished from FAILED because an management application > can use it to implement thin-provisioning. > > This feature has to be explicit enabled by buses/devices supporting it. > > Signed-off-by: Luiz Capitulino I'm not sure how this is meant to work with devices that can have multiple requests in flight. If a request fails, one of the things that are done before sending a monitor event is qemu_aio_flush(), i.e. waiting for all in-flight requests to complete. If the last one of them is successful, your status will report BDRV_IOS_OK. If you don't stop the VM on I/O errors, the status is useless anyway, even if only one request is active at the same point. I think it would make more sense if we only stored the last error (that is, don't clear the field on success). What is the use case, would this be enough for it? By the way, I'm not sure how it fits in, but I'd like to have a block layer function that format drivers can use to tell qemu that the image is corrupted. Maybe that's another case in which we should stop the VM and have an appropriate status for it. It should probably have precedence over an ENOSPC happening at the same time, so maybe we'll also need a way to tell that some status is more important and may overwrite a less important status, but not the other way round. Kevin