qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Peter Krempa <pkrempa@redhat.com>,
	Juan Quintela <quintela@redhat.com>, John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH v4 4/4] iotests: Test node/bitmap aliases during migration
Date: Fri, 21 Aug 2020 10:09:05 +0200	[thread overview]
Message-ID: <39622ae0-eb1c-1897-6fe8-56c20cc478bc@redhat.com> (raw)
In-Reply-To: <b1ab8e28-f5ad-1cde-a706-02e4b32e1a0a@virtuozzo.com>


[-- Attachment #1.1: Type: text/plain, Size: 3910 bytes --]

On 20.08.20 17:49, Vladimir Sementsov-Ogievskiy wrote:
> # MYPYPATH=../../python/ mypy 300
> 300:154: error: Item "None" of "Optional[Match[Any]]" has no attribute
> "group"
> Found 1 error in 1 file (checked 1 source file)

:(

> - the only complain. Suggest a fix:
> 
> diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300
> index c6d86b1dbc..0241903743 100755
> --- a/tests/qemu-iotests/300
> +++ b/tests/qemu-iotests/300
> @@ -148,11 +148,11 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
>              result = vm.qmp('human-monitor-command',
>                              command_line='info migrate_parameters')
>  
> -            hmp_mapping = re.search(r'^block-bitmap-mapping:\r?(\n 
> .*)*\n',
> -                                    result['return'], flags=re.MULTILINE)
> +            m = re.search(r'^block-bitmap-mapping:\r?(\n  .*)*\n',
> +                          result['return'], flags=re.MULTILINE)
> +            hmp_mapping = m.group(0).replace('\r', '') if m else None
>  
> -            self.assertEqual(hmp_mapping.group(0).replace('\r', ''),
> -                             self.to_hmp_mapping(mapping))
> +            self.assertEqual(hmp_mapping, self.to_hmp_mapping(mapping))

Looks good, thanks.

>          else:
>              self.assert_qmp(result, 'error/desc', error)
>  
> ===
> 
> # flake8 300
[...]
> - I post it just because ALE plugin in vim highlights all these things
> for me. Up to you, I don't ask you to fix it.

Thanks, I’ll run it from now on (unless I forget, like mypy above...).

> 18.08.2020 16:32, Max Reitz wrote:
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>>   tests/qemu-iotests/300     | 595 +++++++++++++++++++++++++++++++++++++
>>   tests/qemu-iotests/300.out |   5 +
>>   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
>>
> 
> [..]
> 
>> +    def test_alias_on_both_migration(self) -> None:
>> +        src_map = self.mapping(self.src_node_name, 'node-alias',
>> +                               self.src_bmap_name, 'bmap-alias')
>> +
>> +        dst_map = self.mapping(self.dst_node_name, 'node-alias',
>> +                               self.dst_bmap_name, 'bmap-alias')
>> +
>> +        self.set_mapping(self.vm_a, src_map)
>> +        self.set_mapping(self.vm_b, dst_map)
>> +        self.migrate()
>> +        self.verify_dest_error(None)
> 
> Hmm, probably verify_dest_error() should be called from migrate(), as
> you call it (almost) always after migrate()

I don’t know, it shuts down the destination VM, so it would seem a bit
strange to do that as part of migrate().

>> +    def test_unused_mapping_on_dst(self) -> None:
>> +        # Let the source not send any bitmaps
>> +        self.set_mapping(self.vm_a, [])
>> +
>> +        # Establish some mapping on the destination
>> +        self.set_mapping(self.vm_b, [])
> 
> Seems, you wanted to specify non-empty mapping for vm_b, yes?

Oops.  I don’t know how it could have happened that I forgot that.

> With any non-empty mapping here, just to better correspond to the comments:
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> 
> (or keep this case with both mappings empty, and add one similar with
> empty mapping only on src)

I’ll see in what shape this patch lands in master, and then I’ll
probably add that other case, yes.

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2020-08-21  8:09 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
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 [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=39622ae0-eb1c-1897-6fe8-56c20cc478bc@redhat.com \
    --to=mreitz@redhat.com \
    --cc=dgilbert@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).