From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, marc.mari.barcelo@gmail.com, mst@redhat.com,
armbru@redhat.com, stefanha@redhat.com, pbonzini@redhat.com,
John Snow <jsnow@redhat.com>
Subject: [Qemu-devel] [PATCH 5/5] qtest/ahci: add flush migrate test
Date: Tue, 24 Feb 2015 12:38:18 -0500 [thread overview]
Message-ID: <1424799498-1916-6-git-send-email-jsnow@redhat.com> (raw)
In-Reply-To: <1424799498-1916-1-git-send-email-jsnow@redhat.com>
Use blkdebug to inject an error on first flush, then attempt to flush
on the first guest. When the error halts the VM, migrate to the
second VM, and attempt to resume the command.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/ahci-test.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index ec3e49e..1e568f5 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -1043,7 +1043,7 @@ static void test_flush_retry(void)
debug_path,
tmp_path);
- /* Issue Flush Command */
+ /* Issue Flush Command and wait for error */
port = ahci_port_select(ahci);
ahci_port_clear(ahci, port);
cmd = ahci_command_create(CMD_FLUSH_CACHE);
@@ -1130,6 +1130,56 @@ static void test_migrate_dma(void)
g_free(tx);
}
+/**
+ * Migration test: Try to flush, migrate, then resume.
+ */
+static void test_flush_migrate(void)
+{
+ AHCIQState *src, *dst;
+ AHCICommand *cmd;
+ uint8_t px;
+ const char *s;
+
+ prepare_blkdebug_script(debug_path, "flush_to_disk");
+
+ src = ahci_boot_and_enable("-drive file=blkdebug:%s:%s,if=none,id=drive0,"
+ "cache=writeback,rerror=stop,werror=stop "
+ "-M q35 "
+ "-device ide-hd,drive=drive0 ",
+ debug_path, tmp_path);
+ dst = ahci_boot("-drive file=blkdebug:%s:%s,if=none,id=drive0,"
+ "cache=writeback,rerror=stop,werror=stop "
+ "-M q35 "
+ "-device ide-hd,drive=drive0 "
+ "-incoming tcp:127.0.0.1:1234", debug_path, tmp_path);
+
+ set_context(src->parent);
+
+ /* Issue Flush Command */
+ px = ahci_port_select(src);
+ ahci_port_clear(src, px);
+ cmd = ahci_command_create(CMD_FLUSH_CACHE);
+ ahci_command_commit(src, cmd, px);
+ ahci_command_issue_async(src, cmd);
+ qmp_eventwait("STOP");
+
+ /* Migrate over */
+ ahci_migrate(src, dst);
+ set_context(dst->parent);
+ verify_state(dst);
+
+ /* Complete the command */
+ s = "{'execute':'cont' }";
+ qmp_async(s);
+ qmp_eventwait("RESUME");
+ ahci_command_wait(dst, cmd);
+ ahci_command_verify(dst, cmd);
+
+ ahci_command_free(cmd);
+ ahci_shutdown(src);
+ ahci_shutdown(dst);
+}
+
/******************************************************************************/
/* AHCI I/O Test Matrix Definitions */
@@ -1377,6 +1427,7 @@ int main(int argc, char **argv)
qtest_add_func("/ahci/flush/simple", test_flush);
qtest_add_func("/ahci/flush/retry", test_flush_retry);
+ qtest_add_func("/ahci/flush/migrate", test_flush_migrate);
qtest_add_func("/ahci/migrate/sanity", test_migrate_sanity);
qtest_add_func("/ahci/migrate/dma", test_migrate_dma);
--
1.9.3
next prev parent reply other threads:[~2015-02-24 17:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 17:38 [Qemu-devel] [PATCH 0/5] ahci: enable migration John Snow
2015-02-24 17:38 ` [Qemu-devel] [PATCH 1/5] libqos: Add migration helpers John Snow
2015-02-24 17:38 ` [Qemu-devel] [PATCH 2/5] ich9/ahci: Enable Migration John Snow
2015-02-24 17:38 ` [Qemu-devel] [PATCH 3/5] qtest/ahci: Add migration test John Snow
2015-02-24 17:38 ` [Qemu-devel] [PATCH 4/5] qtest/ahci: add migrate dma test John Snow
2015-02-24 17:38 ` John Snow [this message]
2015-02-24 17:55 ` [Qemu-devel] [PATCH 0/5] ahci: enable migration John Snow
2015-02-26 13:23 ` Paolo Bonzini
2015-02-26 18:20 ` John Snow
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=1424799498-1916-6-git-send-email-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=marc.mari.barcelo@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).