The 'aia' feature is added as a machine type option for the 'virt' RISC-V machine, e.g. "-machine virt,aia=<val>". Signed-off-by: Daniel Henrique Barboza <dbarboza@xxxxxxxxxxxxxxxx> --- src/qemu/qemu_command.c | 5 +++ ...cv64-virt-features-aia.riscv64-latest.args | 31 +++++++++++++++++++ ...scv64-virt-features-aia.riscv64-latest.xml | 1 + .../riscv64-virt-features-aia.xml | 27 ++++++++++++++++ tests/qemuxmlconftest.c | 2 ++ 5 files changed, 66 insertions(+) create mode 100644 tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args create mode 120000 tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml create mode 100644 tests/qemuxmlconfdata/riscv64-virt-features-aia.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a5ff7695c3..2637138481 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6712,6 +6712,11 @@ qemuAppendDomainFeaturesMachineParam(virBuffer *buf, virBufferAsprintf(buf, ",i8042=%s", str); } + if (def->features[VIR_DOMAIN_FEATURE_AIA] != VIR_DOMAIN_AIA_NONE) { + const char *str = virDomainAIATypeToString(def->features[VIR_DOMAIN_FEATURE_AIA]); + virBufferAsprintf(buf, ",aia=%s", str); + } + return 0; } diff --git a/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args new file mode 100644 index 0000000000..75b0f1e425 --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine virt,usb=off,aia=aplic-imsic,dump-guest-core=off,memory-backend=riscv_virt_board.ram,acpi=off \ +-accel tcg \ +-cpu rv64 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml new file mode 120000 index 0000000000..1ab55fc10e --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml @@ -0,0 +1 @@ +riscv64-virt-features-aia.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/riscv64-virt-features-aia.xml b/tests/qemuxmlconfdata/riscv64-virt-features-aia.xml new file mode 100644 index 0000000000..708a2886f9 --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-virt-features-aia.xml @@ -0,0 +1,27 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <aia value='aplic-imsic'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>rv64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 9bcd937447..5fc011d41e 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2921,6 +2921,8 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-q35-4.2", "x86_64"); DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-features", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-features-aia", "riscv64"); + DO_TEST_CAPS_LATEST("virtio-9p-multidevs"); DO_TEST_CAPS_LATEST("virtio-9p-createmode"); -- 2.45.2