qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, mitake.hitoshi@gmail.com
Subject: Re: [Qemu-devel] [PATCH RFC] blkdebug: make the fault injection functionality callable from QMP
Date: Wed, 13 Aug 2014 15:33:38 +0100	[thread overview]
Message-ID: <20140813143338.GD4750@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1407905321-10219-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp>

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

On Wed, Aug 13, 2014 at 01:48:41PM +0900, Hitoshi Mitake wrote:
> @@ -485,6 +493,10 @@ static BlockDriverAIOCB *blkdebug_aio_readv(BlockDriverState *bs,
>      BDRVBlkdebugState *s = bs->opaque;
>      BlkdebugRule *rule = NULL;
>  
> +    if (s->qmp_fault_state != BLOCK_FAULT_STATE_NONE) {
> +        return inject_error(bs, cb, opaque, rule);
> +    }
> +
>      QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {
>          if (rule->options.inject.sector == -1 ||
>              (rule->options.inject.sector >= sector_num &&

A QMP command is a good idea but the hardcoded s->qmp_fault_state error
injection is much less powerful than the rules that blkdebug already
supports.

Can you make the QMP command take a list of rules instead of setting
s->qmp_fault_state?

For example:

  # Clear all rules
  blkdebug-set-rules drive0 []

  # Return EIO on disk flush after L1 update
  blkdebug-set-rules drive0 [
    {"type": "set-state",
     "event": "BLKDBG_L1_UPDATE",
     "state": 0,
     "new-state" 1}
    {"type": "inject-error",
     "state": 1,
     "event": "BLKDBG_FLUSH_TO_DISK",
     "errno": "EIO",
     "once": true},
  ]

In other words, instead of adding a new (more limited) mechanism for
triggering error injection, please make the QMP command install a list
of blkdebug rules.

Stefan

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

  parent reply	other threads:[~2014-08-13 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  4:48 [Qemu-devel] [PATCH RFC] blkdebug: make the fault injection functionality callable from QMP Hitoshi Mitake
2014-08-13 14:20 ` Eric Blake
2014-08-14  7:10   ` Hitoshi Mitake
2014-08-13 14:33 ` Stefan Hajnoczi [this message]
2014-08-14  7:13   ` Hitoshi Mitake

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=20140813143338.GD4750@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mitake.hitoshi@gmail.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=qemu-devel@nongnu.org \
    /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).