From nobody Thu Dec 18 13:17:56 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1681992845; cv=none; d=zohomail.com; s=zohoarc; b=Z4H2KCf7dg6LY+IuHWVxka7aMAAxRUxVUzcl3cT42PFIJ3T77tzbIRRjTBfLSB9a0g3vBOHxd/M3GgOeO8un+x1itQkm8A7/t33HnVOavCmHOtPOBymCA0z8o1YBnhjB2CjVSICZ43L9FuEy1hzm0vTNeCKzORc23wavhA1ZDlw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681992845; 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=vHb8qGSkfOOzR1UvPl9jTJBSrgP0gJxbai8FbuzD3Cc=; b=LOiYBuMxD+d19jVf45IJvH4jT+DhQOdP/o+MQDZHWM7jwXSLkoV+Y6RYbLDEcw3/oJLUGIk+2gn4o6GNy77rGSxRkKV22JwfIq/xK0+q+5JEEIHx8jrK/1hGHkA9+uwtKSsBZk00cJjEPSBzrse9N0Wic2vqbTGA55rX4LOTJ+c= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681992845053222.0900600599499; Thu, 20 Apr 2023 05:14:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppT8R-0003o2-9R; Thu, 20 Apr 2023 08:11:35 -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 1ppT7n-0001xX-VY for qemu-devel@nongnu.org; Thu, 20 Apr 2023 08:10:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppT7j-0003uQ-05 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 08:10:55 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-67-SM41RbkZMESFzP3lJGc7QQ-1; Thu, 20 Apr 2023 08:10:45 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7489985A5A3; Thu, 20 Apr 2023 12:10:44 +0000 (UTC) Received: from localhost (unknown [10.39.193.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3645492C3E; Thu, 20 Apr 2023 12:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681992648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vHb8qGSkfOOzR1UvPl9jTJBSrgP0gJxbai8FbuzD3Cc=; b=N0iAc8+qXWu8zzQZJTlvDM0cwHfEZCRWOPoqJBDkMEPfjP6WWi3HxCh5fDOodIn083qGdz ZJNlmgVu4F9bos4uKDHN3hso3oZ7DIhJuGtEftJPMmyIsD/YKNEwuitM8havMUYp/ZEpnW y8uflxHGuABCxWc0F5JMcAXhoes9aqI= X-MC-Unique: SM41RbkZMESFzP3lJGc7QQ-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Raphael Norwitz , Kevin Wolf , Markus Armbruster , Julia Suvorova , Eric Blake , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" , Thomas Huth , qemu-block@nongnu.org, Cornelia Huck , "Dr. David Alan Gilbert" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Peter Maydell , Stefano Garzarella , kvm@vger.kernel.org, virtio-fs@redhat.com, Stefan Hajnoczi , Hanna Reitz , Fam Zheng , Aarushi Mehta , Sam Li Subject: [PULL 19/20] docs/zoned-storage:add zoned emulation use case Date: Thu, 20 Apr 2023 08:09:47 -0400 Message-Id: <20230420120948.436661-20-stefanha@redhat.com> In-Reply-To: <20230420120948.436661-1-stefanha@redhat.com> References: <20230420120948.436661-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=170.10.129.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1681992846322100003 Content-Type: text/plain; charset="utf-8" From: Sam Li Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by: Sam Li Message-id: 20230407082528.18841-6-faithilikerun@gmail.com [Fix Sphinx indentation error by turning command-lines into pre-formatted text. --Stefan] Signed-off-by: Stefan Hajnoczi --- docs/devel/zoned-storage.rst | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned-storage.rst index 6a36133e51..e02500c8a3 100644 --- a/docs/devel/zoned-storage.rst +++ b/docs/devel/zoned-storage.rst @@ -38,6 +38,25 @@ When the BlockBackend's BlockLimits model reports a zone= d storage device, users like the virtio-blk emulation or the qemu-io-cmds.c utility can use block = layer APIs for zoned storage emulation or testing. =20 -For example, to test zone_report on a null_blk device using qemu-io is: -$ path/to/qemu-io --image-opts -n driver=3Dhost_device,filename=3D/dev/nul= lb0 --c "zrp offset nr_zones" +For example, to test zone_report on a null_blk device using qemu-io is:: + + $ path/to/qemu-io --image-opts -n driver=3Dhost_device,filename=3D/dev/n= ullb0 -c "zrp offset nr_zones" + +To expose the host's zoned block device through virtio-blk, the command li= ne +can be (includes the -device parameter):: + + -blockdev node-name=3Ddrive0,driver=3Dhost_device,filename=3D/dev/nullb0= ,cache.direct=3Don \ + -device virtio-blk-pci,drive=3Ddrive0 + +Or only use the -drive parameter:: + + -driver driver=3Dhost_device,file=3D/dev/nullb0,if=3Dvirtio,cache.direct= =3Don + +Additionally, QEMU has several ways of supporting zoned storage, including: +(1) Using virtio-scsi: --device scsi-block allows for the passing through = of +SCSI ZBC devices, enabling the attachment of ZBC or ZAC HDDs to QEMU. +(2) PCI device pass-through: While NVMe ZNS emulation is available for tes= ting +purposes, it cannot yet pass through a zoned device from the host. To pass= on +the NVMe ZNS device to the guest, use VFIO PCI pass the entire NVMe PCI ad= apter +through to the guest. Likewise, an HDD HBA can be passed on to QEMU all HD= Ds +attached to the HBA. --=20 2.39.2