[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 6/7] qemu-io: add "abort" command to simulate program
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [RFC 6/7] qemu-io: add "abort" command to simulate program crash |
Date: |
Fri, 22 Jun 2012 16:08:45 +0100 |
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 <address@hidden>
---
qemu-io.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/qemu-io.c b/qemu-io.c
index 5882067..b6bf0bd 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1648,6 +1648,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)
{
@@ -1901,6 +1912,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
- [Qemu-devel] [RFC 5/7] qcow2: implement lazy refcounts, (continued)
- [Qemu-devel] [RFC 5/7] qcow2: implement lazy refcounts, Stefan Hajnoczi, 2012/06/22
- [Qemu-devel] [RFC 2/7] qcow2: introduce dirty bit, Stefan Hajnoczi, 2012/06/22
- [Qemu-devel] [RFC 1/7] docs: add dirty bit to qcow2 specification, Stefan Hajnoczi, 2012/06/22
- [Qemu-devel] [RFC 4/7] qemu-iotests: ignore qemu-img create lazy_refcounts output, Stefan Hajnoczi, 2012/06/22
- [Qemu-devel] [RFC 7/7] qemu-iotests: add 039 qcow2 lazy refcounts test, Stefan Hajnoczi, 2012/06/22
- [Qemu-devel] [RFC 6/7] qemu-io: add "abort" command to simulate program crash,
Stefan Hajnoczi <=
- [Qemu-devel] [RFC 3/7] docs: add lazy refcounts bit to qcow2 specification, Stefan Hajnoczi, 2012/06/22
- Re: [Qemu-devel] [RFC 0/7] qcow2: implement lazy refcounts optimization, Zhi Yong Wu, 2012/06/25