Prepare xm_internal driver for new domain XML apis

This commit is contained in:
Daniel P. Berrange 2008-07-25 13:39:02 +00:00
parent 73d021c5c1
commit 225fb3e93c
48 changed files with 568 additions and 1028 deletions

View File

@ -1,3 +1,15 @@
Fri Jul 25 14:29:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
Prepare xm_internal driver for new domain XML apis.
* src/xm_internal.c, src/xm_internal.h: Track internal
domain objects as virDomainDefPtr instead of virConfPtr
objects, and start to use generic domain APIs
* tests/xmconfigdata/*: Update to follow XML ordering
for new APIs
* tests/xmconfigtest.c: Fixup to comply with new internal
APIs.
Fri Jul 25 14:00:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/test.c: Increment dom ID tracker when setting up

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,7 @@
#include "libvirt/libvirt.h"
#include "conf.h"
#include "internal.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "domain_conf.h"
extern struct xenUnifiedDriver xenXMDriver;
int xenXMInit (void);
@ -58,11 +55,9 @@ int xenXMDomainCreate(virDomainPtr domain);
virDomainPtr xenXMDomainDefineXML(virConnectPtr con, const char *xml);
int xenXMDomainUndefine(virDomainPtr domain);
virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml);
char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf);
virConfPtr xenXMDomainConfigFormat(virConnectPtr conn, virDomainDefPtr def);
virDomainDefPtr xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf);
int xenXMDomainBlockPeek (virDomainPtr dom, const char *path, unsigned long long offset, size_t size, void *buffer);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -101,7 +101,7 @@ sexpr2xmltest_SOURCES = \
sexpr2xmltest_LDADD = $(LDADDS)
xmconfigtest_SOURCES = \
xmconfigtest.c \
xmconfigtest.c testutilsxen.c testutilsxen.h \
testutils.c testutils.h
xmconfigtest_LDADD = $(LDADDS)

View File

@ -20,7 +20,7 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso&test,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "none"
soundhw = "sb16,es1370"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2&amp;test</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader&amp;test</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm&amp;test</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,11 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<sound model='sb16'/>
<sound model='es1370'/>
</devices>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "none"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='localtime'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,10 +32,10 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "none"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,10 +32,10 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -21,6 +21,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,ioemu:hda,w" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr0,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr0,type=ioemu" ]
parallel = "none"
serial = "none"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,10 +32,10 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr0'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "tcp:127.0.0.1:7777"
serial = "none"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,15 +32,15 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<parallel type='tcp'>
<source mode='connect' host='127.0.0.1' service='7777'/>
<protocol type='raw'/>
<target port='0'/>
</parallel>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "file:/tmp/serial.log"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,9 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='file'>
<source path='/tmp/serial.log'/>
<target port='0'/>
@ -45,5 +43,7 @@
<source path='/tmp/serial.log'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "null"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,16 +32,16 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='null'>
<target port='0'/>
</serial>
<console type='null'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "pipe:/tmp/serial.pipe"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,9 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='pipe'>
<source path='/tmp/serial.pipe'/>
<target port='0'/>
@ -45,5 +43,7 @@
<source path='/tmp/serial.pipe'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "pty"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,16 +32,16 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "stdio"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,16 +32,16 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='stdio'>
<target port='0'/>
</serial>
<console type='stdio'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "telnet:127.0.0.1:9999,listen"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,9 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='tcp'>
<source mode='bind' host='127.0.0.1' service='9999'/>
<protocol type='telnet'/>
@ -47,5 +45,7 @@
<protocol type='telnet'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "tcp:127.0.0.1:7777"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,9 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='tcp'>
<source mode='connect' host='127.0.0.1' service='7777'/>
<protocol type='raw'/>
@ -47,5 +45,7 @@
<protocol type='raw'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "udp:127.0.0.1:9999@0.0.0.0:99998"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,20 +32,20 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='udp'>
<source mode='connect' host='127.0.0.1' service='9999'/>
<source mode='bind' host='0.0.0.0' service='99998'/>
<source mode='connect' host='127.0.0.1' service='9999'/>
<target port='0'/>
</serial>
<console type='udp'>
<source mode='connect' host='127.0.0.1' service='9999'/>
<source mode='bind' host='0.0.0.0' service='99998'/>
<source mode='connect' host='127.0.0.1' service='9999'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "unix:/tmp/serial.sock,listen"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,9 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<serial type='unix'>
<source mode='bind' path='/tmp/serial.sock'/>
<target port='0'/>
@ -45,5 +43,7 @@
<source mode='bind' path='/tmp/serial.sock'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,7 +20,7 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "none"
soundhw = "sb16,es1370"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,11 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<sound model='sb16'/>
<sound model='es1370'/>
</devices>

View File

@ -21,6 +21,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "none"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,11 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -32,7 +32,7 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='tablet'/>

View File

@ -21,6 +21,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "none"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,11 +32,11 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -20,6 +20,6 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
parallel = "none"
serial = "none"

View File

@ -1,23 +1,23 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<os>
<type>hvm</type>
<type arch='i686' machine='xenfv'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<vcpu>1</vcpu>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<pae/>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
@ -32,10 +32,10 @@
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:92:9C'/>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -9,4 +9,4 @@ on_reboot = "restart"
on_crash = "restart"
vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ]
disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
vif = [ "mac=00:16:3E:66:94:9C,model=e1000,ip=192.168.0.9" ]
vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,model=e1000" ]

View File

@ -1,28 +1,33 @@
<domain type='xen'>
<name>XenGuest1</name>
<uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
<bootloader>/usr/bin/pygrub</bootloader>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<os>
<type arch='i686' machine='xenpv'>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest1'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:94:9C'/>
<ip address='192.168.0.9'/>
<mac address='00:16:3e:66:94:9c'/>
<source bridge='br0'/>
<model type='e1000'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -9,4 +9,4 @@ on_reboot = "restart"
on_crash = "restart"
vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ]
disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
vif = [ "mac=00:16:3E:66:94:9C,ip=192.168.0.9" ]
vif = [ "mac=00:16:3e:66:94:9c,bridge=br0" ]

View File

@ -1,27 +1,32 @@
<domain type='xen'>
<name>XenGuest1</name>
<uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
<bootloader>/usr/bin/pygrub</bootloader>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<os>
<type arch='i686' machine='xenpv'>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest1'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:94:9C'/>
<ip address='192.168.0.9'/>
<mac address='00:16:3e:66:94:9c'/>
<source bridge='br0'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -13,4 +13,4 @@ vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
vif = [ "mac=00:16:3E:66:94:9C,ip=192.168.0.9" ]
vif = [ "mac=00:16:3e:66:94:9c,bridge=br0" ]

View File

@ -1,27 +1,32 @@
<domain type='xen'>
<name>XenGuest1</name>
<uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
<bootloader>/usr/bin/pygrub</bootloader>
<currentMemory>403456</currentMemory>
<memory>592896</memory>
<currentMemory>403456</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<os>
<type arch='i686' machine='xenpv'>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest1'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3E:66:94:9C'/>
<ip address='192.168.0.9'/>
<mac address='00:16:3e:66:94:9c'/>
<source bridge='br0'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</devices>
</domain>

View File

@ -33,10 +33,12 @@
#include "xen_unified.h"
#include "xm_internal.h"
#include "testutils.h"
#include "conf.h"
#include "testutilsxen.h"
#include "memory.h"
static char *progname;
static char *abs_srcdir;
static virCapsPtr caps;
#define MAX_FILE 4096
@ -54,6 +56,7 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
int wrote = MAX_FILE;
void *old_priv = NULL;
struct _xenUnifiedPrivate priv;
virDomainDefPtr def = NULL;
conn = virConnectOpenReadOnly("test:///default");
if (!conn) goto fail;
@ -67,9 +70,13 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
/* Many puppies died to bring you this code. */
priv.xendConfigVersion = xendConfigVersion;
priv.caps = caps;
conn->privateData = &priv;
if (!(conf = xenXMParseXMLToConfig(conn, xmlPtr)))
if (!(def = virDomainDefParseString(NULL, caps, xmlPtr)))
goto fail;
if (!(conf = xenXMDomainConfigFormat(conn, def)))
goto fail;
if (virConfWriteMem(gotxmcfgPtr, &wrote, conf) < 0)
@ -86,7 +93,7 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
fail:
if (conf)
virConfFree(conf);
virDomainDefFree(def);
if (conn) {
conn->privateData = old_priv;
virConnectClose(conn);
@ -107,6 +114,7 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
virConnectPtr conn;
void *old_priv;
struct _xenUnifiedPrivate priv;
virDomainDefPtr def = NULL;
conn = virConnectOpenReadOnly("test:///default");
if (!conn) goto fail;
@ -120,12 +128,16 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
/* Many puppies died to bring you this code. */
priv.xendConfigVersion = xendConfigVersion;
priv.caps = caps;
conn->privateData = &priv;
if (!(conf = virConfReadMem(xmcfgPtr, strlen(xmcfgPtr))))
goto fail;
if (!(gotxml = xenXMDomainFormatXML(conn, conf)))
if (!(def = xenXMDomainConfigParse(conn, conf)))
goto fail;
if (!(gotxml = virDomainDefFormat(conn, def, VIR_DOMAIN_XML_SECURE)))
goto fail;
if (STRNEQ(xmlData, gotxml)) {
@ -138,8 +150,8 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
fail:
if (conf)
virConfFree(conf);
free(gotxml);
VIR_FREE(gotxml);
virDomainDefFree(def);
if (conn) {
conn->privateData = old_priv;
virConnectClose(conn);
@ -187,6 +199,8 @@ mymain(int argc, char **argv)
if (!abs_srcdir)
abs_srcdir = getcwd(cwd, sizeof(cwd));
if (!(caps = testXenCapsInit()))
return(EXIT_FAILURE);
#define DO_TEST(name, version) \
do { \
@ -224,6 +238,9 @@ mymain(int argc, char **argv)
DO_TEST("fullvirt-sound", 2);
DO_TEST("escape-paths", 2);
virCapabilitiesFree(caps);
return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}