For the COLO test, both VMs will run in parallel. Thus both VMs want to open
the image read/write at the same time. Using read-only=on is not possible here,
because ide-hd does not support read-only backing image. And the image
won't boot with ide-cd.

As a workaround, use the '-snapshot' option where qemu will internally create
a writable snapshut while leaving the real image read-only.

Signed-off-by: Lukas Straub <[email protected]>
---
 tests/qtest/migration/framework.c | 4 +++-
 tests/qtest/migration/framework.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/migration/framework.c 
b/tests/qtest/migration/framework.c
index 
e35839c95f51d851a3fed8e8457ed2d7e927f59b..8c1fc6e009f16dc05a47e917167f62e0250ca992
 100644
--- a/tests/qtest/migration/framework.c
+++ b/tests/qtest/migration/framework.c
@@ -322,7 +322,9 @@ int migrate_args(char **from, char **to, const char *uri, 
MigrateStart *args)
         }
         arch_opts = g_strdup_printf(
             "-drive if=none,id=d0,file=%s,format=raw "
-            "-device ide-hd,drive=d0,secs=1,cyls=1,heads=1", bootpath);
+            "-device ide-hd,drive=d0,secs=1,cyls=1,heads=1 %s",
+            bootpath,
+            args->is_colo ? "-snapshot" : "");
         start_address = X86_TEST_MEM_START;
         end_address = X86_TEST_MEM_END;
     } else if (g_str_equal(arch, "s390x")) {
diff --git a/tests/qtest/migration/framework.h 
b/tests/qtest/migration/framework.h
index 
ed85ed502dd01aa809892b68d3934b5107bd3442..2ea13e7758697550b5531737e66d6d939dd800d1
 100644
--- a/tests/qtest/migration/framework.h
+++ b/tests/qtest/migration/framework.h
@@ -134,6 +134,7 @@ typedef struct {
     bool suspend_me;
     /* enable OOB QMP capability */
     bool oob;
+    bool is_colo;
 
     /* Do not connect to target monitor and qtest sockets in qtest_init */
     bool defer_target_connect;

-- 
2.39.5


Reply via email to