From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Khoa Huynh <khoa@us.ibm.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH v3 6/7] qemu-io: add "abort" command to simulate program crash
Date: Fri, 27 Jul 2012 09:05:23 +0100 [thread overview]
Message-ID: <1343376324-19458-7-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1343376324-19458-1-git-send-email-stefanha@linux.vnet.ibm.com>
Avoiding data loss and corruption is the top requirement for image file
formats. The qemu-io "abort" command makes it possible to simulate
program crashes and does not give the image format a chance to cleanly
shut down. This command is useful for data integrity test cases.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
qemu-io.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/qemu-io.c b/qemu-io.c
index 8f3b94b..d0f4fb7 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1652,6 +1652,17 @@ static const cmdinfo_t map_cmd = {
.oneline = "prints the allocated areas of a file",
};
+static int abort_f(int argc, char **argv)
+{
+ abort();
+}
+
+static const cmdinfo_t abort_cmd = {
+ .name = "abort",
+ .cfunc = abort_f,
+ .flags = CMD_NOFILE_OK,
+ .oneline = "simulate a program crash using abort(3)",
+};
static int close_f(int argc, char **argv)
{
@@ -1905,6 +1916,7 @@ int main(int argc, char **argv)
add_command(&discard_cmd);
add_command(&alloc_cmd);
add_command(&map_cmd);
+ add_command(&abort_cmd);
add_args_command(init_args_command);
add_check_command(init_check_command);
--
1.7.10.4
next prev parent reply other threads:[~2012-07-27 8:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 8:05 [Qemu-devel] [PATCH v3 0/7] qcow2: implement lazy refcounts optimization Stefan Hajnoczi
2012-07-27 8:05 ` [Qemu-devel] [PATCH v3 1/7] docs: add dirty bit to qcow2 specification Stefan Hajnoczi
2012-07-27 8:05 ` [Qemu-devel] [PATCH v3 2/7] qcow2: introduce dirty bit Stefan Hajnoczi
2012-07-27 8:05 ` [Qemu-devel] [PATCH v3 3/7] docs: add lazy refcounts bit to qcow2 specification Stefan Hajnoczi
2012-07-27 8:05 ` [Qemu-devel] [PATCH v3 4/7] qemu-iotests: ignore qemu-img create lazy_refcounts output Stefan Hajnoczi
2012-07-27 8:05 ` [Qemu-devel] [PATCH v3 5/7] qcow2: implement lazy refcounts Stefan Hajnoczi
2012-07-27 8:05 ` Stefan Hajnoczi [this message]
2012-07-27 8:05 ` [Qemu-devel] [PATCH v3 7/7] qemu-iotests: add 039 qcow2 lazy refcounts test Stefan Hajnoczi
2012-07-27 13:30 ` Kevin Wolf
2012-07-30 10:21 ` 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=1343376324-19458-7-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=khoa@us.ibm.com \
--cc=kwolf@redhat.com \
--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).