From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHZQQ-0005MZ-T2 for qemu-devel@nongnu.org; Wed, 13 Aug 2014 10:21:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHZQN-00073K-10 for qemu-devel@nongnu.org; Wed, 13 Aug 2014 10:21:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHZQM-00072v-PA for qemu-devel@nongnu.org; Wed, 13 Aug 2014 10:21:10 -0400 Message-ID: <53EB7445.4050300@redhat.com> Date: Wed, 13 Aug 2014 08:20:53 -0600 From: Eric Blake MIME-Version: 1.0 References: <1407905321-10219-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp> In-Reply-To: <1407905321-10219-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AlUBhodXo9618F782qHG4k7Cs4KXEMtv6" Subject: Re: [Qemu-devel] [PATCH RFC] blkdebug: make the fault injection functionality callable from QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hitoshi Mitake , qemu-devel@nongnu.org Cc: Kevin Wolf , mitake.hitoshi@gmail.com, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AlUBhodXo9618F782qHG4k7Cs4KXEMtv6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/12/2014 10:48 PM, Hitoshi Mitake wrote: > This patch makes the fault injection functionality of blkdebug > callable from QMP. Motivation of this change is for testing and > debugging distributed systems. Ordinal distributed systems must handle > hardware faults because of its reason for existence, but testing > whether the systems can hanle such faults and recover in a correct > manner is really hard. >=20 >=20 > {"execute": "set-block-fault-state", "arguments": {"id": "ide0-hd0", > "state": "error"}} # <- inject error to /dev/sda > {"return": {}} >=20 Sounds interesting. > Now the guest OS on the VM finds the disk is broken. >=20 > Of course, using QMP directly is painful for users (developers and > admins of distributed systems). I'm implementing user friendly > interface in vagrant-kvm [4] for blackbox testing. In addition, a > testing framework for injecting faults at critical timing (which > requires solid understanding of target systems) is in progress. >=20 > [1] http://ucare.cs.uchicago.edu/pdf/socc13-limplock.pdf > [2] http://docs.openstack.org/developer/swift/howto_installmultinode.ht= ml > [3] http://www.amazon.com/dp/B00C93QFHI > [4] https://github.com/adrahon/vagrant-kvm >=20 > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Signed-off-by: Hitoshi Mitake > --- > +++ b/qapi-schema.json > @@ -3481,3 +3481,42 @@ > # Since: 2.1 > ## > { 'command': 'rtc-reset-reinjection' } > + > +## > +# @BlockFaultState: > +# > +# Injected fault state for a block device. > +# > +# @none: no fault > +# > +# @error: visible error > +# Needs a Since: 2.2 line, as well as the ## trailing marker. > +{ 'enum': 'BlockFaultState', 'data': [ 'none', 'error' ] } > + > +## > +# @query-block-fault-state: > +# > +# Return block fault state information for the given block device. > +# > +# @name: name of block device > +# > +# Returns: @BlockFaultState of a block device. > +# > +# Since: 1.6 s/1.6/2.2/ Personally, I think this command is overkill. Just enhance the existing query-block to output the fault state alongside everything else it already does. There's no need to add a new command that outputs a subset of the existing command. > +## > +{ 'command': 'query-block-fault-state', 'data': { 'id': 'str' }, > + 'returns': 'BlockFaultState' } > +## > +# @set-block-fault-state: > +# > +# Set fault state for the given block device. > +# > +# @name: the chardev's ID, must exist and not be in use > +# @state: fault state > +# > +# Returns: Nothing on success > +# > +# Since: 1.6 s/1.6/2.2/ > +## > +{ 'command': 'set-block-fault-state', 'data': {'id': 'str', > + 'state': 'BlockFaultState' }} > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 4be4765..96ae7e2 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -3755,3 +3755,27 @@ Example: > <- { "return": {} } > =20 > EQMP > + { > + .name =3D "query-block-fault-state", > + .args_type =3D "id:s", > + .mhandler.cmd_new =3D qmp_marshal_input_query_block_fault_stat= e, > + }, > + > +SQMP > +query-block-fault-state > +----------------------- > + > +Show block fault information. > + > +EQMP > + { > + .name =3D "set-block-fault-state", > + .args_type =3D "id:s,state:q", > + .mhandler.cmd_new =3D qmp_marshal_input_set_block_fault_state,= > + }, > + > +SQMP > +set-block-fault-state > +----------------------- > + > +Set block fault information. >=20 It would be nice to include an example section for the new command(s) (well, I argue that only one new command is needed). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --AlUBhodXo9618F782qHG4k7Cs4KXEMtv6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT63RFAAoJEKeha0olJ0Nqv+QH/2wr950TPVYJJRnTlRPxZQg5 tbmmaoBIjTGc+QQWK+g2M5BiYPSzuGk883ra8ymdD10LvW7CTBV0O+gpKn3eKPUL 4SJkJN8iqjqknf4GPrbU7q1tJABRD2pXqf+DMM2nHTQOojUIWNM4UiYcKPPTJlzM 1mQ/83C1G46U0I4lCzfHk8KjUVp/+o9pp2aPq5clesENVHW03zVjlhlnO0ziZBui SLmlOWjaaUW5OoBcrtijlOqTCvEMhQqJflqZRMmqFIT7bEOS0kcJyGzJkryVUCJp jtedTAlSpAXmMJfuAarLazjF0Q2wTwwgECfj0+jxB8lsgcbIZvJyeILUk34fnBI= =by8+ -----END PGP SIGNATURE----- --AlUBhodXo9618F782qHG4k7Cs4KXEMtv6--