From: Kristina Hanicova Date: Tue, 30 Apr 2024 14:32:39 +0000 (+0200) Subject: qemu: format machine virt ras feature and test it X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c95cc67efb21518a3a4d3aecc16ab51e38f5d4a1;p=libvirt.git qemu: format machine virt ras feature and test it Resolves: https://issues.redhat.com/browse/RHEL-7489 Signed-off-by: Kristina Hanicova Reviewed-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8d4442c360..807f013713 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6858,6 +6858,11 @@ qemuAppendDomainFeaturesMachineParam(virBuffer *buf, virBufferAsprintf(buf, ",cap-ibs=%s", str); } + if (def->features[VIR_DOMAIN_FEATURE_RAS] != VIR_TRISTATE_SWITCH_ABSENT) { + const char *str = virTristateSwitchTypeToString(def->features[VIR_DOMAIN_FEATURE_RAS]); + virBufferAsprintf(buf, ",ras=%s", str); + } + return 0; } diff --git a/tests/qemuxmlconfdata/aarch64-features-ras.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-features-ras.aarch64-latest.args new file mode 100644 index 0000000000..f903d7152f --- /dev/null +++ b/tests/qemuxmlconfdata/aarch64-features-ras.aarch64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=aarch64test,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ +-machine virt,usb=off,gic-version=3,ras=on,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ +-accel kvm \ +-cpu host \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,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/aarch64-features-ras.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-features-ras.aarch64-latest.xml new file mode 120000 index 0000000000..4abae8df8c --- /dev/null +++ b/tests/qemuxmlconfdata/aarch64-features-ras.aarch64-latest.xml @@ -0,0 +1 @@ +aarch64-features-ras.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/aarch64-features-ras.xml b/tests/qemuxmlconfdata/aarch64-features-ras.xml new file mode 100644 index 0000000000..bbe948dc97 --- /dev/null +++ b/tests/qemuxmlconfdata/aarch64-features-ras.xml @@ -0,0 +1,26 @@ + + aarch64test + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 1048576 + 1048576 + 1 + + hvm + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 6165bb6f1d..619686b9a7 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2643,6 +2643,8 @@ mymain(void) /* SVE aarch64 CPU features work on modern QEMU */ DO_TEST_CAPS_ARCH_LATEST("aarch64-features-sve", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-features-ras", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("clock-timer-armvtimer", "aarch64"); qemuTestSetHostArch(&driver, VIR_ARCH_NONE);