All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,
	Fabiano Rosas <farosas@suse.de>
Subject: [PULL 07/25] tests/functional/migration: Use the migrate_vms helper
Date: Tue, 10 Mar 2026 06:55:12 +0100	[thread overview]
Message-ID: <20260310055530.8893-8-thuth@redhat.com> (raw)
In-Reply-To: <20260310055530.8893-1-thuth@redhat.com>

From: Fabiano Rosas <farosas@suse.de>

Change do_migrate() to call the migrate_vms() helper and provide it
with the two VMs already created. Rename do_migrate -> migrate and
adjust the callers.

While here, standardize on the "src" and "dst" names.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20260303173320.10942-4-farosas@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/migration.py | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/tests/functional/migration.py b/tests/functional/migration.py
index 3362e5c743e..49347a30bbf 100644
--- a/tests/functional/migration.py
+++ b/tests/functional/migration.py
@@ -45,17 +45,19 @@ def migrate_vms(self, dst_uri, src_uri, dst_vm, src_vm):
         src_vm.qmp('migrate', uri=src_uri)
         self.assert_migration(src_vm, dst_vm)
 
-    def do_migrate(self, dest_uri, src_uri=None):
-        dest_vm = self.get_vm('-incoming', dest_uri, name="dest-qemu")
-        dest_vm.add_args('-nodefaults')
-        dest_vm.launch()
+    def migrate(self, dst_uri, src_uri=None):
+        dst_vm = self.get_vm('-incoming', 'defer', name="dst-qemu")
+        dst_vm.add_args('-nodefaults')
+        dst_vm.launch()
+
+        src_vm = self.get_vm(name="src-qemu")
+        src_vm.add_args('-nodefaults')
+        src_vm.launch()
+
         if src_uri is None:
-            src_uri = dest_uri
-        source_vm = self.get_vm(name="source-qemu")
-        source_vm.add_args('-nodefaults')
-        source_vm.launch()
-        source_vm.qmp('migrate', uri=src_uri)
-        self.assert_migration(source_vm, dest_vm)
+            src_uri = dst_uri
+
+        self.migrate_vms(dst_uri, src_uri, dst_vm, src_vm)
 
     def _get_free_port(self, ports):
         port = ports.find_free_port()
@@ -65,18 +67,18 @@ def _get_free_port(self, ports):
 
     def migration_with_tcp_localhost(self):
         with Ports() as ports:
-            dest_uri = 'tcp:localhost:%u' % self._get_free_port(ports)
-            self.do_migrate(dest_uri)
+            dst_uri = 'tcp:localhost:%u' % self._get_free_port(ports)
+            self.migrate(dst_uri)
 
     def migration_with_unix(self):
-        dest_uri = 'unix:%s/migration.sock' % self.socket_dir().name
-        self.do_migrate(dest_uri)
+        dst_uri = 'unix:%s/migration.sock' % self.socket_dir().name
+        self.migrate(dst_uri)
 
     def migration_with_exec(self):
         if not which('ncat'):
             self.skipTest('ncat is not available')
         with Ports() as ports:
             free_port = self._get_free_port(ports)
-            dest_uri = 'exec:ncat -l localhost %u' % free_port
+            dst_uri = 'exec:ncat -l localhost %u' % free_port
             src_uri = 'exec:ncat localhost %u' % free_port
-            self.do_migrate(dest_uri, src_uri)
+            self.migrate(dst_uri, src_uri)
-- 
2.53.0



  parent reply	other threads:[~2026-03-10  5:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10  5:55 [PULL 00/25] s390x & functional tests pull request for the softfreeze Thomas Huth
2026-03-10  5:55 ` [PULL 01/25] tests/qemu-iotests: Mark 182 as Linux-only Thomas Huth
2026-03-10  5:55 ` [PULL 02/25] tests/functional: Don't try to run functional tests on Windows Thomas Huth
2026-03-10  5:55 ` [PULL 03/25] tests/functional/ppc/test_40: Fix the URL of the NetBSD-7.1.2-prep.iso asset Thomas Huth
2026-03-19 17:41   ` Peter Maydell
2026-03-10  5:55 ` [PULL 04/25] tests/functional/x86_64: Disable memlock test for asan builds Thomas Huth
2026-03-10  5:55 ` [PULL 05/25] tests/functional/migration: Use socket_dir Thomas Huth
2026-03-10  5:55 ` [PULL 06/25] tests/functional/migration: Add migrate_vms Thomas Huth
2026-03-10  5:55 ` Thomas Huth [this message]
2026-03-10  5:55 ` [PULL 08/25] tests/functional/ppc64/pseries: Remove custom migration routine Thomas Huth
2026-03-10  5:55 ` [PULL 09/25] pc-bios/s390-ccw: Fix misattributed function prototypes Thomas Huth
2026-03-10  5:55 ` [PULL 10/25] pc-bios/s390-ccw: Remove redundant vring schid attribute Thomas Huth
2026-03-10  5:55 ` [PULL 11/25] pc-bios/s390-ccw: Always reset virtio device on failed boot attempt Thomas Huth
2026-03-10  5:55 ` [PULL 12/25] s390x: Remove duplicate definitions of IPL types Thomas Huth
2026-03-10  5:55 ` [PULL 13/25] pc-bios/s390-ccw: Store device type independent of sense data Thomas Huth
2026-03-10  5:55 ` [PULL 14/25] pc-bios/s390-ccw: Split virtio-ccw and generic virtio Thomas Huth
2026-03-10  5:55 ` [PULL 15/25] include/hw/s390x: Move CLP definitions for easier BIOS access Thomas Huth
2026-03-10  5:55 ` [PULL 16/25] pc-bios/s390-ccw: Introduce CLP Architecture Thomas Huth
2026-03-10  5:55 ` [PULL 17/25] s390x: Add definitions for PCI IPL type Thomas Huth
2026-03-10  5:55 ` [PULL 18/25] pc-bios/s390-ccw: Introduce PCI device Thomas Huth
2026-03-10  5:55 ` [PULL 19/25] pc-bios/s390-ccw: Introduce virtio-pci functions Thomas Huth
2026-03-10  5:55 ` [PULL 20/25] pc-bios/s390-ccw: Add support for virtio-blk-pci IPL Thomas Huth
2026-03-10  5:55 ` [PULL 21/25] s390x: Build IPLB for virtio-pci devices Thomas Huth
2026-03-10  5:55 ` [PULL 22/25] hw: Add "loadparm" property to virtio block PCI devices booting on s390x Thomas Huth
2026-03-10  5:55 ` [PULL 23/25] tests/qtest: Add s390x PCI boot test to cdrom-test.c Thomas Huth
2026-03-10  5:55 ` [PULL 24/25] pc-bios/s390-ccw: Fix compiler warning when compiling with DEBUG enabled Thomas Huth
2026-03-10  5:55 ` [PULL 25/25] pc-bios/s390-ccw.img: Update the s390 bios blog with the latest changes Thomas Huth
2026-03-10 13:31 ` [PULL 00/25] s390x & functional tests pull request for the softfreeze Peter Maydell

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=20260310055530.8893-8-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=farosas@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.