From nobody Tue Aug 25 02:41:03 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 ARC-Seal: i=1; a=rsa-sha256; t=1779486895; cv=none; d=zohomail.com; s=zohoarc; b=kUp9yKIYnPvVBT6T4vbsDQdW7ePG/S3EOn/XJxdkXfdNSsdVXynlQ19yYR91acRt4te1L4CjCuGfWxxlJBBIiMnHI9tXlIw6Zrgxm7eu0aBm71FMPSIiTL14RfWY0BRTdWCvsfHgVmVOWZ9rcxdhg/1uT2t2uFcPILfVe0z6MTw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779486895; h=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=YMelEKV3Ycept7oo3lb3YVsoa0r5K9dAO5pOh5Krnbs=; b=kxTlSfgTM/xdjM4oyxqP0dk0EaCcRf7OwLkdCArcRySPa4N0FpbzJD844Ue9VQvEHfN19j39wxAAMa+NgZrwFIJHUEK+DEgDD9OSmbntjIq+ddNnr/VwNkcrweSpdFqNe99cnjArPA6WZj5XynTdB57pGw5BpPJaU5HXg2WqJAE= 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 Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177948689547090.49173787720338; Fri, 22 May 2026 14:54:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wQXoe-0001AF-7U; Fri, 22 May 2026 17:54:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQXo6-0000Cb-MZ; Fri, 22 May 2026 17:53:26 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQXo3-00053K-Dz; Fri, 22 May 2026 17:53:26 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id CFAB61AFB85; Sat, 23 May 2026 00:49:21 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 05F7D3B71D4; Sat, 23 May 2026 00:49:26 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1779486561; bh=t4CYhJA8XOnr+F14j2WG0HCzMMezf8973YvwtfLOE3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pf3Qci7Cks5PKX0V9BiOwGBqIpsagdAHXxKMlbdd7GHWzMRdf+isvyWiXt0UpBmUn q99Qzz8VjfX/9RG/ULxFf70oy4XE0U8AAxKLbUbW3Zx5Ry6fHAccXFW30SUJf5xzi8 A9x5gKhQ7OSQrflPcYiayKa882vFWsfXk/7L/x4FSOR4cZLGaZ+MUBeo5Pql6+b3Gg jbmJL47+yJqX0FwvtaZSoDFaW8RkFMvNNZcJKqpo9rHGWXbWPG4RXduejURIKzMUFu sonnCVppEzaGjsB9Do5pMUWubV2BojH81670Z0Rl/MhCAlmfyz4kPZAN6F/xBQeQJk zIkRDDP17AzTQ== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Kevin Wolf , Michael Tokarev Subject: [Stable-10.2.3 143/149] block: Create DEFAULT_BLOCK_CONF macro Date: Sat, 23 May 2026 00:49:15 +0300 Message-ID: <20260522214923.807017-44-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=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 @tls.msk.ru) X-ZM-MESSAGEID: 1779486896394158500 Content-Type: text/plain; charset="utf-8" From: Kevin Wolf The property default values from include/hw/block/block.h were duplicated in scsi_bus_legacy_handle_cmdline(), allowing them to go out of sync easily. There doesn't seem a good way to avoid the duplication, but moving them next to each other in the header file should help to avoid this problem in the future. Signed-off-by: Kevin Wolf Message-ID: <20260410152314.86412-2-kwolf@redhat.com> Signed-off-by: Kevin Wolf (cherry picked from commit a1310cc6281d22ac948f4aa198dcc55d58fc039d) Signed-off-by: Michael Tokarev diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index b9b115deed..982287191e 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -482,12 +482,7 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus) Location loc; DriveInfo *dinfo; int unit; - BlockConf conf =3D { - .bootindex =3D -1, - .share_rw =3D false, - .rerror =3D BLOCKDEV_ON_ERROR_AUTO, - .werror =3D BLOCKDEV_ON_ERROR_AUTO, - }; + BlockConf conf =3D DEFAULT_BLOCK_CONF; =20 loc_push_none(&loc); for (unit =3D 0; unit <=3D bus->info->max_target; unit++) { diff --git a/include/hw/block/block.h b/include/hw/block/block.h index b4d914624e..7da643faff 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -51,6 +51,13 @@ static inline unsigned int get_physical_block_exp(BlockC= onf *conf) return exp; } =20 +#define DEFAULT_BLOCK_CONF (BlockConf) { \ + .bootindex =3D -1, \ + .share_rw =3D false, \ + .rerror =3D BLOCKDEV_ON_ERROR_AUTO, \ + .werror =3D BLOCKDEV_ON_ERROR_AUTO, \ +} + #define DEFINE_BLOCK_PROPERTIES_BASE(_state, _conf) \ DEFINE_PROP_ON_OFF_AUTO("backend_defaults", _state, \ _conf.backend_defaults, ON_OFF_AUTO_AUTO), \ --=20 2.47.3