From nobody Sun Feb 8 18:14:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1611563152; cv=none; d=zohomail.com; s=zohoarc; b=WcUeL8BFp79fRm8jvQ1Yj52/osQN6GZuN7kqRlVEs03Y6W0OCsJZW9+TiU7ybBKwoTSReOEauJfPuG/ntzofJLRuLThJR//25sF1chsJwy6r69ga59r/1B4vuorbvxERBV572Xg8FpiMUSpl6Szh9w9Gc3ZNN/pcUXTkXOlBNhg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611563152; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zdqJ9jrxaBFA24yNUAI9V7Ld1She2fQCBl/Mq8kcpvI=; b=GqVjvqgph3WlpJ5JN8Gn6pHGp+4xy72KdqHXkLSjSvvAFVUp3+M3k8G4MuDtyJSOd/W1DVriC4atq4qo/XyHYSQmqlfYzzorG951oW3uKQ5X4g+w9JPVJUtp+4Gjf6kC+JaqByBiwO6UNfhiQlhJhryuGl18QbR4BUgwNsLVUjc= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611563152770656.7949896737043; Mon, 25 Jan 2021 00:25:52 -0800 (PST) Received: from localhost ([::1]:52604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3xC3-0005RY-G4 for importer@patchew.org; Mon, 25 Jan 2021 03:25:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3x8s-00046c-Qx; Mon, 25 Jan 2021 03:22:34 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3x8r-0006Yr-3Q; Mon, 25 Jan 2021 03:22:34 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E3C675C00CE; Mon, 25 Jan 2021 03:22:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 25 Jan 2021 03:22:31 -0500 Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id CA36E1080059; Mon, 25 Jan 2021 03:22:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=zdqJ9jrxaBFA2 4yNUAI9V7Ld1She2fQCBl/Mq8kcpvI=; b=D3vrh25JW4xd+9/uKVrYLoT5ezNrO YYvjgu55U29Y1EU6KTbtrcBRtZusq999ICVSerIAiDlAypKPbe7dYCrXvLXr9/pX EvQQ4bggcVXSvj8qhIdBjPeiXVM7tcETEVxZc7fuoqofLQzr35PBWibLa0cChqBT 5DaOgOrRwk7/BlQnzMuhW7NHxoBDet49euYFqEwFukX562ExySUc/jv7WSDFTFKd 1hebSwHG3NukBvEsjk11iRca4oXW4FmcXT+l7NnZLsVpTI2GaQSvgl7Yb74JOOGR aBMry4TUW6Egs3PH5po29ZAxjzmOli/aKW7hQ1mb0kgC3RtPOdvcUetNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=zdqJ9jrxaBFA24yNUAI9V7Ld1She2fQCBl/Mq8kcpvI=; b=XQFn4Non gHxRHDrlFwbbyrHWNYoN0mzRgBEIH9oPpdU9NfwVskr0rtD1meChNSCzyIaKKB9E sZEOddpUr6SpeLcleWSUVt+G4HMKz5NTM/Nk2n11cXKbsDDYf4pSXwQCBn5ZpkTd lOaO35ZRqqgSFLVQhm8IpYDsvgVKdLpC28/srIjvzU4LUn9elT4egQCMYadYh/xN 4HgAMsg/ZXQ4yrhntscdGJNdIOSR5vZzAJHrVWlnXJg+bckDfP4l6NnL+b7z7grL K7AK733meHdip/9LtYrlVULQNwPqJV9SGMlfec3xyGzzIXjy8Fzf/HAj4rm27zA7 p42pPRFI8NZ3Uw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddvgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeeuleetgeeiuefhgfekfefgveejiefgteekiedtgfdtieefhfdthfefueffvefg keenucfkphepkedtrdduieejrdelkedrudeltdenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH 1/3] hw/block/nvme: fix set feature for error recovery Date: Mon, 25 Jan 2021 09:22:25 +0100 Message-Id: <20210125082227.20160-2-its@irrelevant.dk> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125082227.20160-1-its@irrelevant.dk> References: <20210125082227.20160-1-its@irrelevant.dk> 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=66.111.4.28; envelope-from=its@irrelevant.dk; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Gollu Appalanaidu , Max Reitz , Keith Busch , Klaus Jensen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Gollu Appalanaidu Only enable DULBE if the namespace supports it. Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 21aec90637fa..e7983ff422f2 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -3396,7 +3396,9 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeReq= uest *req) } =20 assert(ns); - ns->features.err_rec =3D dw11; + if (NVME_ID_NS_NSFEAT_DULBE(ns->id_ns.nsfeat)) { + ns->features.err_rec =3D dw11; + } break; case NVME_VOLATILE_WRITE_CACHE: for (i =3D 1; i <=3D n->num_namespaces; i++) { --=20 2.30.0 From nobody Sun Feb 8 18:14:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1611563180; cv=none; d=zohomail.com; s=zohoarc; b=CVAHklKitnBiS/aFNgW3ZrHxUmcnhxdxfkfYghJgJoiLR3eZGv2FyRx0NkomM2YnszI6DoHGUGAHYzJiBzSDULd/AUcAWPRiyTgXjo/OliCTPvez6XnEAmoIpLzimyk17uX16xLYgbQQZZZM3Erkq3W251meNDtxai/v/n1B4Mk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611563180; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f0G59iqwrj5VfZ0TqNozV6E4r78+iF+wO37wu5NAMmY=; b=ay2J2T3SA9TvWvqaxpG+PJMrwusfRG482TQMGkfZ35BIwLqlElfSid8HGjfiJWtzFLd03yDPiaY3MPP+fWO/ZuVQKogQ9gqttpT2olH7Q2YvTpFWCRvgs8Z9dhKP9e80EeefAR/ZXGqP7thlKGdpzq5F7YycCqZ8w7pCKrYZYNA= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611563180594812.8355718214187; Mon, 25 Jan 2021 00:26:20 -0800 (PST) Received: from localhost ([::1]:53198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3xCV-0005ft-Gf for importer@patchew.org; Mon, 25 Jan 2021 03:26:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3x8u-00046w-8q; Mon, 25 Jan 2021 03:22:36 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40401) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3x8s-0006ZZ-0Z; Mon, 25 Jan 2021 03:22:36 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3DFC05C00DF; Mon, 25 Jan 2021 03:22:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 25 Jan 2021 03:22:33 -0500 Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 121611080059; Mon, 25 Jan 2021 03:22:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=f0G59iqwrj5Vf Z0TqNozV6E4r78+iF+wO37wu5NAMmY=; b=tyLe3CX8oq1a0dVMj6iErKJfTSgGN /onzzO6a6n/vi2PnjqQw7tEku/eHrqn7BdDa1VAUMvtqLaqFji3WUBlmaISVZyy0 4HFcsPFwrUFElB0bfTyZ5HsuOGln/zIA2xLGrYXeJL0jg2/JSULzDN43kS/WpniB DjgmViXQAHf2GBPgX+8lVg6XVzmtV+R5LLv8uSyfImvfFNp8geHUn3Na/M+sjS0W z4tiA2+dXyHKgwK5hZ9oDVRbYqkBDAd9WJvNzeihS/aaf0pJchPU9SL4ZVl1ybwI Xn0o22pfq85jFf8aDEkqEo7+52pgCkD/p+V5wKtxCJN+fUXS9UPaKSYCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=f0G59iqwrj5VfZ0TqNozV6E4r78+iF+wO37wu5NAMmY=; b=gTNRe6U1 US3oDtpSllAuzzkutWs1a/hiy2RpMmzTEPGu+YmKfiFwOXaXY9eLYQ13bZX/R8bS iD8ff+EvWvGAh3ioRVovDQ+LrkXeyiZiuJqw7iqW8ybF9ZNswXbCd1THFRZxjqSY ElZIL4fJ0aOVKjXUTDiyUqLh+DIQcGo4o05eLLKltBwESWQwNRHmzUwhBi+ZUK34 DZAEYoVTC+7LlM6EAHVb/7hTtpoMzKgKExQ34CJ93Bnv2v+hne1BvDiwm4ygdAwT 9e5rhLgBYx40qvz3JqaotnwdXeKbmbZO2zFkzkBIGLOJ1Z9MUiLfO2OViGIm+YKg fKFwq9345Tg59w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddvgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeeuleetgeeiuefhgfekfefgveejiefgteekiedtgfdtieefhfdthfefueffvefg keenucfkphepkedtrdduieejrdelkedrudeltdenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH 2/3] hw/block/nvme: fix set feature save field check Date: Mon, 25 Jan 2021 09:22:26 +0100 Message-Id: <20210125082227.20160-3-its@irrelevant.dk> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125082227.20160-1-its@irrelevant.dk> References: <20210125082227.20160-1-its@irrelevant.dk> 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=66.111.4.28; envelope-from=its@irrelevant.dk; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Gollu Appalanaidu , Max Reitz , Keith Busch , Klaus Jensen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Gollu Appalanaidu Currently, no features are saveable, so the current check is not wrong, but add a check against the feature capabilities to make sure this will not regress if saveable features are added later. Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index e7983ff422f2..1be5b54e0fed 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -3324,7 +3324,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeReq= uest *req) =20 trace_pci_nvme_setfeat(nvme_cid(req), nsid, fid, save, dw11); =20 - if (save) { + if (save && !(nvme_feature_cap[fid] & NVME_FEAT_CAP_SAVE)) { return NVME_FID_NOT_SAVEABLE | NVME_DNR; } =20 --=20 2.30.0 From nobody Sun Feb 8 18:14:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1611563632; cv=none; d=zohomail.com; s=zohoarc; b=df4sPe6J+4I9Ftf6iY9eOTL3el0ibqnIbZRFlp+FVD4GuLQiMwF21T4g5NSPeTmwXmB7H9dehd7Ns6C3YH+pfFlWZZxRkkdBv0K7zIdzmkmwp57m88zxxUHrbsM6KwpQDS7l/EsSLp96yyiNCQepzvpiYYNPqKj27L0yiulEC18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611563632; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fo3koSlmVlqv/A87F7qz07Odfmyb5lVAErjyj34k2PY=; b=jG5jd3Ir4dL9KLzMWwypB1DZ62DZlIpTPm8Gia1TM/Vy3b7YIsic5//QjISZ0jx6EMlCTlQNdxAnLe0mF0FEQGwftzvgmqAIxWqN6E8RESLDm1wqbb5ZB0gqXeoMOUUCn9ReHOeze+VGIuoC8YRGtrdTQur5nFqftQwdT591ves= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611563632229820.4133373114813; Mon, 25 Jan 2021 00:33:52 -0800 (PST) Received: from localhost ([::1]:34050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3xJm-0001Dd-6u for importer@patchew.org; Mon, 25 Jan 2021 03:33:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3x8v-00047S-2M; Mon, 25 Jan 2021 03:22:37 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3x8t-0006aK-D8; Mon, 25 Jan 2021 03:22:36 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 97C125C00AC; Mon, 25 Jan 2021 03:22:34 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 25 Jan 2021 03:22:34 -0500 Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 4DA261080059; Mon, 25 Jan 2021 03:22:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=fo3koSlmVlqv/ A87F7qz07Odfmyb5lVAErjyj34k2PY=; b=V0hVxbAWkDBh4l28RGJJsi4Fx6W/c BHdLI/aA1OggMO4eBOzhEdb3kxcVk1Pz90epTPviwwjH2dUoNVnt/mWuCU2y4WcS t+Bbckf52mvLsT5BW09VU6ZWindwtCaJNY1Cx3SAQoVpbkLgqfNS24fOh8ha67fK PxZ7Kp+QxvHzW4+qMtOdVWDe3PisZiT0HpL5dNpN/nYSHnFgunzVMEKDu4LbzQRn 61DdSL/nyO0hc8kOmDSV9x3dNe5H0o7fMu7I/ic9rXoPWbAN7gm3hvE3gQXdwpza qCzBNhilIuWsRrV8lzqpsuYC0wG8Va8U+HL5nIKTPLcj1H787uB7TlYFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=fo3koSlmVlqv/A87F7qz07Odfmyb5lVAErjyj34k2PY=; b=KLsqqQVv BCciaJ7/1FBSWMQSnFbusapVEy7OEGDV1Xq6VltNJr5ihxJT0/BvyFOZK7+lnq/Q mZ6W6vS7Bs91vqXQlFigW7a6IJpvwsDFH8T1Fcr7ukPhMZLLNAWim2NlDHPwPmHu ZaEMu/Jg4oDJjCwu5LiPayy7+r8AMde6tlrrA0oDPfAYn2XeQZ9pKwep7PwolcY0 DIeeWc+gQ7mAj/58fbZTBeeBnw+fWaZz2Y+FN4DRu6ETp44FjwyG0uOJbHqFU0dG /adrSB+Q4kezFYJXNKMrXHn4Csznl2USbf7y8sgtPY61oL0ofVTLhNFZMn2iHSJl ZNRY1ZEYYEFHcQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddvgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeeuleetgeeiuefhgfekfefgveejiefgteekiedtgfdtieefhfdthfefueffvefg keenucfkphepkedtrdduieejrdelkedrudeltdenucevlhhushhtvghrufhiiigvpedvne curfgrrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH 3/3] hw/block/nvme: align with existing style Date: Mon, 25 Jan 2021 09:22:27 +0100 Message-Id: <20210125082227.20160-4-its@irrelevant.dk> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125082227.20160-1-its@irrelevant.dk> References: <20210125082227.20160-1-its@irrelevant.dk> 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=66.111.4.28; envelope-from=its@irrelevant.dk; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Dmitry Fomichev , Klaus Jensen , Gollu Appalanaidu , Max Reitz , Keith Busch , Klaus Jensen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Gollu Appalanaidu Change status checks to align with the existing style and remove the explicit check against NVME_SUCCESS. Cc: Dmitry Fomichev Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen Reviewed-by: Dmitry Fomichev Reviewed-by: Keith Busch --- hw/block/nvme.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 1be5b54e0fed..98d84fe26644 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1198,7 +1198,7 @@ static uint16_t nvme_check_zone_write(NvmeCtrl *n, Nv= meNamespace *ns, status =3D nvme_check_zone_state_for_write(zone); } =20 - if (status !=3D NVME_SUCCESS) { + if (status) { trace_pci_nvme_err_zone_write_not_ok(slba, nlb, status); } else { assert(nvme_wp_is_valid(zone)); @@ -1253,7 +1253,7 @@ static uint16_t nvme_check_zone_read(NvmeNamespace *n= s, uint64_t slba, uint16_t status; =20 status =3D nvme_check_zone_state_for_read(zone); - if (status !=3D NVME_SUCCESS) { + if (status) { ; } else if (unlikely(end > bndry)) { if (!ns->params.cross_zone_read) { @@ -1266,7 +1266,7 @@ static uint16_t nvme_check_zone_read(NvmeNamespace *n= s, uint64_t slba, do { zone++; status =3D nvme_check_zone_state_for_read(zone); - if (status !=3D NVME_SUCCESS) { + if (status) { break; } } while (end > nvme_zone_rd_boundary(ns, zone)); @@ -1677,7 +1677,7 @@ static uint16_t nvme_read(NvmeCtrl *n, NvmeRequest *r= eq) =20 if (ns->params.zoned) { status =3D nvme_check_zone_read(ns, slba, nlb); - if (status !=3D NVME_SUCCESS) { + if (status) { trace_pci_nvme_err_zone_read_not_ok(slba, nlb, status); goto invalid; } @@ -1748,12 +1748,12 @@ static uint16_t nvme_do_write(NvmeCtrl *n, NvmeRequ= est *req, bool append, zone =3D nvme_get_zone_by_slba(ns, slba); =20 status =3D nvme_check_zone_write(n, ns, zone, slba, nlb, append); - if (status !=3D NVME_SUCCESS) { + if (status) { goto invalid; } =20 status =3D nvme_auto_open_zone(ns, zone); - if (status !=3D NVME_SUCCESS) { + if (status) { goto invalid; } =20 @@ -1852,14 +1852,14 @@ static uint16_t nvme_open_zone(NvmeNamespace *ns, N= vmeZone *zone, switch (state) { case NVME_ZONE_STATE_EMPTY: status =3D nvme_aor_check(ns, 1, 0); - if (status !=3D NVME_SUCCESS) { + if (status) { return status; } nvme_aor_inc_active(ns); /* fall through */ case NVME_ZONE_STATE_CLOSED: status =3D nvme_aor_check(ns, 0, 1); - if (status !=3D NVME_SUCCESS) { + if (status) { if (state =3D=3D NVME_ZONE_STATE_EMPTY) { nvme_aor_dec_active(ns); } @@ -1972,7 +1972,7 @@ static uint16_t nvme_set_zd_ext(NvmeNamespace *ns, Nv= meZone *zone) =20 if (state =3D=3D NVME_ZONE_STATE_EMPTY) { status =3D nvme_aor_check(ns, 1, 0); - if (status !=3D NVME_SUCCESS) { + if (status) { return status; } nvme_aor_inc_active(ns); @@ -3301,7 +3301,7 @@ static uint16_t nvme_set_feature_timestamp(NvmeCtrl *= n, NvmeRequest *req) =20 ret =3D nvme_dma(n, (uint8_t *)×tamp, sizeof(timestamp), DMA_DIRECTION_TO_DEVICE, req); - if (ret !=3D NVME_SUCCESS) { + if (ret) { return ret; } =20 --=20 2.30.0