On Thu, May 09, 2019 at 03:29:13PM +0200, Peter Krempa wrote: > On Thu, May 09, 2019 at 10:26:46 +0200, Stefano Garzarella wrote: > > On Wed, May 08, 2019 at 01:44:27PM +0200, Markus Armbruster wrote: > > > Stefano Garzarella <sgarz...@redhat.com> writes: > > > > > > > On Tue, May 07, 2019 at 08:34:51AM +0200, Markus Armbruster wrote: > > > >> Cc: Peter for a libvirt perspective. > > > >> > > > >> Stefano Garzarella <sgarz...@redhat.com> writes: > > > >> > > > >> > This patch adds the support of preallocation (off/full) for the RBD > > > >> > block driver. > > > >> > If available, we use rbd_writesame() to quickly fill the image when > > > >> > full preallocation is required. > > > >> > > > > >> > Signed-off-by: Stefano Garzarella <sgarz...@redhat.com> > > > >> > --- > > > >> > block/rbd.c | 149 > > > >> > ++++++++++++++++++++++++++++++++++++++----- > > > >> > qapi/block-core.json | 4 +- > > > >> > 2 files changed, 136 insertions(+), 17 deletions(-) > > [...] > > > > > >> > ## > > > >> > # @BlockdevVmdkSubformat: > > > >> > > > >> The non-support of values 'metadata' and 'falloc' is not visible in > > > >> introspection, only in documentation. No reason to block this patch, > > > >> as > > > >> the other block drivers have the same introspection weakness (only > > > >> sheepdog and vdi bother to document). > > > >> > > > >> Should we address the introspection weakness? Only if there's a use > > > >> for > > > >> the information, I think. > > > > > > > > If the management applications will use that information (or maybe also > > > > our help pages), could be useful to have an array of 'PreallocMode' > > > > supported per-driver. > > > > > > Ideally, query-qmp-schema would show only the supported values. > > > > > > Not hard to do, just tedious: we'd get a number of sub-enums in addition > > > to the full one, and we'd have to map from sub-enum to the full one. > > > > > > QAPI language support for sub-enums would remove most of the tedium. > > > Not worthwhile unless the need for sub-enums is actually common. > > > > I should study better the QMP and QAPI to understand how to implement > > the sub-enums. > > > > If you agree, I'll put it as a background task, until somebody from > > management applications tell us his interest. > > Sorry for the late response. Libvirt currently does not deal that much > with the preallocation settings. Preallocation isn't in current state > implemented at all for 'blockdev-create' and only the 'metadata' and > 'falloc' modes are used in the storage driver via qemu-img. > > We currently hardcode the knowledge for which formats actually support > it internally. > > I'd say it's not criticall to expose this in the QMP schema but > obviously if we'll ever need to use it for a recent enough qemu it's > welcome to have a way to check.
Thank you for sharing this information! Cheers, Stefano