Skip to contentSkip to conversation

hw/loongarch/virt: inform guest of kvm

PATCH In review Qiang Ma 3 participants 3 messages Jun 3, 2025

lore
Share & tools
lore

Qiang Ma

author
#0 lore raw

PATCH 1/1 hw/loongarch/virt: inform guest of kvm

Commit bab27ea2e3 ("hw/arm/virt: smbios:
inform guest of kvm") fixes the same issue
on arm.

without this patch:
[root@localhost ~]# virt-what
qemu

with this patch:
[root@localhost ~]# virt-what
kvm

---
 hw/loongarch/virt.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/loongarch/virt.c +4 -0
index 1b504047db..a3d449ca8b 100644
@@ -136,6 +136,10 @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms)
         return;
     }
 
+    if (kvm_enabled()) {
+        product = "KVM Virtual Machine";
+    }
+
     smbios_set_defaults("QEMU", product, mc->name);
 
     smbios_get_tables(ms, SMBIOS_ENTRY_POINT_TYPE_64,
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 33 lines · Qiang Ma

Commit bab27ea2e3 ("hw/arm/virt: smbios:
inform guest of kvm") fixes the same issue
on arm.

without this patch:
[root@localhost ~]# virt-what
qemu

with this patch:
[root@localhost ~]# virt-what
kvm

---
  hw/loongarch/virt.c | 4 ++++
  1 file changed, 4 insertions(+)
hw/loongarch/virt.c +4 -0
index 1b504047db..a3d449ca8b 100644
@@ -136,6 +136,10 @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms)
          return;
      }
 
+    if (kvm_enabled()) {
+        product = "KVM Virtual Machine";
+    }
+
      smbios_set_defaults("QEMU", product, mc->name);
 
      smbios_get_tables(ms, SMBIOS_ENTRY_POINT_TYPE_64,
Reviewed-by on v1 1/1
#2 lore raw
In reply to Qiang Ma
Quoted 8 lines · Qiang Ma

Commit bab27ea2e3 ("hw/arm/virt: smbios:
inform guest of kvm") fixes the same issue
on arm.

without this patch:
[root@localhost ~]# virt-what
qemu

Quoted 8 lines

with this patch:
[root@localhost ~]# virt-what
kvm

---
  hw/loongarch/virt.c | 4 ++++
  1 file changed, 4 insertions(+)

thanks.
Song Gao

Quoted 15 lines
hw/loongarch/virt.c +4 -0
index 1b504047db..a3d449ca8b 100644
@@ -136,6 +136,10 @@ static void virt_build_smbios(LoongArchVirtMachineState *lvms)
          return;
      }
 
+    if (kvm_enabled()) {
+        product = "KVM Virtual Machine";
+    }
+
      smbios_set_defaults("QEMU", product, mc->name);
 
      smbios_get_tables(ms, SMBIOS_ENTRY_POINT_TYPE_64,