summaryrefslogtreecommitdiffstats
path: root/tests/ide-test.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2015-04-28 15:27:51 -0400
committerJohn Snow <jsnow@redhat.com>2015-04-28 15:27:51 -0400
commit72c85e949fd162b039614d588d94393ff3e2dae3 (patch)
treec858b329c3c75849924a3a5ff9ae1de5d0432b44 /tests/ide-test.c
parentba4ed39346c1bdbfefd1d781b39009f90822b956 (diff)
downloadhqemu-72c85e949fd162b039614d588d94393ff3e2dae3.zip
hqemu-72c85e949fd162b039614d588d94393ff3e2dae3.tar.gz
libqos: add blkdebug_prepare_script
Pull this helper out of ide-test and into libqos, to be shared with ahci-test. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1426018503-821-6-git-send-email-jsnow@redhat.com
Diffstat (limited to 'tests/ide-test.c')
-rw-r--r--tests/ide-test.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/tests/ide-test.c b/tests/ide-test.c
index 1dae84f..78382e9 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -29,6 +29,7 @@
#include <glib.h>
#include "libqtest.h"
+#include "libqos/libqos.h"
#include "libqos/pci-pc.h"
#include "libqos/malloc-pc.h"
@@ -494,28 +495,6 @@ static void test_flush(void)
ide_test_quit();
}
-static void prepare_blkdebug_script(const char *debug_fn, const char *event)
-{
- FILE *debug_file = fopen(debug_fn, "w");
- int ret;
-
- fprintf(debug_file, "[inject-error]\n");
- fprintf(debug_file, "event = \"%s\"\n", event);
- fprintf(debug_file, "errno = \"5\"\n");
- fprintf(debug_file, "state = \"1\"\n");
- fprintf(debug_file, "immediately = \"off\"\n");
- fprintf(debug_file, "once = \"on\"\n");
-
- fprintf(debug_file, "[set-state]\n");
- fprintf(debug_file, "event = \"%s\"\n", event);
- fprintf(debug_file, "new_state = \"2\"\n");
- fflush(debug_file);
- g_assert(!ferror(debug_file));
-
- ret = fclose(debug_file);
- g_assert(ret == 0);
-}
-
static void test_retry_flush(const char *machine)
{
uint8_t data;
OpenPOWER on IntegriCloud