From nobody Fri May 17 07:07:39 2024 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=reject dis=none) header.from=brun.one ARC-Seal: i=1; a=rsa-sha256; t=1710519266; cv=none; d=zohomail.com; s=zohoarc; b=AjS2LWQSSYRAR4lEwXVsY2KmvAIkQ5bqUIsIaPcXyxzVxDMXwxuts2c2aX8+ZJZjQihFxVvnYcDFE+5GNPBbHIIdF442JKZhxNvyh4e5Zd0ZHn7uUqbOm87L2w9MdBzJWYo1RFbDCgiiOmzaW8XOdDnYO6EXspsAq2sTUkEizYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710519266; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=q71kjRy1vgrW30Iwwa+K3qmXkGojyqby1TCUGLaZCwI=; b=KlwnhwlsiYhRPZU5ZiBNLGCp/r2twA6FaFhYNhiiWSsnO4rqU/W29TXYw5TcJyxAcY04iEIyeHsYsNnAfJGDGD0Gx9PdUfvvZAHU8H+lvA6MXDaVWs507FpgdZ8huf2S9IGEJe+YLtOiA8yF1ICL8m/IyyJyQYs77WwhdJ10A+g= 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=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710519266801740.7283629669953; Fri, 15 Mar 2024 09:14:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlABZ-0001YG-7c; Fri, 15 Mar 2024 12:13:33 -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 1rl91I-0007iI-Hz for qemu-devel@nongnu.org; Fri, 15 Mar 2024 10:58:52 -0400 Received: from s2.dolansoft.org ([212.51.146.245] helo=mx.dolansoft.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rl91G-0005oE-Dh for qemu-devel@nongnu.org; Fri, 15 Mar 2024 10:58:52 -0400 Received: from [212.51.153.89] (helo=localhost.localdomain) by mx.dolansoft.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rl91A-000bvY-2e; Fri, 15 Mar 2024 14:58:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=brun.one; s=s1; h=MIME-Version:Message-ID:Date:Subject:Cc:To:From:In-Reply-To: References:From:To:Subject:Date:Message-ID:Reply-To; bh=q71kjRy1vgrW30Iwwa+K3qmXkGojyqby1TCUGLaZCwI=; b=KWsaEmWjLLmFA9teN/MSlDWCY/ 6q+6uh+TJyuSiEzrtt176fqeFqOHJwsJU+cVZUClNtstWftWoaByRwj9X4iwo/ANe/RnUnjWDuOjK xAtBJcy2uBvmPmorSeD/E5cQdAiZaI4uyn3dJezjzpixN2cwvHSCiLDBtTrcMUBegiRpxIY+41xYA 3cYWPYlPOeZIipZn49DoSO5NyHVwxwWj5I8KeHG+WmnPhgEoJq9y0oUKwQIkOlm3Cn9FuDY4BUsPs XvL+dcRSSDrBzH9O9phRIU2l/vJ3dscuFCsT9+8i/LFxoEPodg1jrQ5ScOKSlaG4woNyAbdewvsqW yzN92W5A==; From: Lorenz Brun To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Fam Zheng Subject: [PATCH] scsi-generic: fix io_timeout property not applying Date: Fri, 15 Mar 2024 15:58:31 +0100 Message-ID: <20240315145831.2531695-1-lorenz@brun.one> 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=lists.gnu.org; Received-SPF: pass client-ip=212.51.146.245; envelope-from=lorenz@brun.one; helo=mx.dolansoft.org 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 15 Mar 2024 12:13:31 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 @brun.one) X-ZM-MESSAGEID: 1710519268996100003 Content-Type: text/plain; charset="utf-8" The io_timeout property, introduced in c9b6609 (part of 6.0) is silently overwritten by the hardcoded default value of 30 seconds (DEFAULT_IO_TIMEOUT) in scsi_generic_realize because that function is being called after the properties have already been applied. The property definition already has a default value which is applied correctly when no value is explicitly set, so we can just remove the code which overrides the io_timeout completely. This has been tested by stracing SG_IO operations with the io_timeout property set and unset and now sets the timeout field in the ioctl request to the proper value. Fixes: c9b6609b69facad ("scsi: make io_timeout configurable") Signed-off-by: Lorenz Brun Reviewed-by: Alex Benn=C3=A9e --- hw/scsi/scsi-generic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index b7b04e1d63..ee945f87e3 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -752,7 +752,6 @@ static void scsi_generic_realize(SCSIDevice *s, Error *= *errp) =20 /* Only used by scsi-block, but initialize it nevertheless to be clean= . */ s->default_scsi_version =3D -1; - s->io_timeout =3D DEFAULT_IO_TIMEOUT; scsi_generic_read_device_inquiry(s); } =20 --=20 2.42.0