From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWj4M-0003xc-QK for qemu-devel@nongnu.org; Wed, 24 Sep 2014 05:41:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWj4D-0006rD-K9 for qemu-devel@nongnu.org; Wed, 24 Sep 2014 05:41:06 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:57732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWj4D-0006qM-D4 for qemu-devel@nongnu.org; Wed, 24 Sep 2014 05:40:57 -0400 Received: by mail-wi0-f178.google.com with SMTP id z2so6822064wiv.11 for ; Wed, 24 Sep 2014 02:40:51 -0700 (PDT) Date: Wed, 24 Sep 2014 10:40:46 +0100 From: Stefan Hajnoczi Message-ID: <20140924094046.GF21137@stefanha-thinkpad.redhat.com> References: <1411466956-19801-1-git-send-email-stefanha@redhat.com> <5421AA14.9060709@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tmoQ0UElFV5VgXgH" Content-Disposition: inline In-Reply-To: <5421AA14.9060709@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] docs: add blkdebug block driver documentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Paolo Bonzini , John Snow --tmoQ0UElFV5VgXgH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 23, 2014 at 11:12:52AM -0600, Eric Blake wrote: > On 09/23/2014 04:09 AM, Stefan Hajnoczi wrote: > > +Rules support the following attributes: > > + > > + event - which type of operation to match (e.g. read_aio, write_aio, > > + flush_to_os, flush_to_disk). See the "Events" section for > > + information on events. >=20 > TAB vs space damage? Yes, thanks for spotting it. Fixed in v3. > > +Events > > +------ > > +Block drivers provide information about the type of I/O request they a= re about > > +to make so rules can match specific types of requests. For example, t= he qcow2 > > +block driver tells blkdebug when it accesses the L1 table so rules can= match > > +only L1 table accesses and not other metadata or guest data requests. > > + > > +The core events are: > > + > > + read_aio - guest data read > > + > > + write_aio - guest data write > > + > > + flush_to_os - write out unwritten block driver state (e.g. cached me= tadata) > > + > > + flush_to_disk - flush the host block device's disk cache > > + > > +See block/blkdebug.c:event_names[] for the list of available events. = You may >=20 > s/available events/additional available events/ ? I'll say "for the full list of events" since event_names[] includes everything. > > +State transitions > > +----------------- > > +There are cases where more power is needed to match a particular I/O r= equest in > > +a longer sequence of requests. For example: > > + > > + write_aio > > + flush_to_disk > > + write_aio > > + > > +How do we match the 2nd write_aio but not the first? This is where st= ate > > +transitions come in. > > + > > +The error injection engine has an integer called the "state" that alwa= ys starts > > +initialized to 1. Rules can be conditional on the state and they can > > +transition to a new state. >=20 > Is the current state of the engine in a running guest introspectible, > such as through 'query-block'? No. > > + > > +For example, to match the 2nd write_aio: > > + > > + [set-state] > > + event =3D "write_aio" > > + state =3D "1" > > + new_state =3D "2" > > + > > + [inject-error] > > + event =3D "write_aio" > > + state =3D "2" > > + errno =3D "5" > > + > > +The first write_aio request matches the set-state rule and transitions= from > > +state 0 to state 1. Once state 1 has been entered, the set-state rule= no > > +longer matches since it required state 0. But the inject-error rule n= ow >=20 > state 0/1 or state 1/2 ? Thanks for catching this, I should explain the difference between state 0 and 1. This was a mistake because I original used "0" but it actually has to be "1". --tmoQ0UElFV5VgXgH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUIpGeAAoJEJykq7OBq3PIhJQIAJN/Ez8lM9RJSMfbrUyxzDW+ Nx73Wlb8Ca9VjKbJ+T0vpTPXxky8ORNnRVTcz+n5G0gSjF1z6Ut7s7S1P4oZYvU8 PVRvFaPlocxIKEblor2WR/Kr54hzBIvS3wZDdaRFq5x3vJF8JSRMKZFVgWXkmS4+ A5FpsoqgVQ1rCUsj5mGh1DI/Cyv06BeUtEg445g9FvOBi9cnyZFQZt8T7Fj5hRP9 7RSX46qDLrdLpObvCgA39G/UOLch4nN6klkK2T8F6JevqOz5LfAQkBJXcTLrlZ82 nZ0quvn73xMQJe9woiBa5suoLzDVenqSYTE+WdU6MQk3cCGYlaYWjRmPYqgONmY= =iERT -----END PGP SIGNATURE----- --tmoQ0UElFV5VgXgH--