Zoned storage support in libvirt

Stefan Hajnoczi stefanha at redhat.com
Wed Jan 11 15:24:30 UTC 2023


On Tue, Jan 10, 2023 at 03:29:47PM +0000, Daniel P. Berrangé wrote:
> On Tue, Jan 10, 2023 at 10:19:51AM -0500, Stefan Hajnoczi wrote:
> > Hi Peter,
> > Zoned storage support
> > (https://zonedstorage.io/docs/introduction/zoned-storage) is being added
> > to QEMU. Given a zoned host block device, the QEMU syntax will look like
> > this:
> > 
> >   --blockdev zoned_host_device,node-name=drive0,filename=/dev/$BDEV,...
> >   --device virtio-blk-pci,drive=drive0
> > 
> > Note that regular --blockdev host_device will not work.
> > 
> > For now the virtio-blk device is the only one that supports zoned
> > blockdevs.
> 
> Does the virtio-blk device expowsed guest ABI differ at all
> when connected zoned_host_device instead of host_device ?

Yes. There is a VIRTIO feature bit, some configuration space fields,
etc. virtio-blk-pci detects when the blockdev is zoned and enables the
feature bit.

> > This brings to mind a few questions:
> > 
> > 1. Does libvirt need domain XML syntax for zoned storage? Alternatively,
> >    it could probe /sys/block/$BDEV/queue/zoned and generate the correct
> >    QEMU command-line arguments for zoned devices when the contents of
> >    the file are not "none".
> > 
> > 2. Should QEMU --blockdev host_device detected zoned devices so that
> >    --blockdev zoned_host_device is not necessary? That way libvirt would
> >    automatically support zoned storage without any domain XML syntax or
> >    libvirt code changes.
> > 
> >    The drawbacks I see when QEMU detects zoned storage automatically:
> >    - You can't easiy tell if a blockdev is zoned from the command-line.
> >    - It's possible to mismatch zoned and non-zoned devices across live
> >      migration.
> 
> What happens with existing QEMU impls if you use --blockdev host_device
> pointing to a /dev/$BDEV that is a zoned device ?  If it succeeds and
> works correctly, then we likely need to continue to support that. This
> would push towards needing a new XML element.

Pointing host_device at a zoned device doesn't result in useful behavior
because the guest is unaware that this is a zoned device. The guest
won't be able to access the device correctly (i.e. sequential writes
only). Write requests will fail eventually.

I would consider zoned devices totally unsupported in QEMU today and we
don't need to worry about preserving any kind of backwards compatibility
with --blockdev host_device,filename=/dev/my_zoned_device.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230111/9bbf85a1/attachment.sig>


More information about the libvir-list mailing list