mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tests: Add RISC-V architectures
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
1ae7029870
commit
869cb692fa
@ -208,6 +208,42 @@
|
||||
</arch>
|
||||
</guest>
|
||||
|
||||
<guest>
|
||||
<os_type>hvm</os_type>
|
||||
<arch name='riscv32'>
|
||||
<wordsize>32</wordsize>
|
||||
<emulator>/usr/bin/qemu-system-riscv32</emulator>
|
||||
<machine maxCpus='1'>spike_v1.10</machine>
|
||||
<machine maxCpus='1'>spike_v1.9.1</machine>
|
||||
<machine maxCpus='1'>sifive_e</machine>
|
||||
<machine maxCpus='8'>virt</machine>
|
||||
<machine maxCpus='1'>sifive_u</machine>
|
||||
<domain type='qemu'/>
|
||||
</arch>
|
||||
<features>
|
||||
<cpuselection/>
|
||||
<disksnapshot default='on' toggle='no'/>
|
||||
</features>
|
||||
</guest>
|
||||
|
||||
<guest>
|
||||
<os_type>hvm</os_type>
|
||||
<arch name='riscv64'>
|
||||
<wordsize>64</wordsize>
|
||||
<emulator>/usr/bin/qemu-system-riscv64</emulator>
|
||||
<machine maxCpus='1'>spike_v1.10</machine>
|
||||
<machine maxCpus='1'>spike_v1.9.1</machine>
|
||||
<machine maxCpus='1'>sifive_e</machine>
|
||||
<machine maxCpus='8'>virt</machine>
|
||||
<machine maxCpus='1'>sifive_u</machine>
|
||||
<domain type='qemu'/>
|
||||
</arch>
|
||||
<features>
|
||||
<cpuselection/>
|
||||
<disksnapshot default='on' toggle='no'/>
|
||||
</features>
|
||||
</guest>
|
||||
|
||||
<guest>
|
||||
<os_type>xen</os_type>
|
||||
<arch name='i686'>
|
||||
|
14819
tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies
Normal file
14819
tests/qemucapabilitiesdata/caps_3.0.0.riscv32.replies
Normal file
File diff suppressed because it is too large
Load Diff
118
tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml
Normal file
118
tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml
Normal file
@ -0,0 +1,118 @@
|
||||
<qemuCaps>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
<usedQMP/>
|
||||
<flag name='scsi-disk.channel'/>
|
||||
<flag name='scsi-block'/>
|
||||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='scsi-cd'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
<flag name='seccomp-sandbox'/>
|
||||
<flag name='reboot-timeout'/>
|
||||
<flag name='seamless-migration'/>
|
||||
<flag name='block-commit'/>
|
||||
<flag name='vnc'/>
|
||||
<flag name='drive-mirror'/>
|
||||
<flag name='blockdev-snapshot-sync'/>
|
||||
<flag name='device-video-primary'/>
|
||||
<flag name='add-fd'/>
|
||||
<flag name='nbd-server'/>
|
||||
<flag name='virtio-rng'/>
|
||||
<flag name='rng-random'/>
|
||||
<flag name='rng-egd'/>
|
||||
<flag name='tpm-passthrough'/>
|
||||
<flag name='scsi-generic'/>
|
||||
<flag name='scsi-generic.bootindex'/>
|
||||
<flag name='mem-merge'/>
|
||||
<flag name='vnc-websocket'/>
|
||||
<flag name='drive-discard'/>
|
||||
<flag name='mlock'/>
|
||||
<flag name='device-del-event'/>
|
||||
<flag name='virtio-mmio'/>
|
||||
<flag name='boot-strict'/>
|
||||
<flag name='spiceport'/>
|
||||
<flag name='msg-timestamp'/>
|
||||
<flag name='active-commit'/>
|
||||
<flag name='change-backing-file'/>
|
||||
<flag name='memory-backend-ram'/>
|
||||
<flag name='numa'/>
|
||||
<flag name='memory-backend-file'/>
|
||||
<flag name='splash-timeout'/>
|
||||
<flag name='iothread'/>
|
||||
<flag name='migrate-rdma'/>
|
||||
<flag name='drive-iotune-max'/>
|
||||
<flag name='machine-vmport-opt'/>
|
||||
<flag name='aes-key-wrap'/>
|
||||
<flag name='dea-key-wrap'/>
|
||||
<flag name='vhost-user-multiqueue'/>
|
||||
<flag name='migration-event'/>
|
||||
<flag name='virtio-net'/>
|
||||
<flag name='gic-version'/>
|
||||
<flag name='incoming-defer'/>
|
||||
<flag name='virtio-gpu'/>
|
||||
<flag name='virtio-keyboard'/>
|
||||
<flag name='virtio-mouse'/>
|
||||
<flag name='virtio-tablet'/>
|
||||
<flag name='virtio-input-host'/>
|
||||
<flag name='chardev-file-append'/>
|
||||
<flag name='vserport-change-event'/>
|
||||
<flag name='virtio-balloon-pci.deflate-on-oom'/>
|
||||
<flag name='chardev-logfile'/>
|
||||
<flag name='debug-threads'/>
|
||||
<flag name='secret'/>
|
||||
<flag name='device-tray-moved-event'/>
|
||||
<flag name='name-guest'/>
|
||||
<flag name='drive-detect-zeroes'/>
|
||||
<flag name='tls-creds-x509'/>
|
||||
<flag name='smm'/>
|
||||
<flag name='query-hotpluggable-cpus'/>
|
||||
<flag name='drive-iotune-max-length'/>
|
||||
<flag name='query-qmp-schema'/>
|
||||
<flag name='gluster.debug_level'/>
|
||||
<flag name='vhost-scsi'/>
|
||||
<flag name='drive-iotune-group'/>
|
||||
<flag name='block-write-threshold'/>
|
||||
<flag name='query-named-block-nodes'/>
|
||||
<flag name='kernel-irqchip'/>
|
||||
<flag name='kernel-irqchip.split'/>
|
||||
<flag name='virtio.iommu_platform'/>
|
||||
<flag name='loadparm'/>
|
||||
<flag name='vnc-multi-servers'/>
|
||||
<flag name='chardev-reconnect'/>
|
||||
<flag name='virtio-gpu.max_outputs'/>
|
||||
<flag name='vxhs'/>
|
||||
<flag name='numa.dist'/>
|
||||
<flag name='disk-share-rw'/>
|
||||
<flag name='iscsi.password-secret'/>
|
||||
<flag name='dump-completed'/>
|
||||
<flag name='qcow2-luks'/>
|
||||
<flag name='seccomp-blacklist'/>
|
||||
<flag name='query-cpus-fast'/>
|
||||
<flag name='disk-write-cache'/>
|
||||
<flag name='nbd-tls'/>
|
||||
<flag name='pr-manager-helper'/>
|
||||
<flag name='qom-list-properties'/>
|
||||
<flag name='memory-backend-file.discard-data'/>
|
||||
<flag name='sdl-gl'/>
|
||||
<flag name='screendump_device'/>
|
||||
<flag name='blockdev-del'/>
|
||||
<flag name='vhost-vsock'/>
|
||||
<flag name='chardev-fd-pass'/>
|
||||
<flag name='tpm-emulator'/>
|
||||
<flag name='egl-headless'/>
|
||||
<version>3000000</version>
|
||||
<kvmVersion>0</kvmVersion>
|
||||
<microcodeVersion>0</microcodeVersion>
|
||||
<package></package>
|
||||
<arch>riscv32</arch>
|
||||
<machine name='spike_v1.10' maxCpus='1'/>
|
||||
<machine name='spike_v1.9.1' maxCpus='1'/>
|
||||
<machine name='sifive_e' maxCpus='1'/>
|
||||
<machine name='virt' maxCpus='8'/>
|
||||
<machine name='sifive_u' maxCpus='1'/>
|
||||
</qemuCaps>
|
14819
tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies
Normal file
14819
tests/qemucapabilitiesdata/caps_3.0.0.riscv64.replies
Normal file
File diff suppressed because it is too large
Load Diff
118
tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml
Normal file
118
tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml
Normal file
@ -0,0 +1,118 @@
|
||||
<qemuCaps>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
<usedQMP/>
|
||||
<flag name='scsi-disk.channel'/>
|
||||
<flag name='scsi-block'/>
|
||||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='scsi-cd'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
<flag name='seccomp-sandbox'/>
|
||||
<flag name='reboot-timeout'/>
|
||||
<flag name='seamless-migration'/>
|
||||
<flag name='block-commit'/>
|
||||
<flag name='vnc'/>
|
||||
<flag name='drive-mirror'/>
|
||||
<flag name='blockdev-snapshot-sync'/>
|
||||
<flag name='device-video-primary'/>
|
||||
<flag name='add-fd'/>
|
||||
<flag name='nbd-server'/>
|
||||
<flag name='virtio-rng'/>
|
||||
<flag name='rng-random'/>
|
||||
<flag name='rng-egd'/>
|
||||
<flag name='tpm-passthrough'/>
|
||||
<flag name='scsi-generic'/>
|
||||
<flag name='scsi-generic.bootindex'/>
|
||||
<flag name='mem-merge'/>
|
||||
<flag name='vnc-websocket'/>
|
||||
<flag name='drive-discard'/>
|
||||
<flag name='mlock'/>
|
||||
<flag name='device-del-event'/>
|
||||
<flag name='virtio-mmio'/>
|
||||
<flag name='boot-strict'/>
|
||||
<flag name='spiceport'/>
|
||||
<flag name='msg-timestamp'/>
|
||||
<flag name='active-commit'/>
|
||||
<flag name='change-backing-file'/>
|
||||
<flag name='memory-backend-ram'/>
|
||||
<flag name='numa'/>
|
||||
<flag name='memory-backend-file'/>
|
||||
<flag name='splash-timeout'/>
|
||||
<flag name='iothread'/>
|
||||
<flag name='migrate-rdma'/>
|
||||
<flag name='drive-iotune-max'/>
|
||||
<flag name='machine-vmport-opt'/>
|
||||
<flag name='aes-key-wrap'/>
|
||||
<flag name='dea-key-wrap'/>
|
||||
<flag name='vhost-user-multiqueue'/>
|
||||
<flag name='migration-event'/>
|
||||
<flag name='virtio-net'/>
|
||||
<flag name='gic-version'/>
|
||||
<flag name='incoming-defer'/>
|
||||
<flag name='virtio-gpu'/>
|
||||
<flag name='virtio-keyboard'/>
|
||||
<flag name='virtio-mouse'/>
|
||||
<flag name='virtio-tablet'/>
|
||||
<flag name='virtio-input-host'/>
|
||||
<flag name='chardev-file-append'/>
|
||||
<flag name='vserport-change-event'/>
|
||||
<flag name='virtio-balloon-pci.deflate-on-oom'/>
|
||||
<flag name='chardev-logfile'/>
|
||||
<flag name='debug-threads'/>
|
||||
<flag name='secret'/>
|
||||
<flag name='device-tray-moved-event'/>
|
||||
<flag name='name-guest'/>
|
||||
<flag name='drive-detect-zeroes'/>
|
||||
<flag name='tls-creds-x509'/>
|
||||
<flag name='smm'/>
|
||||
<flag name='query-hotpluggable-cpus'/>
|
||||
<flag name='drive-iotune-max-length'/>
|
||||
<flag name='query-qmp-schema'/>
|
||||
<flag name='gluster.debug_level'/>
|
||||
<flag name='vhost-scsi'/>
|
||||
<flag name='drive-iotune-group'/>
|
||||
<flag name='block-write-threshold'/>
|
||||
<flag name='query-named-block-nodes'/>
|
||||
<flag name='kernel-irqchip'/>
|
||||
<flag name='kernel-irqchip.split'/>
|
||||
<flag name='virtio.iommu_platform'/>
|
||||
<flag name='loadparm'/>
|
||||
<flag name='vnc-multi-servers'/>
|
||||
<flag name='chardev-reconnect'/>
|
||||
<flag name='virtio-gpu.max_outputs'/>
|
||||
<flag name='vxhs'/>
|
||||
<flag name='numa.dist'/>
|
||||
<flag name='disk-share-rw'/>
|
||||
<flag name='iscsi.password-secret'/>
|
||||
<flag name='dump-completed'/>
|
||||
<flag name='qcow2-luks'/>
|
||||
<flag name='seccomp-blacklist'/>
|
||||
<flag name='query-cpus-fast'/>
|
||||
<flag name='disk-write-cache'/>
|
||||
<flag name='nbd-tls'/>
|
||||
<flag name='pr-manager-helper'/>
|
||||
<flag name='qom-list-properties'/>
|
||||
<flag name='memory-backend-file.discard-data'/>
|
||||
<flag name='sdl-gl'/>
|
||||
<flag name='screendump_device'/>
|
||||
<flag name='blockdev-del'/>
|
||||
<flag name='vhost-vsock'/>
|
||||
<flag name='chardev-fd-pass'/>
|
||||
<flag name='tpm-emulator'/>
|
||||
<flag name='egl-headless'/>
|
||||
<version>3000000</version>
|
||||
<kvmVersion>0</kvmVersion>
|
||||
<microcodeVersion>0</microcodeVersion>
|
||||
<package></package>
|
||||
<arch>riscv64</arch>
|
||||
<machine name='spike_v1.10' maxCpus='1'/>
|
||||
<machine name='spike_v1.9.1' maxCpus='1'/>
|
||||
<machine name='sifive_e' maxCpus='1'/>
|
||||
<machine name='virt' maxCpus='8'/>
|
||||
<machine name='sifive_u' maxCpus='1'/>
|
||||
</qemuCaps>
|
@ -191,6 +191,8 @@ mymain(void)
|
||||
DO_TEST("s390x", "caps_2.10.0");
|
||||
DO_TEST("s390x", "caps_2.11.0");
|
||||
DO_TEST("s390x", "caps_2.12.0");
|
||||
DO_TEST("riscv32", "caps_3.0.0");
|
||||
DO_TEST("riscv64", "caps_3.0.0");
|
||||
|
||||
/*
|
||||
* Run "tests/qemucapsprobe /path/to/qemu/binary >foo.replies"
|
||||
|
@ -28,6 +28,8 @@ typedef enum {
|
||||
TEST_UTILS_QEMU_BIN_ARM,
|
||||
TEST_UTILS_QEMU_BIN_PPC64,
|
||||
TEST_UTILS_QEMU_BIN_PPC,
|
||||
TEST_UTILS_QEMU_BIN_RISCV32,
|
||||
TEST_UTILS_QEMU_BIN_RISCV64,
|
||||
TEST_UTILS_QEMU_BIN_S390X
|
||||
} QEMUBinType;
|
||||
|
||||
@ -38,6 +40,8 @@ static const char *QEMUBinList[] = {
|
||||
"/usr/bin/qemu-system-arm",
|
||||
"/usr/bin/qemu-system-ppc64",
|
||||
"/usr/bin/qemu-system-ppc",
|
||||
"/usr/bin/qemu-system-riscv32",
|
||||
"/usr/bin/qemu-system-riscv64",
|
||||
"/usr/bin/qemu-system-s390x"
|
||||
};
|
||||
|
||||
@ -294,6 +298,68 @@ static int testQemuAddPPCGuest(virCapsPtr caps)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int testQemuAddRISCV32Guest(virCapsPtr caps)
|
||||
{
|
||||
static const char *names[] = { "spike_v1.10",
|
||||
"spike_v1.9.1",
|
||||
"sifive_e",
|
||||
"virt",
|
||||
"sifive_u" };
|
||||
static const int nmachines = ARRAY_CARDINALITY(names);
|
||||
virCapsGuestMachinePtr *machines = NULL;
|
||||
virCapsGuestPtr guest;
|
||||
|
||||
machines = virCapabilitiesAllocMachines(names, nmachines);
|
||||
if (!machines)
|
||||
goto error;
|
||||
|
||||
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_RISCV32,
|
||||
QEMUBinList[TEST_UTILS_QEMU_BIN_RISCV32],
|
||||
NULL, nmachines, machines);
|
||||
if (!guest)
|
||||
goto error;
|
||||
|
||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virCapabilitiesFreeMachines(machines, nmachines);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int testQemuAddRISCV64Guest(virCapsPtr caps)
|
||||
{
|
||||
static const char *names[] = { "spike_v1.10",
|
||||
"spike_v1.9.1",
|
||||
"sifive_e",
|
||||
"virt",
|
||||
"sifive_u" };
|
||||
static const int nmachines = ARRAY_CARDINALITY(names);
|
||||
virCapsGuestMachinePtr *machines = NULL;
|
||||
virCapsGuestPtr guest;
|
||||
|
||||
machines = virCapabilitiesAllocMachines(names, nmachines);
|
||||
if (!machines)
|
||||
goto error;
|
||||
|
||||
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_RISCV64,
|
||||
QEMUBinList[TEST_UTILS_QEMU_BIN_RISCV64],
|
||||
NULL, nmachines, machines);
|
||||
if (!guest)
|
||||
goto error;
|
||||
|
||||
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virCapabilitiesFreeMachines(machines, nmachines);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int testQemuAddS390Guest(virCapsPtr caps)
|
||||
{
|
||||
static const char *s390_machines[] = { "s390-virtio",
|
||||
@ -440,6 +506,12 @@ virCapsPtr testQemuCapsInit(void)
|
||||
if (testQemuAddPPCGuest(caps))
|
||||
goto cleanup;
|
||||
|
||||
if (testQemuAddRISCV32Guest(caps) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (testQemuAddRISCV64Guest(caps) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (testQemuAddS390Guest(caps))
|
||||
goto cleanup;
|
||||
|
||||
|
@ -180,6 +180,12 @@ test_virCapsDomainDataLookupQEMU(const void *data ATTRIBUTE_UNUSED)
|
||||
CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, "/usr/bin/qemu-system-ppc64", NULL,
|
||||
VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_PPC64,
|
||||
VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-ppc64", "pseries");
|
||||
CAPSCOMP(-1, VIR_ARCH_RISCV32, VIR_DOMAIN_VIRT_NONE, NULL, NULL,
|
||||
VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_RISCV32,
|
||||
VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-riscv32", "spike_v1.10");
|
||||
CAPSCOMP(-1, VIR_ARCH_RISCV64, VIR_DOMAIN_VIRT_NONE, NULL, NULL,
|
||||
VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_RISCV64,
|
||||
VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-riscv64", "spike_v1.10");
|
||||
CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, NULL, "s390-virtio",
|
||||
VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_S390X,
|
||||
VIR_DOMAIN_VIRT_QEMU, "/usr/bin/qemu-system-s390x",
|
||||
|
Loading…
Reference in New Issue
Block a user