From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpwgt-00013W-Ge for qemu-devel@nongnu.org; Fri, 30 Sep 2016 08:13:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpwgo-0007Lt-9k for qemu-devel@nongnu.org; Fri, 30 Sep 2016 08:13:22 -0400 From: Fam Zheng Date: Fri, 30 Sep 2016 20:09:59 +0800 Message-Id: <1475237406-26917-30-git-send-email-famz@redhat.com> In-Reply-To: <1475237406-26917-1-git-send-email-famz@redhat.com> References: <1475237406-26917-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v8 29/36] ahci: Use shared lock for shared storage migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: berrange@redhat.com, John Snow , qemu-block@nongnu.org, Kevin Wolf , rjones@redhat.com, Jeff Cody , Max Reitz , Markus Armbruster , stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com Signed-off-by: Fam Zheng --- tests/ahci-test.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 9c0adce..838ff45 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1132,10 +1132,14 @@ static void test_migrate_sanity(void) char *uri = g_strdup_printf("unix:%s", mig_socket); src = ahci_boot("-m 1024 -M q35 " - "-drive if=ide,file=%s,format=%s ", tmp_path, imgfmt); + "-drive if=none,id=drive0,file=%s,format=%s " + "-device ide-hd,drive=drive0,lock-mode=shared ", + tmp_path, imgfmt); dst = ahci_boot("-m 1024 -M q35 " - "-drive if=ide,file=%s,format=%s " - "-incoming %s", tmp_path, imgfmt, uri); + "-drive if=none,id=drive0,file=%s,format=%s " + "-device ide-hd,drive=drive0,lock-mode=shared " + "-incoming %s", + tmp_path, imgfmt, uri); ahci_migrate(src, dst, uri); @@ -1157,11 +1161,14 @@ static void ahci_migrate_simple(uint8_t cmd_read, uint8_t cmd_write) char *uri = g_strdup_printf("unix:%s", mig_socket); src = ahci_boot_and_enable("-m 1024 -M q35 " - "-drive if=ide,format=%s,file=%s ", + "-drive if=none,format=%s,file=%s,id=drive0 " + "-device ide-hd,drive=drive0,lock-mode=shared ", imgfmt, tmp_path); dst = ahci_boot("-m 1024 -M q35 " - "-drive if=ide,format=%s,file=%s " - "-incoming %s", imgfmt, tmp_path, uri); + "-drive if=none,format=%s,file=%s,id=drive0 " + "-device ide-hd,drive=drive0,lock-mode=shared " + "-incoming %s", + imgfmt, tmp_path, uri); set_context(src->parent); @@ -1286,7 +1293,7 @@ static void ahci_migrate_halted_io(uint8_t cmd_read, uint8_t cmd_write) "format=%s,cache=writeback," "rerror=stop,werror=stop " "-M q35 " - "-device ide-hd,drive=drive0 ", + "-device ide-hd,drive=drive0,lock-mode=shared ", debug_path, tmp_path, imgfmt); @@ -1294,7 +1301,7 @@ static void ahci_migrate_halted_io(uint8_t cmd_read, uint8_t cmd_write) "format=%s,cache=writeback," "rerror=stop,werror=stop " "-M q35 " - "-device ide-hd,drive=drive0 " + "-device ide-hd,drive=drive0,lock-mode=shared " "-incoming %s", tmp_path, imgfmt, uri); @@ -1358,13 +1365,13 @@ static void test_flush_migrate(void) "cache=writeback,rerror=stop,werror=stop," "format=%s " "-M q35 " - "-device ide-hd,drive=drive0 ", + "-device ide-hd,drive=drive0,lock-mode=shared ", debug_path, tmp_path, imgfmt); dst = ahci_boot("-drive file=%s,if=none,id=drive0," "cache=writeback,rerror=stop,werror=stop," "format=%s " "-M q35 " - "-device ide-hd,drive=drive0 " + "-device ide-hd,drive=drive0,lock-mode=shared " "-incoming %s", tmp_path, imgfmt, uri); set_context(src->parent); -- 2.7.4