mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-08 09:04:33 +00:00
tests: migrate: remove multiple client option
Not supported feature to be tested so reduce unused/untested code for now. Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
6ca34325f5
commit
0d351864b1
@ -54,7 +54,6 @@ def get_args():
|
||||
parser.add_argument('--spice_port1', dest='spice_port1', type=int, default=5911)
|
||||
parser.add_argument('--spice_port2', dest='spice_port2', type=int, default=6911)
|
||||
parser.add_argument('--migrate_port', dest='migrate_port', type=int, default=8000)
|
||||
parser.add_argument('--client_count', dest='client_count', type=int, default=1)
|
||||
parser.add_argument('--qemu', dest='qemu', default='../../qemu/x86_64-softmmu/qemu-system-x86_64')
|
||||
parser.add_argument('--log_filename', dest='log_filename', default='migrate.log')
|
||||
parser.add_argument('--image', dest='image', default='')
|
||||
@ -134,14 +133,13 @@ class Migrator(object):
|
||||
|
||||
migration_count = 0
|
||||
|
||||
def __init__(self, log, client, qemu_exec, image, monitor_files, client_count,
|
||||
def __init__(self, log, client, qemu_exec, image, monitor_files,
|
||||
spice_ports, migration_port, vdagent):
|
||||
self.client = client
|
||||
self.log = log
|
||||
self.qemu_exec = qemu_exec
|
||||
self.image = image
|
||||
self.migration_port = migration_port
|
||||
self.client_count = client_count
|
||||
self.monitor_files = monitor_files
|
||||
self.spice_ports = spice_ports
|
||||
self.vdagent = vdagent
|
||||
@ -153,7 +151,7 @@ class Migrator(object):
|
||||
self.target = start_qemu(qemu_exec=qemu_exec, image=image, spice_port=spice_ports[1],
|
||||
qmp_filename=monitor_files[1], incoming_port=migration_port)
|
||||
self.remove_monitor_files()
|
||||
self.clients = []
|
||||
self.connected_client = None
|
||||
|
||||
def close(self):
|
||||
self.remove_monitor_files()
|
||||
@ -173,14 +171,13 @@ class Migrator(object):
|
||||
def iterate(self, wait_for_user_input=False):
|
||||
wait_active(self.active.qmp, True)
|
||||
wait_active(self.target.qmp, False)
|
||||
if len(self.clients) == 0:
|
||||
for i in range(self.client_count):
|
||||
self.clients.append(start_client(client=self.client,
|
||||
spice_port=self.spice_ports[0]))
|
||||
wait_for_event(self.active.qmp, 'SPICE_INITIALIZED')
|
||||
if not self.connected_client:
|
||||
self.connected_client = start_client(client=self.client, spice_port=self.spice_ports[0])
|
||||
wait_for_event(self.active.qmp, 'SPICE_INITIALIZED')
|
||||
if wait_for_user_input:
|
||||
print "waiting for Enter to start migrations"
|
||||
raw_input()
|
||||
|
||||
self.active.qmp.cmd('client_migrate_info', {'protocol':'spice',
|
||||
'hostname':'localhost', 'port':self.target.spice_port})
|
||||
self.active.qmp.cmd('migrate', {'uri': 'tcp:localhost:%s' % self.migration_port})
|
||||
@ -212,7 +209,7 @@ def main():
|
||||
migrator = Migrator(client=args.client, qemu_exec=args.qemu_exec,
|
||||
image=args.image, log=log, monitor_files=[args.qmp1, args.qmp2],
|
||||
migration_port=args.migrate_port, spice_ports=[args.spice_port1,
|
||||
args.spice_port2], client_count=args.client_count, vdagent=(args.vdagent=='on'))
|
||||
args.spice_port2], vdagent=(args.vdagent=='on'))
|
||||
atexit.register(cleanup, migrator)
|
||||
while True:
|
||||
migrator.iterate()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user