mirror of
https://github.com/qemu/qemu.git
synced 2024-11-23 19:03:38 +08:00
iotests: 194: test also migration of dirty bitmap
Test that dirty bitmap migration works when we deal with mirror. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200521220648.3255-5-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
107cfb7254
commit
ae00aa2398
@ -42,6 +42,8 @@ with iotests.FilePath('source.img') as source_img_path, \
|
||||
.add_incoming('unix:{0}'.format(migration_sock_path))
|
||||
.launch())
|
||||
|
||||
source_vm.qmp_log('block-dirty-bitmap-add', node='drive0', name='bitmap0')
|
||||
|
||||
iotests.log('Launching NBD server on destination...')
|
||||
iotests.log(dest_vm.qmp('nbd-server-start', addr={'type': 'unix', 'data': {'path': nbd_sock_path}}))
|
||||
iotests.log(dest_vm.qmp('nbd-server-add', device='drive0', writable=True))
|
||||
@ -61,12 +63,14 @@ with iotests.FilePath('source.img') as source_img_path, \
|
||||
filters=[iotests.filter_qmp_event])
|
||||
|
||||
iotests.log('Starting migration...')
|
||||
source_vm.qmp('migrate-set-capabilities',
|
||||
capabilities=[{'capability': 'events', 'state': True}])
|
||||
dest_vm.qmp('migrate-set-capabilities',
|
||||
capabilities=[{'capability': 'events', 'state': True}])
|
||||
capabilities = [{'capability': 'events', 'state': True},
|
||||
{'capability': 'dirty-bitmaps', 'state': True}]
|
||||
source_vm.qmp('migrate-set-capabilities', capabilities=capabilities)
|
||||
dest_vm.qmp('migrate-set-capabilities', capabilities=capabilities)
|
||||
iotests.log(source_vm.qmp('migrate', uri='unix:{0}'.format(migration_sock_path)))
|
||||
|
||||
source_vm.qmp_log('migrate-start-postcopy')
|
||||
|
||||
while True:
|
||||
event1 = source_vm.event_wait('MIGRATION')
|
||||
iotests.log(event1, filters=[iotests.filter_qmp_event])
|
||||
@ -82,3 +86,5 @@ with iotests.FilePath('source.img') as source_img_path, \
|
||||
iotests.log('Stopping the NBD server on destination...')
|
||||
iotests.log(dest_vm.qmp('nbd-server-stop'))
|
||||
break
|
||||
|
||||
iotests.log(source_vm.qmp('query-block')['return'][0]['dirty-bitmaps'])
|
||||
|
@ -1,4 +1,6 @@
|
||||
Launching VMs...
|
||||
{"execute": "block-dirty-bitmap-add", "arguments": {"name": "bitmap0", "node": "drive0"}}
|
||||
{"return": {}}
|
||||
Launching NBD server on destination...
|
||||
{"return": {}}
|
||||
{"return": {}}
|
||||
@ -8,11 +10,15 @@ Waiting for `drive-mirror` to complete...
|
||||
{"data": {"device": "mirror-job0", "len": 1073741824, "offset": 1073741824, "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
|
||||
Starting migration...
|
||||
{"return": {}}
|
||||
{"execute": "migrate-start-postcopy", "arguments": {}}
|
||||
{"return": {}}
|
||||
{"data": {"status": "setup"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
|
||||
{"data": {"status": "active"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
|
||||
{"data": {"status": "postcopy-active"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
|
||||
{"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
|
||||
Gracefully ending the `drive-mirror` job on source...
|
||||
{"return": {}}
|
||||
{"data": {"device": "mirror-job0", "len": 1073741824, "offset": 1073741824, "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
|
||||
Stopping the NBD server on destination...
|
||||
{"return": {}}
|
||||
[{"busy": false, "count": 0, "granularity": 65536, "name": "bitmap0", "persistent": false, "recording": true, "status": "active"}]
|
||||
|
Loading…
Reference in New Issue
Block a user