From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
Juan Quintela <quintela@redhat.com>,
qemu-devel@nongnu.org,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Peter Krempa <pkrempa@redhat.com>, John Snow <jsnow@redhat.com>
Subject: Re: [PATCH v4 4/4] iotests: Test node/bitmap aliases during migration
Date: Thu, 20 Aug 2020 15:17:14 +0200 [thread overview]
Message-ID: <28314d9e-714a-2acd-5bd0-cf61f9ca41b2@redhat.com> (raw)
In-Reply-To: <fe00acc5-a06f-5e65-63f6-5f0ed7ec3019@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 5671 bytes --]
On 20.08.20 03:58, Eric Blake wrote:
> On 8/18/20 8:32 AM, Max Reitz wrote:
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>> tests/qemu-iotests/300 | 595 +++++++++++++++++++++++++++++++++++++
>> tests/qemu-iotests/300.out | 5 +
>
> Rather sparse output (I hate debugging those sorts of outputs when the
> test is failing).
Hm. I don’t know, the stack trace usually gives a good idea and
./check -d gives QMP context.
The advantage of a sparse output is that we don’t need to adjust the
reference output every time some optional field is added somewhere.
>> tests/qemu-iotests/group | 1 +
>> 3 files changed, 601 insertions(+)
>> create mode 100755 tests/qemu-iotests/300
>> create mode 100644 tests/qemu-iotests/300.out
>>
>
>> + # Dirty some random megabytes
>> + for _ in range(9):
>> + mb_ofs = random.randrange(1024)
>> + self.vm_a.hmp_qemu_io(self.src_node_name, f'write
>> {mb_ofs}M 1M')
>
> It turns out that the discard operation likewise dirties the bitmap, but
> slightly faster (see edb90bbd). We could optimize it on top, but I'm
> not going to require a micro-optimizing to get it in. The test takes
> about 12 seconds to run for me, but you didn't mark it as such in
> 'group', so that's good; but it turns up a problem:
>
> 300 fail [20:55:54] [20:56:06] output
> mismatch (see 300.out.bad)
> --- /home/eblake/qemu-tmp2/tests/qemu-iotests/300.out 2020-08-19
> 20:53:11.087791988 -0500
> +++ /home/eblake/qemu-tmp2/tests/qemu-iotests/300.out.bad 2020-08-19
> 20:56:06.092428756 -0500
> @@ -1,5 +1,41 @@
> -.....................................
> +WARNING:qemu.machine:qemu received signal 11; command:
> "/home/eblake/qemu-tmp2/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64
> -display none -vga none -chardev
> socket,id=mon,path=/tmp/tmp.qT831UThme/qemu-b-798452-monitor.sock -mon
> chardev=mon,mode=control -qtest
> unix:path=/tmp/tmp.qT831UThme/qemu-b-798452-qtest.sock -accel qtest
> -nodefaults -display none -accel qtest -blockdev
> node-name=node0,driver=null-co -incoming unix:/tmp/tmp.qT831UThme/mig_sock"
> +.............FE.......................
> +======================================================================
> +ERROR: test_migratee_bitmap_is_not_mapped_on_dst
> (__main__.TestBlockBitmapMappingErrors)
> +----------------------------------------------------------------------
> +Traceback (most recent call last):
> + File
> "/home/eblake/qemu-tmp2/tests/qemu-iotests/../../python/qemu/machine.py", line
> 435, in _do_shutdown
> + self._soft_shutdown(timeout, has_quit)
> + File
> "/home/eblake/qemu-tmp2/tests/qemu-iotests/../../python/qemu/machine.py", line
> 415, in _soft_shutdown
> + self._qmp.cmd('quit')
> + File
> "/home/eblake/qemu-tmp2/tests/qemu-iotests/../../python/qemu/qmp.py",
> line 266, in cmd
> + return self.cmd_obj(qmp_cmd)
> + File
> "/home/eblake/qemu-tmp2/tests/qemu-iotests/../../python/qemu/qmp.py",
> line 246, in cmd_obj
> + self.__sock.sendall(json.dumps(qmp_cmd).encode('utf-8'))
> +BrokenPipeError: [Errno 32] Broken pipe
> +
> +The above exception was the direct cause of the following exception:
> +
> +Traceback (most recent call last):
> + File "300", line 76, in tearDown
> + self.vm_b.shutdown()
> + File
> "/home/eblake/qemu-tmp2/tests/qemu-iotests/../../python/qemu/machine.py", line
> 465, in shutdown
> + self._do_shutdown(timeout, has_quit)
> + File
> "/home/eblake/qemu-tmp2/tests/qemu-iotests/../../python/qemu/machine.py", line
> 438, in _do_shutdown
> + raise AbnormalShutdown("Could not perform graceful shutdown") \
> +qemu.machine.AbnormalShutdown: Could not perform graceful shutdown
> +
> +======================================================================
> +FAIL: test_migratee_bitmap_is_not_mapped_on_dst
> (__main__.TestBlockBitmapMappingErrors)
> +----------------------------------------------------------------------
> +Traceback (most recent call last):
> + File "300", line 384, in test_migratee_bitmap_is_not_mapped_on_dst
> + self.migrate(False)
> + File "300", line 99, in migrate
> + self.assertEqual(self.vm_a.wait_migration('postmigrate'),
> +AssertionError: False != True
> +
> ----------------------------------------------------------------------
> Ran 37 tests
>
> -OK
> +FAILED (failures=1, errors=1)
>
> I'm not sure why I'm seeing that, but it looks like you've got a bad
> deref somewhere in the alias code.
Ah, crap.
This should fix it:
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 89cb16b12c..d407dfefea 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -1091,7 +1091,9 @@ static int dirty_bitmap_load_header(QEMUFile *f,
DBMLoadState *s,
} else {
bitmap_name = s->bitmap_alias;
}
+ }
+ if (!s->cancelled) {
g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name));
s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name);
I had this originally, and then I decided to drop that hunk just before
sending v4 because I couldn’t see the point. But we need it, because if
the bitmap alias is unknown, the migration is cancelled, so we need to
re-check s->cancalled after the alias lookup block.
Would you be OK with squashing that into patch 1?
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-08-20 13:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 13:32 [PATCH v4 0/4] migration: Add block-bitmap-mapping parameter Max Reitz
2020-08-18 13:32 ` [PATCH v4 1/4] " Max Reitz
2020-08-20 1:17 ` Eric Blake
2020-08-20 12:57 ` Max Reitz
2020-08-20 12:58 ` Vladimir Sementsov-Ogievskiy
2020-08-20 13:32 ` Max Reitz
2020-08-18 13:32 ` [PATCH v4 2/4] iotests.py: Add wait_for_runstate() Max Reitz
2020-08-20 1:19 ` Eric Blake
2020-08-20 14:23 ` Dr. David Alan Gilbert
2020-08-20 14:34 ` Vladimir Sementsov-Ogievskiy
2020-08-20 14:56 ` Max Reitz
2020-08-20 13:36 ` Vladimir Sementsov-Ogievskiy
2020-08-18 13:32 ` [PATCH v4 3/4] iotests.py: Let wait_migration() return on failure Max Reitz
2020-08-20 1:21 ` Eric Blake
2020-08-20 13:42 ` Vladimir Sementsov-Ogievskiy
2020-08-18 13:32 ` [PATCH v4 4/4] iotests: Test node/bitmap aliases during migration Max Reitz
2020-08-20 1:58 ` Eric Blake
2020-08-20 13:17 ` Max Reitz [this message]
2020-08-20 13:52 ` Vladimir Sementsov-Ogievskiy
2020-08-20 15:49 ` Vladimir Sementsov-Ogievskiy
2020-08-21 0:44 ` Eric Blake
2020-08-21 11:36 ` Vladimir Sementsov-Ogievskiy
2020-08-21 8:09 ` Max Reitz
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=28314d9e-714a-2acd-5bd0-cf61f9ca41b2@redhat.com \
--to=mreitz@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=vsementsov@virtuozzo.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).