From nobody Mon Nov 17 12:05:03 2025 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=1603807013; cv=none; d=zohomail.com; s=zohoarc; b=R/IODj/IjItHOmHkIapMmh+kwNYl/qXN6Ipgzomf5E02bfc7OkSbX4SVvUnN8EOPbh5365pf4NAYduTxD8xfmTCsqz/TwAx2u5X0f3cVSEpiveWaI0wY4PgKpQC4G5BRbEJjDE7ghaGeUDjot87cTpRXi/s3VyCQZ9XDKJV14VM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603807013; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=SjDF8zsFaATkfEDLVjf49WgfMXHjaeRfhZvCWiwXv1Y=; b=lYwvl0doguzw5RJxSj0su4ndgm44GgcpWAtiVdRxz4yh5nUmPKgpuCQkHTusik+2pDjWkAwJSJSSTJoilXCJZoRG9FNkrnvt1/KSouq+AIkhCKu5vR3+7ZmVBeJ97p/Y1QELkz4ibtz6ZBdJ/nZDXwPOxq6xZPSka3PqrGoteXs= 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 1603807013042316.74266652011875; Tue, 27 Oct 2020 06:56:53 -0700 (PDT) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-klA7hR2OOhuACqy0ea15sw-1; Tue, 27 Oct 2020 09:56:50 -0400 Received: by mail-ej1-f72.google.com with SMTP id c10so893638ejm.15 for ; Tue, 27 Oct 2020 06:56:50 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id i14sm1028890edu.40.2020.10.27.06.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 06:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603807012; 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=SjDF8zsFaATkfEDLVjf49WgfMXHjaeRfhZvCWiwXv1Y=; b=YxXHZAy1iDD+ksAKCf4OLceq28nXiYKIOr5KCekldnJ4JPrehos0aBpH5uDGQVkkzJqGFM LCRHwwM2lwAIUR8tjV5YaN5/W6W0E8frABhFQjywZntovG1Dbx5IDoaR0KKDqBSUXhKmiY 4BU5ZYdzy90xKNi8CqujvW3vd5dKQQc= X-MC-Unique: klA7hR2OOhuACqy0ea15sw-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=SjDF8zsFaATkfEDLVjf49WgfMXHjaeRfhZvCWiwXv1Y=; b=pbGNzNudq1W5MDKXX/+SJO/UJ4SgFy3bhiOMvYxoLUJ48EcIcEyQfy06djPeBU9h+C t346ZWjuuemqk9xfdmgGnhMr+7Mb0tUrZjcHBo3EnZZGmRNdOQQkR0HBT+Nz2UCFxcTg 0KnQO4iaZMr6hlWMsq+uGCzjeLo8bH6Tprp3fl9gEUyhZuAe7Za+/4NtCCpFNa/yDMEV 5ditXGw/cmmMnae9oEV9n1J751ALDtrXqF33B/Z8cqDQq4dPu2fUsX0C06GM4M9TEVMh pR+6BpVfN//7bXfcxt/fwyau2GbjTHP0qIdUHUlOPmjTTBw5rYwvRka0Jdbm4xfcTIxm Xv+A== X-Gm-Message-State: AOAM5328iEFqdJxyUTNyPZF3ijI09U9IxfWzkboe4yOJUnyerXsECYA6 u2BDDnUwdIE1tOfVnuImoC4SsY5+Bfuzq6Txmhsc48MKcUN75+ZdjoreZkmxnW3FGMRJVEYo5xM g4y82FSP0DZ2rag== X-Received: by 2002:a50:e61a:: with SMTP id y26mr2436494edm.71.1603807009219; Tue, 27 Oct 2020 06:56:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+DR27WfkIA/GMYrmcTzta+rl+JsgFtdbD+cG83mgOnEso1y5WyQnYYkv6j5zpOEQvUrRoBQ== X-Received: by 2002:a50:e61a:: with SMTP id y26mr2436470edm.71.1603807009043; Tue, 27 Oct 2020 06:56:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Klaus Jensen , qemu-block@nongnu.org, Fam Zheng , Keith Busch , Eric Auger , Stefan Hajnoczi , Kevin Wolf , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 11/25] block/nvme: Make nvme_identify() return boolean indicating error Date: Tue, 27 Oct 2020 14:55:33 +0100 Message-Id: <20201027135547.374946-12-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201027135547.374946-1-philmd@redhat.com> References: <20201027135547.374946-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) Just for consistency, following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), return a boolean value indicating an error is set or not. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/nvme.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index 8b0fd59c6ea..74994c442e5 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -506,9 +506,11 @@ static int nvme_cmd_sync(BlockDriverState *bs, NVMeQue= uePair *q, return ret; } =20 -static void nvme_identify(BlockDriverState *bs, int namespace, Error **err= p) +/* Returns true on success, false on failure. */ +static bool nvme_identify(BlockDriverState *bs, int namespace, Error **err= p) { BDRVNVMeState *s =3D bs->opaque; + bool ret =3D false; union { NvmeIdCtrl ctrl; NvmeIdNs ns; @@ -585,10 +587,13 @@ static void nvme_identify(BlockDriverState *bs, int n= amespace, Error **errp) goto out; } =20 + ret =3D true; s->blkshift =3D lbaf->ds; out: qemu_vfio_dma_unmap(s->vfio, id); qemu_vfree(id); + + return ret; } =20 static bool nvme_poll_queue(NVMeQueuePair *q) --=20 2.26.2