[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v9 12/13] iotests: add dirty bitmap
From: |
Fam Zheng |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v9 12/13] iotests: add dirty bitmap migration test |
Date: |
Thu, 28 Dec 2017 14:28:10 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Wed, 12/20 18:49, Vladimir Sementsov-Ogievskiy wrote:
> +def inject_test_case(klass, name, method, *args, **kwargs):
> + mc = operator.methodcaller(method, *args, **kwargs)
> + setattr(klass, 'test_' + name, new.instancemethod(mc, None, klass))
> +
> +
> +for cmb in list(itertools.product((True, False), repeat=4)):
> + name = ('_' if cmb[0] else '_not_') + 'persistent_'
> + name += ('_' if cmb[1] else '_not_') + 'shared_'
> + name += ('_' if cmb[2] else '_not_') + 'migbitmap_'
> + name += '_online' if cmb[3] else '_offline'
> +
> + inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration',
> *cmb)
Personally I'd just spell out the 16 method names and call do_test_migration.
It's much easier to read and modify. Either way,
Reviewed-by: Fam Zheng <address@hidden>
- [Qemu-block] [PATCH v9 08/13] migration/qemu-file: add qemu_put_counted_string(), (continued)
- [Qemu-block] [PATCH v9 08/13] migration/qemu-file: add qemu_put_counted_string(), Vladimir Sementsov-Ogievskiy, 2017/12/20
- [Qemu-block] [PATCH v9 01/13] block/dirty-bitmap: add bdrv_dirty_bitmap_enable_successor(), Vladimir Sementsov-Ogievskiy, 2017/12/20
- [Qemu-block] [PATCH v9 04/13] dirty-bitmap: add locked state, Vladimir Sementsov-Ogievskiy, 2017/12/20
- [Qemu-block] [PATCH v9 12/13] iotests: add dirty bitmap migration test, Vladimir Sementsov-Ogievskiy, 2017/12/20
- Re: [Qemu-block] [Qemu-devel] [PATCH v9 12/13] iotests: add dirty bitmap migration test,
Fam Zheng <=
- [Qemu-block] [PATCH v9 05/13] migration: introduce postcopy-only pending, Vladimir Sementsov-Ogievskiy, 2017/12/20
- [Qemu-block] [PATCH v9 09/13] migration: add is_active_iterate handler, Vladimir Sementsov-Ogievskiy, 2017/12/20
- [Qemu-block] [PATCH v9 02/13] block/dirty-bitmap: fix locking in bdrv_reclaim_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/12/20
- [Qemu-block] [PATCH v9 10/13] migration: add postcopy migration of dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2017/12/20