mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
iotests: Move migration helpers to iotests.py
234 implements functions that are useful for doing migration between two VMs. Move them to iotests.py so that other test cases can use them, too. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
19462c4bdd
commit
980448f17a
2 changed files with 23 additions and 23 deletions
|
@ -583,6 +583,22 @@ class VM(qtest.QEMUQtestMachine):
|
|||
elif status == 'null':
|
||||
return error
|
||||
|
||||
def enable_migration_events(self, name):
|
||||
log('Enabling migration QMP events on %s...' % name)
|
||||
log(self.qmp('migrate-set-capabilities', capabilities=[
|
||||
{
|
||||
'capability': 'events',
|
||||
'state': True
|
||||
}
|
||||
]))
|
||||
|
||||
def wait_migration(self):
|
||||
while True:
|
||||
event = self.event_wait('MIGRATION')
|
||||
log(event, filters=[filter_qmp_event])
|
||||
if event['data']['status'] == 'completed':
|
||||
break
|
||||
|
||||
def node_info(self, node_name):
|
||||
nodes = self.qmp('query-named-block-nodes')
|
||||
for x in nodes['return']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue