summaryrefslogtreecommitdiff
path: root/tests/ide-test.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-10-01 10:59:55 +0200
committerMarkus Armbruster <armbru@redhat.com>2015-10-09 15:25:57 +0200
commit5fb48d9673b76fc53507a0e717a12968e57d846e (patch)
treef6db5219a6874465f6a9556544b33fd7442ba30f /tests/ide-test.c
parent82b15c7bdbda6207d1fee2ec824432e64af3ecb4 (diff)
downloadqemu-5fb48d9673b76fc53507a0e717a12968e57d846e.tar.gz
libqtest: New hmp() & friends
New convenience function hmp() to facilitate use of human-monitor-command in tests. Use it to simplify its existing uses. To blend into existing libqtest code, also add qtest_hmpv() and qtest_hmp(). That, and the egregiously verbose GTK-Doc comment format make this patch look bigger than it is. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1443689999-12182-7-git-send-email-armbru@redhat.com>
Diffstat (limited to 'tests/ide-test.c')
-rw-r--r--tests/ide-test.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/ide-test.c b/tests/ide-test.c
index b6e9e1a232..d1014bbc46 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -510,9 +510,7 @@ static void test_flush(void)
tmp_path);
/* Delay the completion of the flush request until we explicitly do it */
- qmp_discard_response("{'execute':'human-monitor-command', 'arguments': {"
- " 'command-line':"
- " 'qemu-io ide0-hd0 \"break flush_to_os A\"'} }");
+ g_free(hmp("qemu-io ide0-hd0 \"break flush_to_os A\""));
/* FLUSH CACHE command on device 0*/
outb(IDE_BASE + reg_device, 0);
@@ -524,9 +522,7 @@ static void test_flush(void)
assert_bit_clear(data, DF | ERR | DRQ);
/* Complete the command */
- qmp_discard_response("{'execute':'human-monitor-command', 'arguments': {"
- " 'command-line':"
- " 'qemu-io ide0-hd0 \"resume A\"'} }");
+ g_free(hmp("qemu-io ide0-hd0 \"resume A\""));
/* Check registers */
data = inb(IDE_BASE + reg_device);