Am 15.02.2021 um 17:46 hat Eric Blake geschrieben: > On 2/15/21 6:31 AM, Kevin Wolf wrote: > > Am 13.02.2021 um 00:21 hat Eric Blake geschrieben: > >> From: Peter Krempa <pkre...@redhat.com> > >> > >> Verify that the modification of the bitmap persistence over migration > >> which is controlled via BitmapMigrationBitmapAliasTransform works > >> properly. > >> > >> Based on TestCrossAliasMigration > >> > >> Signed-off-by: Peter Krempa <pkre...@redhat.com> > >> Message-Id: > >> <d9c8e9827e9b6001b2dd1b92e64aab858e6d2a86.1613150869.git.pkre...@redhat.com> > >> Reviewed-by: Eric Blake <ebl...@redhat.com> > >> [eblake: Adjust test for explicit read_zeroes=False] > >> Signed-off-by: Eric Blake <ebl...@redhat.com> > > > > This breaks 297: > > > > --- /home/kwolf/source/qemu/tests/qemu-iotests/297.out > > +++ 297.out.bad > > @@ -1,2 +1,8 @@ > > === pylint === > > +************* Module 300 > > +300:605:0: C0301: Line too long (80/79) (line-too-long) > > +300:677:0: C0301: Line too long (98/79) (line-too-long) > > These two are easy fixes (add line breaks for shorter lines), but this: > > > === mypy === > > +300:646: error: Dict entry 2 has incompatible type "str": "Dict[str, > > bool]"; expected "str": "str" > > +Found 1 error in 1 file (checked 1 source file) > > is beyond my skill. The typing at line 33: > > BlockBitmapMapping = List[Dict[str, Union[str, List[Dict[str, str]]]]] > > is insufficient to allow our new 'transform' member in the new > transform_mapping() -> Block BitmapMapping near line 677: > > 'bitmaps': [ > { > 'name': 'bmap-a', > 'alias': 'bmap-a', > 'transform': > { > 'persistent': True > } > }, > > but I'm not sure how to tell python the right type it should be. John?
To be honest, this looks sufficiently like JSON that I would just go for List[Dict[str, Any]] (as long as recursive types don't work), but if you really want to have an explicit type, I think you'd have to replace the rightmost str with Union[str, Dict[str, bool]] to allow both. Kevin