From nobody Sun Feb 8 19:02:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602691137; cv=none; d=zohomail.com; s=zohoarc; b=fsfOUG6Yg6IMF6ZO/hLdu2Ojp2sOILZPGMtD8I0ludILppd2prH6HuprQ9lX0fl0rVkvTnpgvq/Zp0gFLTgBBRxq7KAKjdBV7TbTI25YnowfEJBhCgODgBTWzHM9ItViQSLoDg9AGL0apzCZQXvZOTSUpdFxQ2t0yzAY2Fy4dbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602691137; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=ajyUIBZhYcYMjtG3GzX+aV0rxCP2KwW8xZEaitynopk=; b=SDyogZ8afdqihOZW8SZJ9qNnldi+p3hqf1ScYlzMx00OIfTnFjHv0eWpLfjX0km0GiyREcS03q+nx/kQ6/H4vxRrR0a07gqL2tXF0kOb9p9WY3dJzIlkyv9yZ7lDk8KfxqzEell5fjxu1cj4JXpEL4ZxTNr2mXh9r+6Fdwo9qSY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1602691137130726.1378264983389; Wed, 14 Oct 2020 08:58:57 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-568-ztbDOsESNoaDphO2X3TMhA-1; Wed, 14 Oct 2020 11:58:54 -0400 Received: by mail-wm1-f71.google.com with SMTP id v14so948wmj.6 for ; Wed, 14 Oct 2020 08:58:54 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id m12sm6058664wrs.92.2020.10.14.08.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 08:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602691136; 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=ajyUIBZhYcYMjtG3GzX+aV0rxCP2KwW8xZEaitynopk=; b=D21m9eqr2clKbHeyP9L0o3kuxmFzRr3GQ58BxdYsd9nwH3fn4GMRCXvt1RFaX7msix3Jdj H7mkskNjGnDVZRQWZVJDnW6z1Eq1TFrqaIl8Ydj2Ex6POiU7VaBlFvS9S3v9x0TfDl9L5E W/1hJm8ybFZLJ3oZl3N1Z8iBR6WnYfk= X-MC-Unique: ztbDOsESNoaDphO2X3TMhA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ajyUIBZhYcYMjtG3GzX+aV0rxCP2KwW8xZEaitynopk=; b=uD/wQb3+iEaL7O4YUnDq9mC1klxuM4fbmAHie817LO2981jIT10odC7irhELNN6pK6 VIWG+IwfKvTiGOsIP22JmQb8+//gtnQvSSe3BAW92rtT66bfgqE6qg4arpmG+BrF/6Wr J2z0WDYeo1lQU2yKF6OxfblM5Sh2OZ+IVrGLgyPVdC1YfWQDNMaAQc1hdgBTM4c2cts9 LQCORDjLVpOzlbzyF+BQMUc2DddTtnzxvJa3aVhsuv4stBry/gApFsHrn3VQmCdWNwRD FSQfj4K90nT8kc+lqC+AWmznLftmqdEmZJguxD/8JDrUuMi+Yfl2tcckDlYR2lav0f7q 82PQ== X-Gm-Message-State: AOAM531qdvwEVv+1tVnmyTDCdVe3diS0/hrQwus5YYiSOEm2ITHZ0lNu WMq4sr+WhbFAWybfAJxNB6oCIjrHwEUSjhKYqUygHOkNX3W5yvYNFIvDYThi3HKjIp+xdzlXaYk b90+XXEJy1PvPIA== X-Received: by 2002:a1c:2d8f:: with SMTP id t137mr137411wmt.26.1602691133190; Wed, 14 Oct 2020 08:58:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXyQI3UJlkRk7SVnqrRiqNE3ZWWlwAPgp9jjgzAaj6Euzj4X8XBL3WnLoAJfzDmC/zX+njug== X-Received: by 2002:a1c:2d8f:: with SMTP id t137mr137385wmt.26.1602691132884; Wed, 14 Oct 2020 08:58:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Fam Zheng , Stefan Hajnoczi , Kevin Wolf , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 08/15] block/nvme: Pass AioContext argument to nvme_add_io_queue() Date: Wed, 14 Oct 2020 17:58:03 +0200 Message-Id: <20201014155810.102841-9-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201014155810.102841-1-philmd@redhat.com> References: <20201014155810.102841-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We want to get ride of the BlockDriverState pointer at some point, so pass aio_context along. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/nvme.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 523814a1243..b841c5950c5 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -642,7 +642,9 @@ static bool nvme_poll_cb(void *opaque) return nvme_poll_queues(s); } =20 -static bool nvme_add_io_queue(BlockDriverState *bs, Error **errp) +/* Returns true on success, false on failure. */ +static bool nvme_add_io_queue(BlockDriverState *bs, + AioContext *aio_context, Error **errp) { BDRVNVMeState *s =3D bs->opaque; unsigned n =3D s->nr_queues; @@ -650,8 +652,7 @@ static bool nvme_add_io_queue(BlockDriverState *bs, Err= or **errp) NvmeCmd cmd; unsigned queue_size =3D NVME_QUEUE_SIZE; =20 - q =3D nvme_create_queue_pair(s, bdrv_get_aio_context(bs), - n, queue_size, errp); + q =3D nvme_create_queue_pair(s, aio_context, n, queue_size, errp); if (!q) { return false; } @@ -805,7 +806,7 @@ static int nvme_init(BlockDriverState *bs, const char *= device, int namespace, } =20 /* Set up command queues. */ - if (!nvme_add_io_queue(bs, errp)) { + if (!nvme_add_io_queue(bs, aio_context, errp)) { ret =3D -EIO; } out: --=20 2.26.2