From nobody Sat Feb 7 05:52:22 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1680855999; cv=none; d=zohomail.com; s=zohoarc; b=jxXFmmtLqOeH32di+0Xc33JzNXC2S0pdLxG9EAo+YNeqytzIX33PkhpJbTEETFigB4RLKyoSFvEtgo4yMZvHgmj7f2qxsXiJAbO4iy5/weSeu8rFcITEXEjIvY3pHyhOx73Ztvg7Ge9wCRu3cuTh4E1ruJ5PYnRe9ASMQmUBZGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680855999; 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=EhVv6WlDwJL96Zy7vKftB7CwaSpSxc9eBC1kxbXoR8g=; b=PJDIvgirGIeOQYCh4+iQjdtBtTkDeZ2uMLvKyqFgUTHrW2tNFuSxjg7uVHrKf7U53UKOu9kcRSNp0bRh926I1C7lm4X1YTDP7YvqeyEHMgLAXE8v7G30+eceY5s7yNFkG4P0gSr/2kQ2NT7A9NPrliwP9D4tDqYACPmg/Ws83oc= 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 1680855999609987.0515238871034; Fri, 7 Apr 2023 01:26:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkhQ9-0006jV-3f; Fri, 07 Apr 2023 04:26:09 -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 1pkhQ5-0006dI-JN; Fri, 07 Apr 2023 04:26:06 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkhQ3-00028g-OK; Fri, 07 Apr 2023 04:26:05 -0400 Received: by mail-pl1-x632.google.com with SMTP id 20so330524plk.10; Fri, 07 Apr 2023 01:26:02 -0700 (PDT) Received: from fedlinux.. ([106.84.131.166]) by smtp.gmail.com with ESMTPSA id fe12-20020a056a002f0c00b0062dcaa50a9asm2521331pfb.58.2023.04.07.01.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 01:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680855960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EhVv6WlDwJL96Zy7vKftB7CwaSpSxc9eBC1kxbXoR8g=; b=Lx7+IWlNZLpFPLspcDDgNsLn9e2v//1yXAAvdd8sSWT6nYo0r3FYRVcNZihGKzv4Ya Zz510KNt69TIkVFlEBKaCAx50782oYI6nDQxlm4P/KbgoTTmZ8eiVdRB9BshokftPO5e npmDH8wZEFXuY2E0FRBVxQa5fWcLLovMCxrd6M61+EhLv6bmeft8Civ2ErDKQavpkh95 sp/Bml5QNBieWS9je9OAoEUlHmwMZ5vACf1ZlSLfVuvakaCtfGW1HrxHZd5oZ/zmjGqv CCDchGWS4FDgeIEteVgfPjf+8nH8QDQTjFjLl7Fd9Amu/ktTnV1onIYSp5W9fVRybr5G tGjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680855960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EhVv6WlDwJL96Zy7vKftB7CwaSpSxc9eBC1kxbXoR8g=; b=B+54ZlHa6fU0JXgBqU5pgggsiVtZsaASSXtGT026jY9Rs30V1ifvLY8DsR+c0Yehi3 dfSDoAa8FEILuNHvmNRNUxPrqaYskUi78/xxnUxdURnZvtNxAU0f/JvZhaMWA0K9wwgc whJvcsq6Ew4wOGdVi1uRrfiRABhzg9GYrgHg22Nx/GnH/RveTvy1EXtQhVoZh9FYx1Bl l6MZAzasirXtLJL5koO2Bq2sctMURo5ScnUdjCHRYdQtpdI+s4Vd9JKAyOEL4UIUYhcg i3JazX1WcgMY3/jCyyM2x9/K0sXOqBcuwPY+WJluXx7YVEWP5gg02EZFAO94oxVj8nuZ rMzQ== X-Gm-Message-State: AAQBX9djHvL34Kuau7PcGvJmPbnNLfZZWIhaQkXYZE48K5XhFSAhiLJM 7ErMBZ0G6EymBdu8Mo2Hflpp9YC/919CFe6S X-Google-Smtp-Source: AKy350b7xmI9h98+hauaLK6B8e+TPhEgpy3X5dFcvJxzYydogAVxS9xPpHLoTYKTkebcQN6udPPapA== X-Received: by 2002:a05:6a20:8593:b0:d3:45f8:256 with SMTP id s19-20020a056a20859300b000d345f80256mr1844602pzd.60.1680855960384; Fri, 07 Apr 2023 01:26:00 -0700 (PDT) From: Sam Li To: qemu-devel@nongnu.org Cc: Kevin Wolf , Cornelia Huck , Markus Armbruster , Stefan Hajnoczi , Raphael Norwitz , damien.lemoal@opensource.wdc.com, qemu-block@nongnu.org, Eric Blake , Hanna Reitz , Paolo Bonzini , hare@suse.de, "Michael S. Tsirkin" , dmitry.fomichev@wdc.com, kvm@vger.kernel.org, Sam Li Subject: [PATCH v10 5/5] docs/zoned-storage:add zoned emulation use case Date: Fri, 7 Apr 2023 16:25:28 +0800 Message-Id: <20230407082528.18841-6-faithilikerun@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230407082528.18841-1-faithilikerun@gmail.com> References: <20230407082528.18841-1-faithilikerun@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::632; envelope-from=faithilikerun@gmail.com; helo=mail-pl1-x632.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1680856000912100002 Content-Type: text/plain; charset="utf-8" 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 --- docs/devel/zoned-storage.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned-storage.rst index 6a36133e51..05ecf3729c 100644 --- a/docs/devel/zoned-storage.rst +++ b/docs/devel/zoned-storage.rst @@ -41,3 +41,20 @@ 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=3Dhost_device,filename=3D/dev/nul= lb0 -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/null= b0, + 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.dire= ct=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