From patchwork Mon Mar 6 14:34:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1752458 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=irrelevant.dk header.i=@irrelevant.dk header.a=rsa-sha256 header.s=fm3 header.b=uFMfXSBl; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=Mdqlo1xM; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PVh2j4P63z246g for ; Tue, 7 Mar 2023 01:35:56 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZBvM-0006QM-FS; Mon, 06 Mar 2023 09:34:48 -0500 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 1pZBvJ-0006OW-Vr; Mon, 06 Mar 2023 09:34:46 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZBvI-0005Uy-HW; Mon, 06 Mar 2023 09:34:45 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AAC055C02BE; Mon, 6 Mar 2023 09:34:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 06 Mar 2023 09:34:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1678113283; x= 1678199683; bh=sfzU2rLzlJm2OF2cme98RYLx8G1VEL+GN5OZplAGtRM=; b=u FMfXSBl30OyeGBp3wjDcF7JhDpD+2b/Nv+AbqWM2DcRh33OdVF5yR7rlTTD4vEZP Z0XvQp04sELIx28+SfM6bTojbHKD7KDGCgbw9uwYQe+GKt8CrA0hh++wN1efwFo0 XWoWP2Pac1mmSmgAPe7jLKBh7Q72JewPIR4vLA8qNeNVM/7YZPA6jXi8UQlC+igB jC93Jaymrp+KaK4+52J3+XhDbWqssbanVjTckrvz+RjKL/4Z1HmfwRZkTA2lg3jE wAJw2rF25v+LPHm6b21OLrqCnQxta1q7mqbjDDCdragiR2UUPmnu4xg9io86L5SO J/QJBwq6Q+3scv6lROU8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1678113283; x= 1678199683; bh=sfzU2rLzlJm2OF2cme98RYLx8G1VEL+GN5OZplAGtRM=; b=M dqlo1xMxsYYbSntI0IsAfIoTm/1exHB8s3N73VnNdk13584L+Tne+rdM+6GcbfnX q74gSu99EBuWkCnHZffQoXS0rsclvtxiqYtVvrG4WdGS7MjPWed0x9PDwSyKGHgc 5fsarN3CMAg2Hcgki2t3fHCphJrJX7Ktp35rV/e2U+/yyL+utmy+/6uCaL9UHpFq 280XYgkLKTlpiaSpu7NNPmM0n0Tlj6vB/DvMJWfZtBbOPHgQGR//hIhRryuwzroq JEm0PZfrfwt5DlP3hsbNX3k1ot+A7vBu+jMLnl+xXZYNIsTZYQ9rrqZphDBFknkG y244G6t4xGzPIi9xva/YA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddtkedgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Mar 2023 09:34:41 -0500 (EST) From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Klaus Jensen , Keith Busch , Kevin Wolf , Hanna Reitz , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , qemu-block@nongnu.org, Fam Zheng , Niklas Cassel , Klaus Jensen Subject: [PULL 2/5] hw/nvme: store a pointer to the NvmeSubsystem in the NvmeNamespace Date: Mon, 6 Mar 2023 15:34:30 +0100 Message-Id: <20230306143433.10351-3-its@irrelevant.dk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230306143433.10351-1-its@irrelevant.dk> References: <20230306143433.10351-1-its@irrelevant.dk> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1196; i=k.jensen@samsung.com; h=from:subject; bh=TsWhXMqC3vOl1XSTCVLpOn22OdD3mS9gO5gOTakgK+Y=; b=owJ4nAFtAZL+kA0DAAoBTeGvMW1PDekByyZiAGQF+fjnSPNaSqioAG9ggBVU4E+fi9zgKbeEd yLyBOPYceg+yokBMwQAAQoAHRYhBFIoM6p14tzmokdmwE3hrzFtTw3pBQJkBfn4AAoJEE3hrzFt Tw3pvJgIALgM39WeTg2p3c0s6mkp9F0MaU/aIJmr17HU6YJK13ZBP7GUx1nA33abPk62bBktYoC n6luchEt4jeZIIgJ1ajzyeDPDEjckhWQTMeueBIdKlmTAXUawqpk8erGP0s0lSE1kVuV7L7WzN2 O053XQnArHVVAOCo9PMe1mYpwqQnM7ofALl6TMPQYdhp6ff6HXWQLXNJcgbh0hkBtnf82LAjO9B UqfsSIIdqHdEXCZatvgnn7+5OLSCFv7+B3x5ddArebHHCPKfjymoPoWqHG9I2rW3I7cn+gTSuKt PZllT3EVazy8qFThuWNTnPngETLY2FxhjqbvJpr36mFgM/XlaHthlqxT X-Developer-Key: i=k.jensen@samsung.com; a=openpgp; fpr=DDCA4D9C9EF931CC3468427263D56FC5E55DA838 Received-SPF: pass client-ip=66.111.4.27; envelope-from=its@irrelevant.dk; helo=out3-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_H2=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Niklas Cassel Each NvmeNamespace can be used by serveral controllers, but a NvmeNamespace can at most belong to a single NvmeSubsystem. Store a pointer to the NvmeSubsystem, if the namespace was realized with a NvmeSubsystem. Reviewed-by: Keith Busch Signed-off-by: Niklas Cassel Signed-off-by: Klaus Jensen --- hw/nvme/ns.c | 1 + hw/nvme/nvme.h | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 62a1f97be010..8ebab4fbceaf 100644 --- a/hw/nvme/ns.c +++ b/hw/nvme/ns.c @@ -561,6 +561,7 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp) if (!qdev_set_parent_bus(dev, &subsys->bus.parent_bus, errp)) { return; } + ns->subsys = subsys; } if (nvme_ns_setup(ns, errp)) { diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h index 16da27a69bfb..5d221073ac68 100644 --- a/hw/nvme/nvme.h +++ b/hw/nvme/nvme.h @@ -167,6 +167,7 @@ typedef struct NvmeNamespace { int32_t nr_active_zones; NvmeNamespaceParams params; + NvmeSubsystem *subsys; struct { uint32_t err_rec;