Signed-off-by: Lubomir Rintel <lkundrak(a)v3.sk>
---
src/qemu/qemu_domain.c | 22 ++++++++++++++++++++++
src/qemu/qemu_domain.h | 3 +++
2 files changed, 25 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 60b4a9b412..b43e9b76d4 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9477,6 +9477,28 @@ qemuDomainMachineIsARMVirt(const char *machine,
}
+bool
+qemuDomainIsRISCVVirt(const virDomainDef *def)
+{
+ return qemuDomainMachineIsRISCVVirt(def->os.machine, def->os.arch);
+}
+
+
+bool
+qemuDomainMachineIsRISCVVirt(const char *machine,
+ const virArch arch)
+{
+ if (!ARCH_IS_RISCV(arch))
+ return false;
+
+ if (STRNEQ(machine, "virt") &&
+ !STRPREFIX(machine, "virt-"))
+ return false;
+
+ return true;
+}
+
+
bool
qemuDomainIsPSeries(const virDomainDef *def)
{
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 898b5b4479..be9c4b7d61 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -810,6 +810,7 @@ bool qemuDomainHasPCIeRoot(const virDomainDef *def);
bool qemuDomainNeedsFDC(const virDomainDef *def);
bool qemuDomainIsS390CCW(const virDomainDef *def);
bool qemuDomainIsARMVirt(const virDomainDef *def);
+bool qemuDomainIsRISCVVirt(const virDomainDef *def);
bool qemuDomainIsPSeries(const virDomainDef *def);
bool qemuDomainHasBuiltinIDE(const virDomainDef *def);
@@ -819,6 +820,8 @@ bool qemuDomainMachineNeedsFDC(const char *machine);
bool qemuDomainMachineIsS390CCW(const char *machine);
bool qemuDomainMachineIsARMVirt(const char *machine,
const virArch arch);
+bool qemuDomainMachineIsRISCVVirt(const char *machine,
+ const virArch arch);
bool qemuDomainMachineIsPSeries(const char *machine,
const virArch arch);
bool qemuDomainMachineHasBuiltinIDE(const char *machine);
--
2.17.1