
On Wed, Feb 21, 2024 at 06:46:07PM +0800, Xianglai Li wrote:
Add domaincapstest qemuxml2argvtest qemuxml2xmltest related test cases for loongarch.
Signed-off-by: Xianglai Li <lixianglai@loongson.cn> --- .../qemu_8.2.0-tcg-virt.loongarch64.xml | 163 + .../qemu_8.2.0-virt.loongarch64.xml | 167 + tests/domaincapstest.c | 4 +- .../caps_8.2.0_loongarch64.replies | 30121 ++++++++++++++++ .../caps_8.2.0_loongarch64.xml | 175 + .../qemucaps2xmloutdata/caps.loongarch64.xml | 28 + ...o-type-loongarch64.loongarch64-latest.args | 34 + ...eo-type-loongarch64.loongarch64-latest.xml | 45 + .../default-video-type-loongarch64.xml | 18 + ...-models.loongarch64-latest.abi-update.args | 44 + ...t-models.loongarch64-latest.abi-update.xml | 79 + ...irt-default-models.loongarch64-latest.args | 44 + ...virt-default-models.loongarch64-latest.xml | 79 + .../loongarch64-virt-default-models.xml | 24 + ...ch64-virt-graphics.loongarch64-latest.args | 56 + ...rch64-virt-graphics.loongarch64-latest.xml | 116 + .../loongarch64-virt-graphics.xml | 48 + ...ch64-virt-headless.loongarch64-latest.args | 52 + ...rch64-virt-headless.loongarch64-latest.xml | 102 + .../loongarch64-virt-headless.xml | 42 + ...minimal.loongarch64-latest.abi-update.args | 31 + ...-minimal.loongarch64-latest.abi-update.xml | 26 + ...rch64-virt-minimal.loongarch64-latest.args | 31 + ...arch64-virt-minimal.loongarch64-latest.xml | 26 + .../loongarch64-virt-minimal.xml | 15 + tests/qemuxmlconftest.c | 7 + tests/testutilshostcpus.h | 10 + 27 files changed, 31585 insertions(+), 2 deletions(-)
Minor suggestion: it would be slighly nicer if you added the QEMU capabilities and the code needed to run tests against loongarch64 first, then the qemuxmlconftest cases in a second patch. But as I said it's a minor thing, so feel free to leave things as they are.
+++ b/tests/qemuxmlconfdata/loongarch64-virt-default-models.loongarch64-latest.abi-update.xml + <controller type='scsi' index='0' model='lsilogic'> + <address type='pci' domain='0x0000' bus='0x04' slot='0x01' function='0x0'/> + </controller>
As you can see here, the default model for the SCSI controller is lsilogic...
+ <controller type='pci' index='4' model='pcie-to-pci-bridge'> + <model name='pcie-pci-bridge'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller>
... which, since it's a conventional PCI device, means a pcie-to-pci-bridge needs to be created to accommodate it. Once you've updated patch 2 as I have suggested, this will go away. The other defaults and controllers are the ones we expect.
+++ b/tests/qemuxmlconfdata/loongarch64-virt-minimal.xml @@ -0,0 +1,15 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='loongarch64' machine='virt'>hvm</type> + </os> + <features> + <acpi/> + </features>
This test is about default devices, so the ACPI feature doesn't need to be included. Same thing for the default-models test. The test coverage you've introduced is pretty good overall, but there's one notable blind spot: firmware handling. Thankfully, since I have recently added a firmware descriptor for the loongarch64 build of edk2, you can just copy the firmware-auto-efi-aarch64 test case to take care of that. -- Andrea Bolognani / Red Hat / Virtualization