virsh: cmdBlockcopy: Fix generator of block copy disk XML
virsh: cmdBlockcopy: Fix generator of block copy disk XML

In a recent commit I've attempted to rewrite the XML generator to use
virXMLFormatElement instead of manual steps. Unfortunately the commit
had multiple problems resulting in a garbled XML:

1) in certain cases the wrong buffer was used resulting in misplaced
   snippets
2) the child element buffer was improperly set up so sub-elements were
   not indented

This resulted in following XML being generated:

 $ virsh blockcopy cd vda /tmp/test.copy --raw --print-xml
 type='file''/tmp/test.copy'/>
 <driver type='raw'/>
 <disk>
 <source file=</disk>

To fix this we'll generate the '<source>' element in one go and use the
proper buffer for it and other places.

Fixes: 1cd95f858ab83f2baab0e35070d00766bb06ce3a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2078274
Signed-off-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

libvirt/libvirt,libvirt/libvirt,olafhering/libvirt,crobinso/libvirt,jfehlig/libvirt,crobinso/libvirt,jfehlig/libvirt,olafhering/libvirt,libvirt/libvirt,jfehlig/libvirt,crobinso/libvirt,zippy2/libvirt,olafhering/libvirt,crobinso/libvirt,zippy2/libvirt,zippy2/libvirt,zippy2/libvirt,jfehlig/libvirt,libvirt/libvirt,olafhering/libvirt