From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW0fa-0007lA-BD for qemu-devel@nongnu.org; Mon, 22 Sep 2014 06:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW0fR-0001Nd-97 for qemu-devel@nongnu.org; Mon, 22 Sep 2014 06:16:34 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:41767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW0fQ-0001MF-Os for qemu-devel@nongnu.org; Mon, 22 Sep 2014 06:16:24 -0400 Received: by mail-we0-f174.google.com with SMTP id w62so2153849wes.5 for ; Mon, 22 Sep 2014 03:16:19 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <541FF6F2.6040605@redhat.com> Date: Mon, 22 Sep 2014 12:16:18 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411377623-11420-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1411377623-11420-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] docs: add blkdebug block driver documentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , John Snow , Max Reitz Il 22/09/2014 11:20, Stefan Hajnoczi ha scritto: > The blkdebug block driver is undocumented. Documenting it is worthwhile > since it offers powerful error injection features that are used by > qemu-iotests test cases. > > This document will make it easier for people to learn about and use > blkdebug. Just one small comment below... > Signed-off-by: Stefan Hajnoczi > --- > docs/blkdebug.txt | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 142 insertions(+) > create mode 100644 docs/blkdebug.txt > > diff --git a/docs/blkdebug.txt b/docs/blkdebug.txt > new file mode 100644 > index 0000000..7e616e0 > --- /dev/null > +++ b/docs/blkdebug.txt > @@ -0,0 +1,142 @@ > +Block I/O error injection using blkdebug > +---------------------------------------- > +The blkdebug block driver is a rule-based error injection engine. It can be > +used to exercise error code paths in block drivers including ENOSPC (out of > +space) and EIO. > + > +This document gives an overview of the features available in blkdebug. > + > +Background > +---------- > +Block drivers have many error code paths that handle I/O errors. Image formats > +are especially complex since metadata I/O errors during cluster allocation or > +while updating tables happen halfway through request processing and require > +discipline to keep image files consistent. > + > +Error injection allows test cases to trigger I/O errors at specific points. > +This way, all error paths can be tested to make sure they are correct. > + > +Rules > +----- > +The blkdebug block driver takes a list of "rules" that tell the error injection > +engine when to fail an I/O request. > + > +Each I/O request is evaluated against the rules. If a rule matches the request > +then its "action" is executed. > + > +Rules can be placed in a .ini file: Rules can be placed in a configuration file; the configuration file follows the same .ini-like format used by QEMU's -readconfig option, and each section of the file represents a rule. The following configuration file defines a single rule: > > + > + $ cat blkdebug.conf > + [inject-error] > + event = "read_aio" > + errno = "28" > + Paolo