tests/migration: add support for ppc64le for guestperf.py

Add support for ppc64le for guestperf.py. On ppc, console is usually
hvc0 and serial device for pseries machine is spapr-vty.

Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20220809002451.91541-3-muriloo@linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Murilo Opsfelder Araujo 2022-08-08 21:24:51 -03:00 committed by Daniel Henrique Barboza
parent 7661a7ab53
commit 8763196c2c

View File

@ -281,6 +281,26 @@ class Engine(object):
resp = src.command("stop")
paused = True
def _is_ppc64le(self):
_, _, _, _, machine = os.uname()
if machine == "ppc64le":
return True
return False
def _get_guest_console_args(self):
if self._is_ppc64le():
return "console=hvc0"
else:
return "console=ttyS0"
def _get_qemu_serial_args(self):
if self._is_ppc64le():
return ["-chardev", "stdio,id=cdev0",
"-device", "spapr-vty,chardev=cdev0"]
else:
return ["-chardev", "stdio,id=cdev0",
"-device", "isa-serial,chardev=cdev0"]
def _get_common_args(self, hardware, tunnelled=False):
args = [
"noapic",
@ -289,8 +309,10 @@ class Engine(object):
"noreplace-smp",
"cgroup_disable=memory",
"pci=noearly",
"console=ttyS0",
]
args.append(self._get_guest_console_args())
if self._debug:
args.append("debug")
else:
@ -308,12 +330,12 @@ class Engine(object):
"-kernel", self._kernel,
"-initrd", self._initrd,
"-append", cmdline,
"-chardev", "stdio,id=cdev0",
"-device", "isa-serial,chardev=cdev0",
"-m", str((hardware._mem * 1024) + 512),
"-smp", str(hardware._cpus),
]
argv.extend(self._get_qemu_serial_args())
if self._debug:
argv.extend(["-device", "sga"])