From: Damien Hedde <damien.hedde@greensocs.com>
To: qemu-devel@nongnu.org
Cc: Damien Hedde <damien.hedde@greensocs.com>,
ehabkost@redhat.com, mark.burton@greensocs.com,
armbru@redhat.com, sakisp@xilinx.com, edgari@xilinx.com,
crosa@redhat.com, pbonzini@redhat.com, luc.michel@greensocs.com,
rth@twiddle.net
Subject: [Qemu-devel] [RFC PATCH 0/5] FAULT INJECTION FRAMEWORK
Date: Fri, 28 Jun 2019 14:45:29 +0200 [thread overview]
Message-ID: <20190628124534.10679-1-damien.hedde@greensocs.com> (raw)
Hi all,
This series adds a python framework aiming to provide some ways to do fault
injection in a running vm. In its current state, it allows to easily interact
with memory, change gpios and qom properties.
The framework consists in a python script based on the qmp existing module
which allows to interact with the vm.
The series introduces a QMP command to schedule some virtual-clock-time-based
notifications. The notification is sent back to the python framework and can
be used to build time-driven fault scenario.
Additionaly the series adds some new QMP commands:
Commands are added to read/write memory or memory-mapped registers. Arguments
are similar to the existing [p]memsave commands.
A command is added to set a value to a qdev gpio.
Here's is a simple visual example which inject characters on the uart output
of the zynq platform:
$ # qemu must have been launched with -qmp unix:/tmp/qmpsock,server
$ # create the python framework object
$ import fault_injection
$ inj = fault_injection.FaultInjectionFramework("/tmp/qmpsock", 0)
$
$ # function which display a 'X' to the first uart
$ # it access directly the register using the physical address
$ def cb():
$ inj.write_pmem(0xe0000030,4, 88)
$
$ # schedule the function on a notification in 10s
$ inj.notify(10 * 1000 * 1000 * 1000, cb, True)
$
$ # handle one notification
$ inj.run_once()
The framework has been tested using python 2, on qemu running xilinx_zynq or
virt arm machines.
The series is organised as follows. Patches 1 and 2 adds the memory qmp and
gpio commands. Patch 3 adds the notification mechanism. Patches 4 and 5 add
a python helper module and some documention.
Thanks to the Xilinx's QEMU team who sponsored this work.
Damien Hedde (5):
introduce [p]mem(read|write) qmp commands
introduce a qmp command to set gpios
add qmp time-notify event triggering system
fault_injection: introduce Python scripting framework
docs: add fault injection framework documentation
cpus.c | 126 +++++++++++++++
docs/fault_injection.txt | 149 ++++++++++++++++++
monitor/Makefile.objs | 1 +
monitor/qmp-cmd-time-notify.c | 116 ++++++++++++++
monitor/qmp-cmds.c | 30 ++++
monitor/trace-events | 4 +
qapi/misc.json | 196 +++++++++++++++++++++++
scripts/qmp/fault_injection.py | 278 +++++++++++++++++++++++++++++++++
8 files changed, 900 insertions(+)
create mode 100644 docs/fault_injection.txt
create mode 100644 monitor/qmp-cmd-time-notify.c
create mode 100644 scripts/qmp/fault_injection.py
--
2.22.0
next reply other threads:[~2019-06-28 13:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 12:45 Damien Hedde [this message]
2019-06-28 12:45 ` [Qemu-devel] [RFC PATCH 1/5] introduce [p]mem(read|write) qmp commands Damien Hedde
2019-06-28 12:45 ` [Qemu-devel] [RFC PATCH 2/5] introduce a qmp command to set gpios Damien Hedde
2019-06-28 12:45 ` [Qemu-devel] [RFC PATCH 3/5] add qmp time-notify event triggering system Damien Hedde
2019-06-28 12:45 ` [Qemu-devel] [RFC PATCH 4/5] fault_injection: introduce Python scripting framework Damien Hedde
2019-06-28 12:45 ` [Qemu-devel] [RFC PATCH 5/5] docs: add fault injection framework documentation Damien Hedde
2019-07-01 8:37 ` [Qemu-devel] [RFC PATCH 0/5] FAULT INJECTION FRAMEWORK Stefan Hajnoczi
2019-07-01 10:16 ` Philippe Mathieu-Daudé
2019-07-03 9:29 ` Stefan Hajnoczi
2019-07-03 15:47 ` Damien Hedde
2019-07-09 13:42 ` Stefan Hajnoczi
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=20190628124534.10679-1-damien.hedde@greensocs.com \
--to=damien.hedde@greensocs.com \
--cc=armbru@redhat.com \
--cc=crosa@redhat.com \
--cc=edgari@xilinx.com \
--cc=ehabkost@redhat.com \
--cc=luc.michel@greensocs.com \
--cc=mark.burton@greensocs.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sakisp@xilinx.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).