From patchwork Thu Apr 20 12:09:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 13218668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E221C77B73 for ; Thu, 20 Apr 2023 12:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234745AbjDTMLp (ORCPT ); Thu, 20 Apr 2023 08:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234127AbjDTMLj (ORCPT ); Thu, 20 Apr 2023 08:11:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C56F94C10 for ; Thu, 20 Apr 2023 05:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681992649; 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=FJh5lnej7rzn5er/FTL/1xJsMwn4kWLv1vEvR0+jXM4QtFVDH3VXFH9hyvHZdZSeHhLf2P slDQ4tr5GRGv6PGMIw3OMvqpg8cTALDLqfk0pi5xRxTflE1Muv1M8h1uVCR8K06XOWIH50 1FKJ+04Sj3Xv+T89eIzkcGWUBLr15Q8= 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 X-MC-Unique: SM41RbkZMESFzP3lJGc7QQ-1 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) 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_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , "Michael S. Tsirkin" , Thomas Huth , qemu-block@nongnu.org, Cornelia Huck , "Dr. David Alan Gilbert" , =?utf-8?q?Daniel_P=2E_Berra?= =?utf-8?q?ng=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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 zoned 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. -For example, to test zone_report on a null_blk device using qemu-io is: -$ path/to/qemu-io --image-opts -n driver=host_device,filename=/dev/nullb0 --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=host_device,filename=/dev/nullb0 -c "zrp offset nr_zones" + +To expose the host's zoned block device through virtio-blk, the command line +can be (includes the -device parameter):: + + -blockdev node-name=drive0,driver=host_device,filename=/dev/nullb0,cache.direct=on \ + -device virtio-blk-pci,drive=drive0 + +Or only use the -drive parameter:: + + -driver driver=host_device,file=/dev/nullb0,if=virtio,cache.direct=on + +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 testing +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 adapter +through to the guest. Likewise, an HDD HBA can be passed on to QEMU all HDDs +attached to the HBA.