On Fri, Jan 08, 2021 at 13:13:30 +0000, Daniel Berrange wrote:
> On Thu, Jan 07, 2021 at 03:59:36PM +0100, Peter Krempa wrote:
> > In certain specific cases it might be beneficial to be able to control
> > the metadata caching of storage image format drivers of a hypervisor.
> > 
> > Introduce XML machinery to set the maximum size of the metadata cache
> > which will be used by qemu's qcow2 driver.
> > 
> > Signed-off-by: Peter Krempa <pkre...@redhat.com>
> > ---
> >  docs/formatdomain.rst                         | 43 ++++++++++++++
> >  docs/schemas/domaincommon.rng                 | 20 ++++++-
> >  src/conf/domain_conf.c                        | 51 ++++++++++++++--
> >  src/util/virstoragefile.c                     |  1 +
> >  src/util/virstoragefile.h                     |  2 +
> >  .../qemuxml2argvdata/disk-metadata-cache.xml  | 46 +++++++++++++++
> >  .../disk-metadata-cache.x86_64-latest.xml     | 58 +++++++++++++++++++
> >  tests/qemuxml2xmltest.c                       |  1 +
> >  8 files changed, 216 insertions(+), 6 deletions(-)
> >  create mode 100644 tests/qemuxml2argvdata/disk-metadata-cache.xml
> >  create mode 100644 
> > tests/qemuxml2xmloutdata/disk-metadata-cache.x86_64-latest.xml
> 
> 
> > +    <disk type='file' device='disk'>
> > +      <driver name='qemu' type='qcow2' cache='none'/>
> > +      <source file='/tmp/QEMUGuest2.img'/>
> > +      <backingStore type='file'>
> > +        <format type='qcow2'>
> > +          <metadata_cache>
> > +            <max_size unit='kiB'>1024</max_size>
> > +          </metadata_cache>
> 
> I only wonder if this is uneccessarily verbose XML nesting ?

I actually had the same feeling, but adding it just as an attribute to
<disk><driver ... >(the other case besides <backingStore> felt worse
since we have a huge list of attributes there.

I specifically want that it points to metadata cache maximum size so
that there isn't any unnecessary ambiguity.

Possibilities are to merge the <max_size> subelement into the parent
element so that we decrease the amount of lines. Or possibly go with
Jano's suggestion of dropping 'size' since that is obvious when unit=''
is present (but note that unit is optional on input).

Reply via email to