From nobody Fri Apr 3 01:25:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1774457143; cv=none; d=zohomail.com; s=zohoarc; b=QFL05yHBUwndmSGOCuhfijz90Yh6nFI+aRvsc1+wBZ/SQrBoL57pLbqkHK0rCLjg8lzyEfVYk/g9TG5wa+0YcQMT3do/wQyo2gYF8QMyY1tbvd/5dBEM4IGTqeM+0BWS4W4ykvSreW4LCMqVnwBpY1LGRqIhNvsgxmtWTAOf4PY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774457143; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UUgZYDFnXbpRFKsK/7IcqnW5+bod3HtrYWPP2Q8eSRg=; b=R9+DTDvvKElgnsesmmuTLNCOpu81nbwKyNVD5j+SN17GBM31I8ZIwaBYoiKDaInuCm5s18yxNmPM2v/E0GGS/ITHP5Ke3J039pe5Drkb4lCigPORcp4WVCZKsAkhF2pdeWQRr/v5Pjkyd7bNbJET55MCXWZhP5iPv9rUU9cm8ZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774457143059686.8063591720546; Wed, 25 Mar 2026 09:45:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w5RLy-0004oL-UY; Wed, 25 Mar 2026 12:45:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w5RLw-0004n9-MA for qemu-devel@nongnu.org; Wed, 25 Mar 2026 12:45:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w5RLu-0004bC-SH for qemu-devel@nongnu.org; Wed, 25 Mar 2026 12:45:08 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-480-IapqCzNyMH-qUQuL1xdv4g-1; Wed, 25 Mar 2026 12:45:04 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48532df52c5so555945e9.1 for ; Wed, 25 Mar 2026 09:45:04 -0700 (PDT) Received: from [192.168.10.48] ([151.49.85.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4871e5ec998sm6608935e9.6.2026.03.25.09.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2026 09:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774457106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UUgZYDFnXbpRFKsK/7IcqnW5+bod3HtrYWPP2Q8eSRg=; b=bh2zjm5zsU4Gi6ljWp8w5zXDPqYKuxETzVvBJKeCxX/xP11ZfSmDabQ4BmTNuKj+LuZ0HD eHvO6NZm5SyWY55+3rvB1StzcKSbPcHbn3OKS5s3WecRDhNj64u8/BCdYxUCHPlljhJuxl pMbrF5siEstSXGFDfCzhPIbdbnH3+Ok= X-MC-Unique: IapqCzNyMH-qUQuL1xdv4g-1 X-Mimecast-MFC-AGG-ID: IapqCzNyMH-qUQuL1xdv4g_1774457104 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1774457103; x=1775061903; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UUgZYDFnXbpRFKsK/7IcqnW5+bod3HtrYWPP2Q8eSRg=; b=XVs/j2ITGuaU4stnOZNxaOTo/z0mKaPsyUzx4cFImSyV3GTXzAaVwRy3BEnDnmf/kx YxcQMzOSKHDhhd5fTJUF1uPv/qg+GCPZqStKBcrXNPq+zVKxwcJheqFYQ9k2w+RIj5Px Ih3o9zJSBLWtP3Pag93zyKEbc/6nOPyCifMurscbXUey+GG5tIA1YFbvgoLOWEbxpyqF CalerPBiy1Y3C1Z+hXxYbajWWxAFQQBVmbRA2Rj7/MtQxCEpgwdoeGy4DwKbvf7nx1QV gJVgG/iHiiYAzzCw9eERX4gUQX69DJ7/SZ3jwHlnqTof6cg/X2ygohrI05s72lP/KzPk 049A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774457103; x=1775061903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UUgZYDFnXbpRFKsK/7IcqnW5+bod3HtrYWPP2Q8eSRg=; b=qCel54JpthKpzH424QOt/walp+np+ypg9E6B+WwEU2akDQWUWQTmXo3SHtOW7XBObD EHmn1GclqrR3jkTaFVO9auReoB4gCkMSaPmFwrq+GwN3s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 2026 09:45:02 -0700 (PDT) X-Received: by 2002:a05:600c:4705:b0:485:a4de:f4f9 with SMTP id 5b1f17b1804b1-4871608406dmr68357455e9.27.1774457101754; Wed, 25 Mar 2026 09:45:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 03/19] treewide: replace qemu_hw_version() with QEMU_HW_VERSION Date: Wed, 25 Mar 2026 17:44:37 +0100 Message-ID: <20260325164453.72127-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260325164453.72127-1-pbonzini@redhat.com> References: <20260325164453.72127-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1774457144116158500 The version is never set on 2.5+ machine types, so qemu_hw_version() and qemu_set_hw_version() are not needed anymore. Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Paolo Bonzini --- include/hw/core/boards.h | 6 ------ include/qemu/hw-version.h | 18 ++++-------------- hw/ide/core.c | 2 +- hw/scsi/megasas.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/scsi/scsi-disk.c | 2 +- system/vl.c | 4 ---- target/s390x/cpu_models.c | 2 +- util/osdep.c | 12 ------------ 9 files changed, 9 insertions(+), 41 deletions(-) diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index f85f31bd90d..b8dad0a1074 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -197,11 +197,6 @@ typedef struct { * used to provide @cpu_index to socket number mapping, allowing * a machine to group CPU threads belonging to the same socket/package * Returns: socket number given cpu_index belongs to. - * @hw_version: - * Value of QEMU_VERSION when the machine was added to QEMU. - * Set only by old machines because they need to keep - * compatibility on code that exposed QEMU_VERSION to guests in - * the past (and now use qemu_hw_version()). * @possible_cpu_arch_ids: * Returns an array of @CPUArchId architecture-dependent CPU IDs * which includes CPU IDs for present and possible to hotplug CPUs. @@ -297,7 +292,6 @@ struct MachineClass { const char *default_display; const char *default_nic; GPtrArray *compat_props; - const char *hw_version; ram_addr_t default_ram_size; const char *default_cpu_type; bool default_kernel_irqchip_split; diff --git a/include/qemu/hw-version.h b/include/qemu/hw-version.h index 730a8c904d9..ce318cd8435 100644 --- a/include/qemu/hw-version.h +++ b/include/qemu/hw-version.h @@ -1,5 +1,5 @@ /* - * QEMU "hardware version" machinery + * QEMU "hardware version" constant * * This work is licensed under the terms of the GNU GPL, version 2 or late= r. * See the COPYING file in the top-level directory. @@ -8,20 +8,10 @@ #define QEMU_HW_VERSION_H =20 /* - * Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default - * instead of QEMU_VERSION, so setting hw_version on MachineClass - * is no longer mandatory. - * - * Do NOT change this string, or it will break compatibility on all - * machine classes that don't set hw_version. + * Starting on QEMU 2.5, devices with a version string in their + * identification data return "2.5+" instead of QEMU_VERSION. Do + * NOT change this string as it is visible to guests. */ #define QEMU_HW_VERSION "2.5+" =20 -/* QEMU "hardware version" setting. Used to replace code that exposed - * QEMU_VERSION to guests in the past and need to keep compatibility. - * Do not use qemu_hw_version() in new code. - */ -void qemu_set_hw_version(const char *); -const char *qemu_hw_version(void); - #endif diff --git a/hw/ide/core.c b/hw/ide/core.c index b45abf067b2..d6719dbf31d 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2660,7 +2660,7 @@ int ide_init_drive(IDEState *s, IDEDevice *dev, IDEDr= iveKind kind, Error **errp) if (dev->version) { pstrcpy(s->version, sizeof(s->version), dev->version); } else { - pstrcpy(s->version, sizeof(s->version), qemu_hw_version()); + pstrcpy(s->version, sizeof(s->version), QEMU_HW_VERSION); } =20 ide_reset(s); diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index f62e420a91e..0276886d594 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -782,7 +782,7 @@ static int megasas_ctrl_get_info(MegasasState *s, Megas= asCmd *cmd) =20 memcpy(info.product_name, base_class->product_name, 24); snprintf(info.serial_number, 32, "%s", s->hba_serial); - snprintf(info.package_version, 0x60, "%s-QEMU", qemu_hw_version()); + snprintf(info.package_version, 0x60, "%s-QEMU", QEMU_HW_VERSION); memcpy(info.image_component[0].name, "APP", 3); snprintf(info.image_component[0].version, 10, "%s-QEMU", base_class->product_version); diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 9b8656dd832..1a6b181b9d6 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -703,7 +703,7 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *= r) r->buf[7] =3D 0x10 | (r->req.bus->info->tcq ? 0x02 : 0); /* Sync, = TCQ. */ memcpy(&r->buf[8], "QEMU ", 8); memcpy(&r->buf[16], "QEMU TARGET ", 16); - pstrcpy((char *) &r->buf[32], 4, qemu_hw_version()); + pstrcpy((char *) &r->buf[32], 4, QEMU_HW_VERSION); } return true; } diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index a5201855352..5ba5b46c4f4 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2543,7 +2543,7 @@ static void scsi_realize(SCSIDevice *dev, Error **err= p) } =20 if (!s->version) { - s->version =3D g_strdup(qemu_hw_version()); + s->version =3D g_strdup(QEMU_HW_VERSION); } if (!s->vendor) { s->vendor =3D g_strdup("QEMU"); diff --git a/system/vl.c b/system/vl.c index 38d7b849e0a..246623b3196 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2212,10 +2212,6 @@ static void qemu_create_machine(QDict *qdict) =20 cpu_exec_init_all(); =20 - if (machine_class->hw_version) { - qemu_set_hw_version(machine_class->hw_version); - } - /* * Get the default machine options from the machine if it is not alrea= dy * specified either by the configuration file or by the command line. diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 954a7a99a9e..0b88868289b 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -955,7 +955,7 @@ static void s390_qemu_cpu_model_class_init(ObjectClass = *oc, const void *data) =20 xcc->is_migration_safe =3D true; xcc->desc =3D g_strdup_printf("QEMU Virtual CPU version %s", - qemu_hw_version()); + QEMU_HW_VERSION); } =20 static void s390_max_cpu_model_class_init(ObjectClass *oc, const void *dat= a) diff --git a/util/osdep.c b/util/osdep.c index 000e7daac8b..4a8b8b5a90f 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -31,8 +31,6 @@ #include "qemu/hw-version.h" #include "monitor/monitor.h" =20 -static const char *hw_version =3D QEMU_HW_VERSION; - int socket_set_cork(int fd, int v) { #if defined(SOL_TCP) && defined(TCP_CORK) @@ -533,16 +531,6 @@ ssize_t qemu_send_full(int s, const void *buf, size_t = count) return total; } =20 -void qemu_set_hw_version(const char *version) -{ - hw_version =3D version; -} - -const char *qemu_hw_version(void) -{ - return hw_version; -} - #ifdef _WIN32 static void socket_cleanup(void) { --=20 2.53.0