All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: qemu-devel@nongnu.org, Peter Xu <peterx@redhat.com>,
	 Fabiano Rosas <farosas@suse.de>,
	Juraj Marcin <jmarcin@redhat.com>,
	 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	 qemu-block@nongnu.org
Subject: Re: [PATCH v2 5/5] iotests/migrate-bitmaps-postcopy-test: cover postcopy with a return path
Date: Wed, 11 Nov 2026 14:03:36 -0600	[thread overview]
Message-ID: <avS7g0KVPZLrjfwk@redhat.com> (raw)
In-Reply-To: <20261110183257.2930908-6-den@openvz.org>

On Tue, Nov 10, 2026 at 07:32:57PM +0100, Denis V. Lunev wrote:
> From: Denis V. Lunev <den@openvz.org>
> 
> The test migrates through an exec: fifo, which has no return path, so
> the source never waits for the destination's package-loaded pong.
> libvirt enables return-path for every migration that is not tunnelled.
> 
> Add a case that migrates one bitmap over a unix socket with return-path,
> unthrottled, and waits for the source to enter postcopy-active, so that
> the bitmap really goes through postcopy, and then for both sides to
> complete. It times out when the destination answers the pong from the
> run BH while dirty_bitmap_load() holds its lock across stream reads.
> 
> The existing cases are not run with a return path instead. They
> throttle the source, which lets the run BH take the lock between
> sections, and with a return path the source notices the destination
> shutdown and resumes the VM, as each VM has its own image.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Fabiano Rosas <farosas@suse.de>
> Cc: Juraj Marcin <jmarcin@redhat.com>
> Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Hanna Reitz <hreitz@redhat.com>
> Cc: qemu-block@nongnu.org
> ---
>  .../tests/migrate-bitmaps-postcopy-test       | 39 +++++++++++++++++++
>  .../tests/migrate-bitmaps-postcopy-test.out   |  4 +-
>  2 files changed, 41 insertions(+), 2 deletions(-)

I'm having trouble getting this test to fail when applied in isolation
without the rest of the series.

I even tried amending your patch as follows (to force more migration
traffic, and ensure that postcopy is in the loop), but still could not
get it to fail:

diff --git i/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test w/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test
index a6e21dec0a0..7eb729716ff 100755
--- i/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test
+++ w/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test
@@ -303,8 +303,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 # libvirt's configuration: the source waits for the destination's pong
 class TestDirtyBitmapPostcopyReturnPath(iotests.QMPTestCase):
     def setUp(self):
-        qemu_img('create', '-f', iotests.imgfmt, disk_a, '1G')
-        qemu_img('create', '-f', iotests.imgfmt, disk_b, '1G')
+        qemu_img('create', '-f', iotests.imgfmt, disk_a, '256G')
+        qemu_img('create', '-f', iotests.imgfmt, disk_b, '256G')
         self.vm_a = iotests.VM(path_suffix='a').add_drive(disk_a)
         self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
         self.vm_b.add_incoming('unix:' + mig_sock)
@@ -318,13 +318,17 @@ class TestDirtyBitmapPostcopyReturnPath(iotests.QMPTestCase):
         os.remove(disk_b)

     def test_postcopy_success(self):
-        self.vm_a.cmd('block-dirty-bitmap-add', node='drive0',
-                      name='bitmap0', persistent=True)
+        for i in range(15):
+            self.vm_a.cmd('block-dirty-bitmap-add', node='drive0',
+                          name=f'bitmap{i}', granularity=512, persistent=True)
+        self.vm_a.hmp_qemu_io('drive0', 'write 0 256M')

         caps = [{'capability': 'dirty-bitmaps', 'state': True},
+                {'capability': 'postcopy-ram', 'state': True},
                 {'capability': 'events', 'state': True},
                 {'capability': 'return-path', 'state': True}]
         self.vm_a.cmd('migrate-set-capabilities', capabilities=caps)
+        self.vm_a.cmd('migrate-set-parameters', max_bandwidth=16536)
         self.vm_b.cmd('migrate-set-capabilities', capabilities=caps)

         self.vm_a.cmd('migrate', uri='unix:' + mig_sock)
@@ -332,10 +336,11 @@ class TestDirtyBitmapPostcopyReturnPath(iotests.QMPTestCase):

         match = {'data': {'status': 'postcopy-active'}}
         self.vm_a.event_wait('MIGRATION', match=match)
+        self.vm_a.cmd('migrate-set-parameters', max_bandwidth=524288)
         match = {'data': {'status': 'completed'}}
         self.vm_b.event_wait('MIGRATION', match=match)
         self.vm_a.event_wait('MIGRATION', match=match)
-        check_bitmaps(self.vm_b, 1)
+        check_bitmaps(self.vm_b, 15)


 if __name__ == '__main__':


While it is indeed valuable to add a test covering libvirt's setup, I
was hoping that the test would also make it more obvious why the rest
of the series is necessary; if the test passes without the rest of the
series, it is not testing what you fixed.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



      reply	other threads:[~2026-11-11 20:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 18:32 [PATCH v2 0/5] migration/postcopy: report destination states only after the run state change Denis V. Lunev
2026-11-10 18:32 ` [PATCH v2 1/5] migration/postcopy: report COMPLETED only after the run BH has run Denis V. Lunev
2026-11-11 16:20   ` Eric Blake
2026-11-10 18:32 ` [PATCH v2 2/5] migration/postcopy: set destination postcopy-active in the run BH Denis V. Lunev
2026-11-11 16:34   ` Eric Blake
2026-11-10 18:32 ` [PATCH v2 3/5] tests/qtest/migration: check the destination run state in postcopy tests Denis V. Lunev
2026-11-11 17:32   ` Eric Blake
2026-11-10 18:32 ` [PATCH v2 4/5] migration/postcopy: answer the package-loaded ping from the run BH Denis V. Lunev
2026-11-10 18:32 ` [PATCH v2 5/5] iotests/migrate-bitmaps-postcopy-test: cover postcopy with a return path Denis V. Lunev
2026-11-11 20:03   ` Eric Blake [this message]

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=avS7g0KVPZLrjfwk@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@openvz.org \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=jmarcin@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    /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.