Also add a qemuxml2argvtest to ensure that we're good.
Signed-off-by: Daniel Henrique Barboza <dbarboza(a)ventanamicro.com>
---
src/qemu/qemu_command.c | 6 ++++
.../firmware-bios-none.riscv64-latest.args | 31 +++++++++++++++++++
tests/qemuxml2argvdata/firmware-bios-none.xml | 18 +++++++++++
tests/qemuxml2argvtest.c | 2 ++
4 files changed, 57 insertions(+)
create mode 100644 tests/qemuxml2argvdata/firmware-bios-none.riscv64-latest.args
create mode 100644 tests/qemuxml2argvdata/firmware-bios-none.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7e75354902..97944dad55 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9366,6 +9366,12 @@ qemuBuildDomainLoaderCommandLine(virCommand *cmd,
break;
case VIR_DOMAIN_LOADER_TYPE_NONE:
+ if (!loader->path) {
+ virCommandAddArg(cmd, "-bios");
+ virCommandAddArg(cmd, "none");
+ }
+ break;
+
case VIR_DOMAIN_LOADER_TYPE_LAST:
/* nada */
break;
diff --git a/tests/qemuxml2argvdata/firmware-bios-none.riscv64-latest.args
b/tests/qemuxml2argvdata/firmware-bios-none.riscv64-latest.args
new file mode 100644
index 0000000000..71efe0361e
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-bios-none.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,dump-guest-core=off,memory-backend=riscv_virt_board.ram \
+-accel tcg \
+-bios none \
+-m 1024 \
+-object
'{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":1073741824}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \
+-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/qemuxml2argvdata/firmware-bios-none.xml
b/tests/qemuxml2argvdata/firmware-bios-none.xml
new file mode 100644
index 0000000000..b8604e6b8a
--- /dev/null
+++ b/tests/qemuxml2argvdata/firmware-bios-none.xml
@@ -0,0 +1,18 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>63840878-0deb-4095-97e6-fc444d9bc9fa</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='riscv64' machine='virt'>hvm</type>
+ <loader type='none'/>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <devices>
+ <emulator>/usr/bin/qemu-system-riscv64</emulator>
+ <controller type='usb' model='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 293aea60d5..660d3ffca5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1135,6 +1135,8 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("firmware-auto-efi-format-loader-raw",
"aarch64");
DO_TEST_CAPS_LATEST_PARSE_ERROR("firmware-auto-efi-format-mismatch");
+ DO_TEST_CAPS_ARCH_LATEST("firmware-bios-none", "riscv64");
+
DO_TEST_NOCAPS("clock-utc");
DO_TEST_NOCAPS("clock-localtime");
DO_TEST_NOCAPS("clock-localtime-basis-localtime");
--
2.39.2