From patchwork Fri Mar 23 18:49:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 132358 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp950746ljb; Fri, 23 Mar 2018 11:53:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELtlTFTYN7tIH5Zq6odi/PRzIFnuvxNYVm5WCoQjv8Le+7ELl3zZ522B6b4HKOzQZHw3shV8 X-Received: by 10.237.54.161 with SMTP id f30mr43830536qtb.128.1521831199408; Fri, 23 Mar 2018 11:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521831199; cv=none; d=google.com; s=arc-20160816; b=oNm43/VMc5HHxAjLbP0vxt27avhqPPL2HlbgYIUnkzvIq7SmbkLd6rqAUbOppYucFD bGbggeney4BKSsR/SapsQdp+NA17yLmRolFck4Me9C7sJBs7Ub0Q8hgr5WMudj4N4vo2 X82cwFuY4nb/Bxd0yvlsG+BouZj2xDdsClnezXLspKuL7nAmiJvUHcORqLi3vwbV/c/U tBcl1CdR+SePZFd3p34yUcQbKBf/nJHCPR1mGmTpgWYzBAwesVC0Oi0/T8eCsYVfhHdC 7buibrFzMN+bRBVU76DM3A9cBVfLWWz/NK4W68V/G+4jypveLZHOvbCTrwYgrs8utZUj DVxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=XB7+UJoM8Min2ezrRwoE/7pncWNWRUyJVX8OCIWJ+7Y=; b=y36qAUuaIfoGegidwTfboZfpkByPR3Cv6vbn1FuCYrS2sJuNjTrWlbwtcTumnSc+1j UDwqz1f4YZUa4VigfEq1rIQTJeJ0Y1C6Fw/iTEWh6Wwlb0wr6LjEc+zTXzdXK+T4E36w AogRO/FJJx0NGVZ5jLYq3XBi95sdRHdPJfz+5EEDijvmfF+OJtwFjUSlF5wM3gwwIFp7 ZkzHm0WkoVUQd7J6B37vSAnhzLvW4dhx7X4A/fJZrnkIJnoVtMgwjJa6+125Py1z1YH8 V814BAVqzyx2MumFrM3Zwnv+WyIwWhacpca7BqadPgSP6XUkA3WyFxkFgdV2y+FRp6x8 B45A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j9si570260qkm.75.2018.03.23.11.53.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 23 Mar 2018 11:53:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezRoU-0002WL-Qc for patch@linaro.org; Fri, 23 Mar 2018 14:53:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezRlO-00018I-23 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 14:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezRlN-0004Fd-3a for qemu-devel@nongnu.org; Fri, 23 Mar 2018 14:50:06 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:40510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezRlM-0004EB-Ss for qemu-devel@nongnu.org; Fri, 23 Mar 2018 14:50:05 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1ezRlL-0007fu-JK for qemu-devel@nongnu.org; Fri, 23 Mar 2018 18:50:03 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:49:54 +0000 Message-Id: <20180323184958.14252-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323184958.14252-1-peter.maydell@linaro.org> References: <20180323184958.14252-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 06/10] mach-virt: Set VM's SMBIOS system version to mc->name X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Wei Huang Instead of using "1.0" as the system version of SMBIOS, we should use mc->name for mach-virt machine type to be consistent other architectures. With this patch, "dmidecode -t 1" (e.g., "-M virt-2.12,accel=kvm") will show: Handle 0x0100, DMI type 1, 27 bytes System Information Manufacturer: QEMU Product Name: KVM Virtual Machine Version: virt-2.12 Serial Number: Not Specified ... instead of: Handle 0x0100, DMI type 1, 27 bytes System Information Manufacturer: QEMU Product Name: KVM Virtual Machine Version: 1.0 Serial Number: Not Specified ... For backward compatibility, we allow older machine types to keep "1.0" as the default system version. Signed-off-by: Wei Huang Reviewed-by: Andrew Jones Message-id: 20180322212318.7182-1-wei@redhat.com Signed-off-by: Peter Maydell --- include/hw/arm/virt.h | 1 + hw/arm/virt.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) -- 2.16.2 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 33b0ff3892..ba0c1a4faa 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -85,6 +85,7 @@ typedef struct { bool no_its; bool no_pmu; bool claim_edge_triggered_timers; + bool smbios_old_sys_ver; } VirtMachineClass; typedef struct { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 2c07245047..94dcb125d3 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1132,6 +1132,8 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size) static void virt_build_smbios(VirtMachineState *vms) { + MachineClass *mc = MACHINE_GET_CLASS(vms); + VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); uint8_t *smbios_tables, *smbios_anchor; size_t smbios_tables_len, smbios_anchor_len; const char *product = "QEMU Virtual Machine"; @@ -1145,7 +1147,8 @@ static void virt_build_smbios(VirtMachineState *vms) } smbios_set_defaults("QEMU", product, - "1.0", false, true, SMBIOS_ENTRY_POINT_30); + vmc->smbios_old_sys_ver ? "1.0" : mc->name, false, + true, SMBIOS_ENTRY_POINT_30); smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len, &smbios_anchor, &smbios_anchor_len); @@ -1646,8 +1649,11 @@ static void virt_2_11_instance_init(Object *obj) static void virt_machine_2_11_options(MachineClass *mc) { + VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + virt_machine_2_12_options(mc); SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_11); + vmc->smbios_old_sys_ver = true; } DEFINE_VIRT_MACHINE(2, 11)