qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] docs: add blkdebug block driver documentation
Date: Wed, 24 Sep 2014 10:40:46 +0100	[thread overview]
Message-ID: <20140924094046.GF21137@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <5421AA14.9060709@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2679 bytes --]

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.
> 
> 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 are about
> > +to make so rules can match specific types of requests.  For example, the 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 metadata)
> > +
> > +  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
> 
> 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 request 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 state
> > +transitions come in.
> > +
> > +The error injection engine has an integer called the "state" that always starts
> > +initialized to 1.  Rules can be conditional on the state and they can
> > +transition to a new state.
> 
> 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 = "write_aio"
> > +  state = "1"
> > +  new_state = "2"
> > +
> > +  [inject-error]
> > +  event = "write_aio"
> > +  state = "2"
> > +  errno = "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 now
> 
> 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".

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2014-09-24  9:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 10:09 [Qemu-devel] [PATCH v2] docs: add blkdebug block driver documentation Stefan Hajnoczi
2014-09-23 17:12 ` Eric Blake
2014-09-24  9:40   ` Stefan Hajnoczi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140924094046.GF21137@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).