[libvirt] [PATCH] tests: add further XML namespace test

Daniel P. Berrange berrange at redhat.com
Tue Jul 11 13:00:19 UTC 2017


On Mon, Jul 10, 2017 at 12:52:32PM +0200, Andrea Bolognani wrote:
> On Mon, 2017-07-10 at 11:14 +0100, Daniel P. Berrange wrote:
> > +++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.xml
> > @@ -0,0 +1,30 @@
> > +<domain type='qemu'>
> > +  <name>QEMUGuest1</name>
> > +  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> > +  <memory unit='KiB'>219136</memory>
> > +  <currentMemory unit='KiB'>219136</currentMemory>
> 
> <currentMemory> can be left out.
> 
> > +  <vcpu placement='static'>1</vcpu>
> > +  <os>
> > +    <type arch='i686' machine='pc'>hvm</type>
> > +    <boot dev='hd'/>
> 
> <boot> is unnecessary.
> 
> > +  </os>
> > +  <clock offset='utc'/>
> > +  <on_poweroff>destroy</on_poweroff>
> > +  <on_reboot>restart</on_reboot>
> > +  <on_crash>destroy</on_crash>
> 
> <clock> and <on_*> can be removed as well.
> 
> > +  <devices>
> > +    <emulator>/usr/bin/qemu-system-i686</emulator>
> > +    <disk type='block' device='disk'>
> > +      <source dev='/dev/HostVG/QEMUGuest1'/>
> > +      <target dev='hda' bus='ide'/>
> > +      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
> > +    </disk>
> > +    <controller type='ide' index='0'/>
> 
> You can get rid of <disk> and <controller> too, then add
> <controller type='usb' model='none'/> and
> <memballoon model='none'/> to avoid unnecessary devices
> popping up in the output file.

FYI, this XML file is identical to the pre-existing qemuxml2argv-qemu-ns.xml
file, so I'm inclined to leave it as is

> 
> > +++ b/tests/qemuxml2argvtest.c
> > @@ -1505,6 +1505,7 @@ mymain(void)
> >  
> >      DO_TEST("qemu-ns", NONE);
> >      DO_TEST("qemu-ns-no-env", NONE);
> > +    DO_TEST("qemu-ns-alt", NONE);
> 
> You'll want to add this to qemuxml2xmltest too.

This wont round trip - it'll end up outputing the canonical xmlns syntax
instead, for which we already have output tests.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list