From patchwork Wed Sep 23 14:18:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 521713 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BAA7B1401DE for ; Thu, 24 Sep 2015 00:18:44 +1000 (AEST) Received: from localhost ([::1]:48099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zeksc-0007N3-KI for incoming@patchwork.ozlabs.org; Wed, 23 Sep 2015 10:18:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeksK-00075E-EJ for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:18:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeksH-0001oC-9U for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:18:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeksH-0001o6-4v for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:18:21 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 075D0C0B2E05; Wed, 23 Sep 2015 14:18:20 +0000 (UTC) Received: from apm-mustang-ev3-03.lab.eng.brq.redhat.com (apm-mustang-ev3-03.lab.eng.brq.redhat.com [10.34.42.82]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8NEIIS3002378; Wed, 23 Sep 2015 10:18:18 -0400 From: Andrew Jones To: qemu-devel@nongnu.org Date: Wed, 23 Sep 2015 16:18:12 +0200 Message-Id: <1443017892-15567-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: wei@redhat.com, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH] hw/arm/virt: smbios: inform guest of kvm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org ARM/AArch64 KVM guests don't have any way to identify themselves as KVM guests (x86 guests use a CPUID leaf). Now, we could discuss all sorts of reasons why guests shouldn't need to know that, but then there's always some case where it'd be nice... Anyway, now that we have SMBIOS tables in ARM guests, it's easy for the guest to know that it's a QEMU instance. This patch takes that one step further, also identifying KVM, when appropriate. Again, we could debate why generally nothing should care whether it's of type QEMU or QEMU/KVM, but again, sometimes it's nice to know... Signed-off-by: Andrew Jones Reviewed-by: Wei Huang --- hw/arm/virt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 6bf0d6d591d6c..607d448354a8c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -855,12 +855,17 @@ static void virt_build_smbios(VirtGuestInfo *guest_info) FWCfgState *fw_cfg = guest_info->fw_cfg; uint8_t *smbios_tables, *smbios_anchor; size_t smbios_tables_len, smbios_anchor_len; + const char *product = "QEMU Virtual Machine"; if (!fw_cfg) { return; } - smbios_set_defaults("QEMU", "QEMU Virtual Machine", + if (kvm_enabled()) { + product = "KVM Virtual Machine"; + } + + smbios_set_defaults("QEMU", product, "1.0", false, true, SMBIOS_ENTRY_POINT_30); smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,