[RFC PATCH 0/3] qemu: Propagate cluster size to new qcow2 images

Peter Krempa posted 3 patches 3 years, 8 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1598453623.git.pkrempa@redhat.com
src/qemu/qemu_block.c        | 6 ++++++
src/qemu/qemu_monitor.h      | 3 +++
src/qemu/qemu_monitor_json.c | 3 +++
src/util/virstoragefile.h    | 1 +
4 files changed, 13 insertions(+)
[RFC PATCH 0/3] qemu: Propagate cluster size to new qcow2 images
Posted by Peter Krempa 3 years, 8 months ago
Cluster size may have performatnce implications. Propagate the cluster
size used by the original image to any copy or overlay.

Peter Krempa (3):
  qemu: monitor: Detect image cluster size from
    'query-named-block-nodes'
  qemu: block: Allow specifying cluster size when using
    'blockdev-create'
  qemuBlockStorageSourceCreateDetectSize: Propagate cluster size for
    'qcow2'

 src/qemu/qemu_block.c        | 6 ++++++
 src/qemu/qemu_monitor.h      | 3 +++
 src/qemu/qemu_monitor_json.c | 3 +++
 src/util/virstoragefile.h    | 1 +
 4 files changed, 13 insertions(+)

-- 
2.26.2

Re: [RFC PATCH 0/3] qemu: Propagate cluster size to new qcow2 images
Posted by Eric Blake 3 years, 8 months ago
On 8/26/20 9:56 AM, Peter Krempa wrote:
> Cluster size may have performatnce implications. Propagate the cluster
> size used by the original image to any copy or overlay.
> 
> Peter Krempa (3):
>    qemu: monitor: Detect image cluster size from
>      'query-named-block-nodes'
>    qemu: block: Allow specifying cluster size when using
>      'blockdev-create'
>    qemuBlockStorageSourceCreateDetectSize: Propagate cluster size for
>      'qcow2'

It's not as flexible as allowing the user to customize sizes, but it 
definitely makes sense and is a sane heuristic, better than 
adccidentally creating an overlay with 64k clusters atop a base image 
with 1M clusters.

Series:
Reviewed-by: Eric Blake <eblake@redhat.com>


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Re: [RFC PATCH 0/3] qemu: Propagate cluster size to new qcow2 images
Posted by Peter Krempa 3 years, 7 months ago
On Wed, Aug 26, 2020 at 10:32:04 -0500, Eric Blake wrote:
> On 8/26/20 9:56 AM, Peter Krempa wrote:
> > Cluster size may have performatnce implications. Propagate the cluster
> > size used by the original image to any copy or overlay.
> > 
> > Peter Krempa (3):
> >    qemu: monitor: Detect image cluster size from
> >      'query-named-block-nodes'
> >    qemu: block: Allow specifying cluster size when using
> >      'blockdev-create'
> >    qemuBlockStorageSourceCreateDetectSize: Propagate cluster size for
> >      'qcow2'
> 
> It's not as flexible as allowing the user to customize sizes, but it
> definitely makes sense and is a sane heuristic, better than adccidentally
> creating an overlay with 64k clusters atop a base image with 1M clusters.

Actually, I'll modify the condition in patch 3 to also check that the
configured cluster size in the new image is 0 before applying one from
the template image. That way it will be simpler to wire up configurable
cluster size by just dealing with the XML.

> 
> Series:
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks I'll push it soon.