[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/12] qemu-io: add "abort" command to simulate prog
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 09/12] qemu-io: add "abort" command to simulate program crash |
Date: |
Mon, 6 Aug 2012 22:44:48 +0200 |
From: Stefan Hajnoczi <address@hidden>
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>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-io.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
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.6.5
- [Qemu-devel] [PULL 00/12] Block patches, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 01/12] ide scsi: Mess with geometry only for hard disk devices, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 02/12] qapi: generalize documentation of streaming commands, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 03/12] qemu-iotests: add qed.py image manipulation utility, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 04/12] docs: add dirty bit to qcow2 specification, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 05/12] qcow2: introduce dirty bit, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 06/12] docs: add lazy refcounts bit to qcow2 specification, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 07/12] qemu-iotests: ignore qemu-img create lazy_refcounts output, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 09/12] qemu-io: add "abort" command to simulate program crash,
Kevin Wolf <=
- [Qemu-devel] [PATCH 08/12] qcow2: implement lazy refcounts, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 11/12] qemu-iotests: Be more flexible with image creation options, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 10/12] qemu-iotests: add 039 qcow2 lazy refcounts test, Kevin Wolf, 2012/08/06
- [Qemu-devel] [PATCH 12/12] qemu-img: use QemuOpts instead of QEMUOptionParameter in resize function, Kevin Wolf, 2012/08/06
- Re: [Qemu-devel] [PULL 00/12] Block patches, Paolo Bonzini, 2012/08/07
- Re: [Qemu-devel] [PULL 00/12] Block patches, Anthony Liguori, 2012/08/07