[libvirt] [PATCH v2 13/29] conf: Merge virDomainStorageSourceFormat into virDomainDiskSourceFormat

Peter Krempa pkrempa at redhat.com
Fri Apr 5 06:14:35 UTC 2019


On Thu, Apr 04, 2019 at 15:29:30 -0500, Eric Blake wrote:
> On 4/4/19 3:16 PM, Eric Blake wrote:
> > On 3/22/19 1:00 PM, Peter Krempa wrote:
> >> There was only one caller, remove the unnecessary wrapper.
> >>
> >> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> >> ---
> >>  src/conf/domain_conf.c | 60 ++++++++++++++++--------------------------
> >>  1 file changed, 23 insertions(+), 37 deletions(-)
> > 
> > Alas, my backup code wants to be a second caller.
> > https://www.redhat.com/archives/libvir-list/2019-March/msg00393.html
> > 
> > virDomainStorageSourceFormat was a nice independent function that did
> > not care what element it was being formatted to;
> > virDomainDiskSourceFormat always formats into <disk ....>.
> > 
> > But backup wants to format into <target> (push mode) or <scratch> (pull
> > mode). So I'll be including a revert of this patch in my next round of
> > incremental backup patches.
> 
> Or maybe just tweaking it to add a parameter that says what string name
> to use for the overall element.

I prefer this one. If you need the element to be something else than
'source' please add a parameter.

Passing back a buffer was a somewhat failed experiment which allowed to
merge 'type' and 'format' attributes into the <source> (or equivalent)
element.

This design enforces users to add a wrapper element similarly to what
other XMLs are having. Original idea was to simplify thing but the
parser didn't turn out simpler at all and all the old XML design can't
be changed anyways.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190405/886a1f6a/attachment-0001.sig>


More information about the libvir-list mailing list