Skip to content
Snippets Groups Projects
Commit 8763196c authored by Murilo Opsfelder Araujo's avatar Murilo Opsfelder Araujo Committed by Daniel Henrique Barboza
Browse files

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: default avatarMurilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
Message-Id: <20220809002451.91541-3-muriloo@linux.ibm.com>
Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
parent 7661a7ab
No related branches found
No related tags found
No related merge requests found
......@@ -281,6 +281,26 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri):
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 @@ def _get_common_args(self, hardware, tunnelled=False):
"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 @@ def _get_common_args(self, hardware, tunnelled=False):
"-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"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment