From b9462f5c467e5d7ec6ec60817f9989267306a40e Mon Sep 17 00:00:00 2001 From: Zheng Xiang Date: Tue, 22 May 2018 22:19:04 +0800 Subject: [PATCH 1/2] arm64-mmio: support armhf on arm64-mmio machine Support armhf on arm64-mmio machine so that we can run 32-bit guest on 64-bit host. Signed-off-by: Zheng Xiang --- shared/cfg/machines.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/cfg/machines.cfg b/shared/cfg/machines.cfg index 611827781c..6deb014a0b 100644 --- a/shared/cfg/machines.cfg +++ b/shared/cfg/machines.cfg @@ -38,7 +38,7 @@ variants: del rtc_drift del soundcards - arm64-mmio: - only aarch64 + only aarch64, armhf auto_cpu_model = "no" cpu_model = host machine_type = arm64-mmio:virt From 48235219f85976236a88e516a114616cb59239fa Mon Sep 17 00:00:00 2001 From: Zheng Xiang Date: Tue, 22 May 2018 22:34:56 +0800 Subject: [PATCH 2/2] aavmf: add aavmf and aavmf_vars_template paramters It is convenient for us to select the aavmf for different guests, such as 32-bit guest or 64-bit guest. Signed-off-by: Zheng Xiang --- virttest/qemu_devices/qcontainer.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/virttest/qemu_devices/qcontainer.py b/virttest/qemu_devices/qcontainer.py index cf799576e0..c149e5cee7 100644 --- a/virttest/qemu_devices/qcontainer.py +++ b/virttest/qemu_devices/qcontainer.py @@ -893,17 +893,22 @@ def get_aavmf_vars(params): devices = [] devices.append(qdevices.QStringDevice('machine', cmdline=cmd)) # EFI pflash - aavmf_code = ("-drive file=/usr/share/AAVMF/AAVMF_CODE.fd," - "if=pflash,format=raw,unit=0,readonly=on") + aavmf = params.get("aavmf") + if not aavmf: + aavmf = "/usr/share/AAVMF/AAVMF_CODE.fd" + aavmf_code = ("-drive file=%s,if=pflash,format=raw,unit=0,readonly=on" % aavmf) devices.append(qdevices.QStringDevice('AAVMF_CODE', cmdline=aavmf_code)) + aavmf_vars_template = params.get("aavmf_vars_template") + if not aavmf_vars_template: + aavmf_vars_template = "/usr/share/AAVMF/AAVMF_VARS.fd" aavmf_vars = get_aavmf_vars(params) if not os.path.exists(aavmf_vars): logging.warn("AAVMF variables file '%s' doesn't exist, " "recreating it from the template (this should " "only happen when you install the machine as " "there is no default boot in EFI!)", aavmf_vars) - shutil.copy2('/usr/share/AAVMF/AAVMF_VARS.fd', aavmf_vars) + shutil.copy2(aavmf_vars_template, aavmf_vars) aavmf_vars = ("-drive file=%s,if=pflash,format=raw,unit=1" % aavmf_vars) devices.append(qdevices.QStringDevice('AAVMF_VARS', @@ -943,17 +948,22 @@ def get_aavmf_vars(params): devices = [] devices.append(qdevices.QStringDevice('machine', cmdline=cmd)) # EFI pflash - aavmf_code = ("-drive file=/usr/share/AAVMF/AAVMF_CODE.fd," - "if=pflash,format=raw,unit=0,readonly=on") + aavmf = params.get("aavmf") + if not aavmf: + aavmf = "/usr/share/AAVMF/AAVMF_CODE.fd" + aavmf_code = ("-drive file=%s,if=pflash,format=raw,unit=0,readonly=on" % aavmf) devices.append(qdevices.QStringDevice('AAVMF_CODE', cmdline=aavmf_code)) + aavmf_vars_template = params.get("aavmf_vars_template") + if not aavmf_vars_template: + aavmf_vars_template = "/usr/share/AAVMF/AAVMF_VARS.fd" aavmf_vars = get_aavmf_vars(params) if not os.path.exists(aavmf_vars): logging.warn("AAVMF variables file '%s' doesn't exist, " "recreating it from the template (this should " "only happen when you install the machine as " "there is no default boot in EFI!)", aavmf_vars) - shutil.copy2('/usr/share/AAVMF/AAVMF_VARS.fd', aavmf_vars) + shutil.copy2(aavmf_vars_template, aavmf_vars) aavmf_vars = ("-drive file=%s,if=pflash,format=raw,unit=1" % aavmf_vars) devices.append(qdevices.QStringDevice('AAVMF_VARS',