[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] NBD structured reads vs. block size
From: |
Richard W.M. Jones |
Subject: |
Re: [Qemu-block] NBD structured reads vs. block size |
Date: |
Wed, 1 Aug 2018 15:13:07 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Aug 01, 2018 at 04:49:21PM +0300, Nir Soffer wrote:
> All this is an issue only when the underlying file is a file using raw
> format, right?
NBD should only really be used to send raw format data over the wire.
While it is possible to serve a qcow2 file over NBD as qcow2, it's not
really how NBD is intended to be used.
> Since NBD is meant for block devices, and block devices cannot have
> partial blocks, would it be simpler to round down unaligned file size, and
> treat possible unaligned range at the end of the file as area that can not
> be accessed via NBD?
For nbdkit I would like to preserve the ability to serve arbitrary-
sized files. nbdkit allows people to write plugins, and we cannot be
sure that every plugin everyone writes will always use sensible block
sizes.
In a forthcoming nbdkit release you can add the "truncate" filter on
top of any plugin to round up the size to a multiple of any power of 2
(or round down if you really want).
https://www.redhat.com/archives/libguestfs/2018-August/msg00006.html
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v