[libvirt] [PATCH 1/2] maint: use common xml quoting style
by Eric Blake
According to the official XML specification [1], attributes
can be specified with either ' or " (where the difference is
that you can use '"' or '"' but must use """,
and conversely for "'" or "'" vs. '''). But our
code generation in src/conf prefers to output the '' notation,
as it is easier to write C string literals for that style.
Using a consistent style throughout libvirt will make it
easier for users to copy-and-paste without wondering why we
switch quoting styles mid-stream.
[1] http://www.w3.org/TR/xml11/#NT-Reference
Mechanical conversion done with:
$ find -name '*.xml' | \
xargs sed -i 's/\([a-zA-Z0-9_]*=\)"\([^"]*\)"/\1'\''\2'\''/g'
followed by inspecting the results, and touching up the change
in tests/xml2sexprdata/xml2sexpr-escape.xml to fix 'make check'.
* cfg.mk (sc_rng_quote_style): Enforce the rule.
* examples/xml/storage/*.xml: Fix fallout.
* examples/xml/test/*.xml: Likewise.
* python/libvirt-*override-api.xml: Likewise.
* src/network/default.xml: Likewise.
* tests/*/*.xml: Likewise.
---
cfg.mk | 7 ++
examples/xml/storage/pool-dir.xml | 2 +-
examples/xml/storage/pool-fs.xml | 4 +-
examples/xml/storage/pool-logical.xml | 4 +-
examples/xml/storage/pool-netfs.xml | 6 +-
examples/xml/storage/vol-cow.xml | 6 +-
examples/xml/storage/vol-qcow.xml | 6 +-
examples/xml/storage/vol-qcow2.xml | 6 +-
examples/xml/storage/vol-raw.xml | 6 +-
examples/xml/storage/vol-sparse.xml | 4 +-
examples/xml/storage/vol-vmdk.xml | 6 +-
examples/xml/test/testnode.xml | 14 ++--
examples/xml/test/testnodeinline.xml | 66 ++++++++++----------
python/libvirt-override-api.xml | 20 +++---
python/libvirt-qemu-override-api.xml | 2 +-
src/network/default.xml | 6 +-
.../networkxml2argvdata/nat-network-dns-hosts.xml | 2 +-
tests/networkxml2xmlin/8021Qbh-net.xml | 16 +++---
tests/networkxml2xmlin/direct-net.xml | 4 +-
tests/networkxml2xmlin/host-bridge-net.xml | 4 +-
tests/networkxml2xmlin/isolated-network.xml | 6 +-
tests/networkxml2xmlin/nat-network.xml | 20 +++---
tests/networkxml2xmlin/netboot-network.xml | 12 ++--
tests/networkxml2xmlin/netboot-proxy-network.xml | 10 ++--
tests/networkxml2xmlin/routed-network.xml | 6 +-
tests/networkxml2xmlin/vepa-net.xml | 24 ++++----
tests/nwfilterxml2xmlin/stp-test.xml | 4 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml | 6 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml | 6 +-
.../qemuxml2argv-cpu-topology1.xml | 2 +-
.../qemuxml2argv-cpu-topology2.xml | 2 +-
.../qemuxml2argv-cpu-topology3.xml | 2 +-
.../qemuxml2argv-numatune-memory.xml | 2 +-
tests/storagepoolxml2xmlin/pool-iscsi-auth.xml | 4 +-
.../pool-iscsi-vendor-product.xml | 4 +-
tests/storagepoolxml2xmlin/pool-iscsi.xml | 4 +-
tests/storagepoolxml2xmlin/pool-logical-create.xml | 6 +-
tests/storagepoolxml2xmlin/pool-mpath.xml | 2 +-
tests/storagepoolxml2xmlin/pool-scsi.xml | 4 +-
tests/storagevolxml2xmlin/vol-file.xml | 2 +-
tests/storagevolxml2xmlin/vol-qcow2.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.xml | 12 ++--
tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.xml | 2 +-
.../xml2sexpr-disk-drv-blktap-qcow.xml | 2 +-
.../xml2sexpr-disk-drv-blktap-raw.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.xml | 2 +-
.../xml2sexpr-disk-drv-blktap2-raw.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-disk-drv-loop.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-escape.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-net-bridged.xml | 10 ++--
tests/xml2sexprdata/xml2sexpr-net-e1000.xml | 10 ++--
tests/xml2sexprdata/xml2sexpr-net-routed.xml | 12 ++--
tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-pv-vfb-new.xml | 2 +-
tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.xml | 2 +-
.../xml2vmxdata/xml2vmx-serial-network-client.xml | 4 +-
.../xml2vmxdata/xml2vmx-serial-network-server.xml | 4 +-
58 files changed, 201 insertions(+), 194 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 817b5f3..c964c27 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -419,6 +419,13 @@ sc_TAB_in_indentation:
halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \
$(_sc_search_regexp)
+# In xml files, prefer name='abc' over name="abc"
+sc_rng_quote_style:
+ @prohibit='\b[-a-zA-Z0-9_]+="' \
+ in_vc_files='\.(xml)$$' \
+ halt='use name='\'val\'', not name="val", in xml' \
+ $(_sc_search_regexp)
+
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
diff --git a/examples/xml/storage/pool-dir.xml b/examples/xml/storage/pool-dir.xml
index 47a3bfa..4c10792 100644
--- a/examples/xml/storage/pool-dir.xml
+++ b/examples/xml/storage/pool-dir.xml
@@ -1,4 +1,4 @@
-<pool type="dir">
+<pool type='dir'>
<name>virtimages</name>
<target>
<path>/var/lib/virt/images</path>
diff --git a/examples/xml/storage/pool-fs.xml b/examples/xml/storage/pool-fs.xml
index b0417d9..c8037f9 100644
--- a/examples/xml/storage/pool-fs.xml
+++ b/examples/xml/storage/pool-fs.xml
@@ -1,7 +1,7 @@
-<pool type="fs">
+<pool type='fs'>
<name>virtimages</name>
<source>
- <device path="/dev/VolGroup00/VirtImages"/>
+ <device path='/dev/VolGroup00/VirtImages'/>
</source>
<target>
<path>/var/lib/virt/images</path>
diff --git a/examples/xml/storage/pool-logical.xml b/examples/xml/storage/pool-logical.xml
index c33e903..16c34cb 100644
--- a/examples/xml/storage/pool-logical.xml
+++ b/examples/xml/storage/pool-logical.xml
@@ -1,7 +1,7 @@
-<pool type="logical">
+<pool type='logical'>
<name>HostVG</name>
<source>
- <device path="/dev/sda1"/>
+ <device path='/dev/sda1'/>
</source>
<target>
<path>/dev/HostVG</path>
diff --git a/examples/xml/storage/pool-netfs.xml b/examples/xml/storage/pool-netfs.xml
index d1df2e2..0585492 100644
--- a/examples/xml/storage/pool-netfs.xml
+++ b/examples/xml/storage/pool-netfs.xml
@@ -1,8 +1,8 @@
-<pool type="netfs">
+<pool type='netfs'>
<name>virtimages</name>
<source>
- <host name="nfs.example.com"/>
- <directory path="/var/lib/virt/images"/>
+ <host name='nfs.example.com'/>
+ <directory path='/var/lib/virt/images'/>
</source>
<target>
<path>/var/lib/virt/images</path>
diff --git a/examples/xml/storage/vol-cow.xml b/examples/xml/storage/vol-cow.xml
index 1d80a01..e584362 100644
--- a/examples/xml/storage/vol-cow.xml
+++ b/examples/xml/storage/vol-cow.xml
@@ -1,10 +1,10 @@
-<volume type="file">
+<volume type='file'>
<name>cow.img</name>
<storage>
<allocation>0</allocation>
- <capacity unit="T">1</capacity>
+ <capacity unit='T'>1</capacity>
</storage>
<target>
- <format type="cow"/>
+ <format type='cow'/>
</target>
</volume>
diff --git a/examples/xml/storage/vol-qcow.xml b/examples/xml/storage/vol-qcow.xml
index af2011d..879cfcd 100644
--- a/examples/xml/storage/vol-qcow.xml
+++ b/examples/xml/storage/vol-qcow.xml
@@ -1,10 +1,10 @@
-<volume type="file">
+<volume type='file'>
<name>qcow.img</name>
<storage>
<allocation>0</allocation>
- <capacity unit="T">1</capacity>
+ <capacity unit='T'>1</capacity>
</storage>
<target>
- <format type="qcow"/>
+ <format type='qcow'/>
</target>
</volume>
diff --git a/examples/xml/storage/vol-qcow2.xml b/examples/xml/storage/vol-qcow2.xml
index 9d944a7..7d806f5 100644
--- a/examples/xml/storage/vol-qcow2.xml
+++ b/examples/xml/storage/vol-qcow2.xml
@@ -1,10 +1,10 @@
-<volume type="file">
+<volume type='file'>
<name>qcow2.img</name>
<storage>
<allocation>0</allocation>
- <capacity unit="T">1</capacity>
+ <capacity unit='T'>1</capacity>
</storage>
<target>
- <format type="qcow2"/>
+ <format type='qcow2'/>
</target>
</volume>
diff --git a/examples/xml/storage/vol-raw.xml b/examples/xml/storage/vol-raw.xml
index 59d4b45..8b08090 100644
--- a/examples/xml/storage/vol-raw.xml
+++ b/examples/xml/storage/vol-raw.xml
@@ -1,7 +1,7 @@
-<volume type="file">
+<volume type='file'>
<name>raw.img</name>
<storage>
- <allocation unit="M">10</allocation>
- <capacity unit="M">1000</capacity>
+ <allocation unit='M'>10</allocation>
+ <capacity unit='M'>1000</capacity>
</storage>
</volume>
diff --git a/examples/xml/storage/vol-sparse.xml b/examples/xml/storage/vol-sparse.xml
index c529a49..40e286a 100644
--- a/examples/xml/storage/vol-sparse.xml
+++ b/examples/xml/storage/vol-sparse.xml
@@ -1,7 +1,7 @@
-<volume type="file">
+<volume type='file'>
<name>sparse.img</name>
<storage>
<allocation>0</allocation>
- <capacity unit="T">1</capacity>
+ <capacity unit='T'>1</capacity>
</storage>
</volume>
diff --git a/examples/xml/storage/vol-vmdk.xml b/examples/xml/storage/vol-vmdk.xml
index 5af0a84..2aa8e0b 100644
--- a/examples/xml/storage/vol-vmdk.xml
+++ b/examples/xml/storage/vol-vmdk.xml
@@ -1,10 +1,10 @@
-<volume type="file">
+<volume type='file'>
<name>vmdk3.img</name>
<storage>
<allocation>0</allocation>
- <capacity unit="T">1</capacity>
+ <capacity unit='T'>1</capacity>
</storage>
<target>
- <format type="vmdk"/>
+ <format type='vmdk'/>
</target>
</volume>
diff --git a/examples/xml/test/testnode.xml b/examples/xml/test/testnode.xml
index 001e353..ad02da5 100644
--- a/examples/xml/test/testnode.xml
+++ b/examples/xml/test/testnode.xml
@@ -7,14 +7,14 @@
virsh -c test://absolute/path/to/this/dir/testnode.xml nodeinfo
-->
- <domain file="testdomfv0.xml"/>
- <domain file="testdomfc4.xml"/>
- <network file="testnetpriv.xml"/>
- <network file="testnetdef.xml"/>
- <pool file="testpool.xml">
- <volume file="testvol.xml"/>
+ <domain file='testdomfv0.xml'/>
+ <domain file='testdomfc4.xml'/>
+ <network file='testnetpriv.xml'/>
+ <network file='testnetdef.xml'/>
+ <pool file='testpool.xml'>
+ <volume file='testvol.xml'/>
</pool>
- <device file="testdev.xml"/>
+ <device file='testdev.xml'/>
<cpu>
<mhz>6000</mhz>
diff --git a/examples/xml/test/testnodeinline.xml b/examples/xml/test/testnodeinline.xml
index b353f39..2de8773 100644
--- a/examples/xml/test/testnodeinline.xml
+++ b/examples/xml/test/testnodeinline.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version='1.0'?>
<node>
<!-- This file gives an example config for the mock 'test' backend
driver to libvirt. This is intended to allow relible unit testing
@@ -8,13 +8,13 @@
virsh -connect test:////path/to/this/dir/testnode.xml nodeinfo
-->
- <domain type="test">
+ <domain type='test'>
<name>fv0</name>
<uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
<os>
<type>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
- <boot dev="hd"/>
+ <boot dev='hd'/>
</os>
<memory>524288</memory>
<maxMemory>1524288</maxMemory>
@@ -29,28 +29,28 @@
</features>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
- <interface type="bridge">
- <source bridge="xenbr0"/>
- <mac address="00:16:3e:5d:c7:9e"/>
- <script path="vif-bridge"/>
+ <interface type='bridge'>
+ <source bridge='xenbr0'/>
+ <mac address='00:16:3e:5d:c7:9e'/>
+ <script path='vif-bridge'/>
</interface>
- <disk type="file">
- <source file="/root/fv0"/>
- <target dev="hda"/>
+ <disk type='file'>
+ <source file='/root/fv0'/>
+ <target dev='hda'/>
</disk>
- <disk type="file" device="cdrom">
- <source file="/root/fc5-x86_64-boot.iso"/>
- <target dev="hdc"/>
+ <disk type='file' device='cdrom'>
+ <source file='/root/fc5-x86_64-boot.iso'/>
+ <target dev='hdc'/>
<readonly/>
</disk>
- <disk type="file" device="floppy">
- <source file="/root/fd.img"/>
- <target dev="fda"/>
+ <disk type='file' device='floppy'>
+ <source file='/root/fd.img'/>
+ <target dev='fda'/>
</disk>
- <graphics type="vnc" port="5904"/>
+ <graphics type='vnc' port='5904'/>
</devices>
</domain>
- <domain type="test">
+ <domain type='test'>
<name>fc4</name>
<uuid>EF86180145B911CB88E3AFBFE5370493</uuid>
<os>
@@ -64,36 +64,36 @@
<currentMemory>131072</currentMemory>
<vcpu>1</vcpu>
<devices>
- <disk type="file">
- <source file="/u/fc4.img"/>
- <target dev="sda1"/>
+ <disk type='file'>
+ <source file='/u/fc4.img'/>
+ <target dev='sda1'/>
</disk>
- <interface type="bridge">
- <source bridge="xenbr0"/>
- <mac address="aa:00:00:00:00:11"/>
- <script path="/etc/xen/scripts/vif-bridge"/>
+ <interface type='bridge'>
+ <source bridge='xenbr0'/>
+ <mac address='aa:00:00:00:00:11'/>
+ <script path='/etc/xen/scripts/vif-bridge'/>
</interface>
- <console tty="/dev/pts/5"/>
+ <console tty='/dev/pts/5'/>
</devices>
</domain>
<network>
<name>private</name>
<uuid>004b22212d78c30f5aa5f03c87d21e69</uuid>
- <bridge name="brpriv"/>
- <ip address="192.168.124.1" netmask="255.255.255.0">
+ <bridge name='brpriv'/>
+ <ip address='192.168.124.1' netmask='255.255.255.0'>
<dhcp>
- <range start="192.168.124.128" end="192.168.124.253"/>
+ <range start='192.168.124.128' end='192.168.124.253'/>
</dhcp>
</ip>
</network>
<network>
<name>default</name>
<uuid>004b96e12d78c30f5aa5f03c87d21e69</uuid>
- <bridge name="brdefault"/>
- <forward dev="eth0"/>
- <ip address="192.168.122.1" netmask="255.255.255.0">
+ <bridge name='brdefault'/>
+ <forward dev='eth0'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
- <range start="192.168.122.128" end="192.168.122.253"/>
+ <range start='192.168.122.128' end='192.168.122.253'/>
</dhcp>
</ip>
</network>
diff --git a/python/libvirt-override-api.xml b/python/libvirt-override-api.xml
index 7c18763..1c78de4 100644
--- a/python/libvirt-override-api.xml
+++ b/python/libvirt-override-api.xml
@@ -1,20 +1,20 @@
-<?xml version="1.0"?>
+<?xml version='1.0'?>
<api name='libvir-python'>
<symbols>
- <function name="virConnectGetVersion" file='python'>
+ <function name='virConnectGetVersion' file='python'>
<info>Returns the running hypervisor version of the connection host</info>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
- <return type='int' info="0 on success, -1 on error"/>
+ <return type='int' info='0 on success, -1 on error'/>
</function>
- <function name="virConnectGetLibVersion" file='python'>
+ <function name='virConnectGetLibVersion' file='python'>
<info>Returns the libvirt version of the connection host</info>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
- <return type='int' info="0 on success, -1 on error"/>
+ <return type='int' info='0 on success, -1 on error'/>
</function>
- <function name="virConnectListDomainsID" file='python'>
+ <function name='virConnectListDomainsID' file='python'>
<info>Returns the list of the ID of the domains on the hypervisor</info>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
- <return type='int *' info="the list of ID or None in case of error"/>
+ <return type='int *' info='the list of ID or None in case of error'/>
</function>
<function name='virConnectListDefinedDomains' file='python'>
<info>list the defined domains, stores the pointers to the names in @names</info>
@@ -160,12 +160,12 @@
<return type='virDomainMemoryStats' info='a dictionary of statistics'/>
<arg name='domain' type='virDomainPtr' info='a domain object'/>
</function>
- <function name="virNodeGetCellsFreeMemory" file='python'>
+ <function name='virNodeGetCellsFreeMemory' file='python'>
<info>Returns the available memory for a list of cells</info>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
<arg name='startCell' type='int' info='first cell in the list'/>
<arg name='maxCells' type='int' info='number of cell in the list'/>
- <return type='int *' info="the list available memory in the cells"/>
+ <return type='int *' info='the list available memory in the cells'/>
</function>
<function name='virDomainGetSchedulerParameters' file='python'>
<info>Get the scheduler parameters, the @params array will be filled with the values.</info>
@@ -374,7 +374,7 @@
<arg name='dom' type='virDomainPtr' info='dummy domain pointer'/>
<arg name='snap' type='virDomainSnapshotPtr' info='pointer to the snapshot'/>
<arg name='flags' type='unsigned int' info='flags'/>
- <return type='int' info="0 on success, -1 on error"/>
+ <return type='int' info='0 on success, -1 on error'/>
</function>
<function name='virDomainGetBlockJobInfo' file='python'>
<info>Get progress information for a block job</info>
diff --git a/python/libvirt-qemu-override-api.xml b/python/libvirt-qemu-override-api.xml
index d69acea..d4bce23 100644
--- a/python/libvirt-qemu-override-api.xml
+++ b/python/libvirt-qemu-override-api.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version='1.0'?>
<api name='libvir-qemu-python'>
<symbols>
<function name='virDomainQemuMonitorCommand' file='python-qemu'>
diff --git a/src/network/default.xml b/src/network/default.xml
index 9cfc01e..2c44f13 100644
--- a/src/network/default.xml
+++ b/src/network/default.xml
@@ -1,10 +1,10 @@
<network>
<name>default</name>
- <bridge name="virbr0" />
+ <bridge name='virbr0' />
<forward/>
- <ip address="192.168.122.1" netmask="255.255.255.0">
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
- <range start="192.168.122.2" end="192.168.122.254" />
+ <range start='192.168.122.2' end='192.168.122.254' />
</dhcp>
</ip>
</network>
diff --git a/tests/networkxml2argvdata/nat-network-dns-hosts.xml b/tests/networkxml2argvdata/nat-network-dns-hosts.xml
index 2180a5d..cbde112 100644
--- a/tests/networkxml2argvdata/nat-network-dns-hosts.xml
+++ b/tests/networkxml2argvdata/nat-network-dns-hosts.xml
@@ -3,7 +3,7 @@
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
<forward dev='eth0' mode='nat'/>
<bridge name='virbr0' stp='on' delay='0' />
- <domain name="example.com"/>
+ <domain name='example.com'/>
<dns>
<host ip='192.168.122.1'>
<hostname>host</hostname>
diff --git a/tests/networkxml2xmlin/8021Qbh-net.xml b/tests/networkxml2xmlin/8021Qbh-net.xml
index 2d779dc..33930d5 100644
--- a/tests/networkxml2xmlin/8021Qbh-net.xml
+++ b/tests/networkxml2xmlin/8021Qbh-net.xml
@@ -1,14 +1,14 @@
<network>
<name>8021Qbh-net</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a8c</uuid>
- <forward mode="private" dev="eth1">
- <interface dev="eth1"/>
- <interface dev="eth2"/>
- <interface dev="eth3"/>
- <interface dev="eth4"/>
- <interface dev="eth5"/>
+ <forward mode='private' dev='eth1'>
+ <interface dev='eth1'/>
+ <interface dev='eth2'/>
+ <interface dev='eth3'/>
+ <interface dev='eth4'/>
+ <interface dev='eth5'/>
</forward>
- <virtualport type="802.1Qbh">
- <parameters profileid="spongebob24"/>
+ <virtualport type='802.1Qbh'>
+ <parameters profileid='spongebob24'/>
</virtualport>
</network>
diff --git a/tests/networkxml2xmlin/direct-net.xml b/tests/networkxml2xmlin/direct-net.xml
index d73c454..86e1206 100644
--- a/tests/networkxml2xmlin/direct-net.xml
+++ b/tests/networkxml2xmlin/direct-net.xml
@@ -1,7 +1,7 @@
<network>
<name>direct-net</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a8f</uuid>
- <forward mode="bridge">
- <interface dev="eth10"/>
+ <forward mode='bridge'>
+ <interface dev='eth10'/>
</forward>
</network>
diff --git a/tests/networkxml2xmlin/host-bridge-net.xml b/tests/networkxml2xmlin/host-bridge-net.xml
index 960bc2d..c76d64a 100644
--- a/tests/networkxml2xmlin/host-bridge-net.xml
+++ b/tests/networkxml2xmlin/host-bridge-net.xml
@@ -1,6 +1,6 @@
<network>
<name>host-bridge-net</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a8e</uuid>
- <forward mode="bridge"/>
- <bridge name="br0"/>
+ <forward mode='bridge'/>
+ <bridge name='br0'/>
</network>
diff --git a/tests/networkxml2xmlin/isolated-network.xml b/tests/networkxml2xmlin/isolated-network.xml
index 0d562ea..ec9e4e2 100644
--- a/tests/networkxml2xmlin/isolated-network.xml
+++ b/tests/networkxml2xmlin/isolated-network.xml
@@ -1,11 +1,11 @@
<network>
<name>private</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
- <bridge name="virbr2" />
+ <bridge name='virbr2' />
<mac address='52:54:00:17:3F:37'/>
- <ip address="192.168.152.1" netmask="255.255.255.0">
+ <ip address='192.168.152.1' netmask='255.255.255.0'>
<dhcp>
- <range start="192.168.152.2" end="192.168.152.254" />
+ <range start='192.168.152.2' end='192.168.152.254' />
</dhcp>
</ip>
</network>
diff --git a/tests/networkxml2xmlin/nat-network.xml b/tests/networkxml2xmlin/nat-network.xml
index 23f7fcb..1f1c605 100644
--- a/tests/networkxml2xmlin/nat-network.xml
+++ b/tests/networkxml2xmlin/nat-network.xml
@@ -1,21 +1,21 @@
<network>
<name>default</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
- <bridge name="virbr0" />
- <forward mode="nat" dev="eth1"/>
- <ip address="192.168.122.1" netmask="255.255.255.0">
+ <bridge name='virbr0' />
+ <forward mode='nat' dev='eth1'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
- <range start="192.168.122.2" end="192.168.122.254" />
- <host mac="00:16:3e:77:e2:ed" name="a.example.com" ip="192.168.122.10" />
- <host mac="00:16:3e:3e:a9:1a" name="b.example.com" ip="192.168.122.11" />
+ <range start='192.168.122.2' end='192.168.122.254' />
+ <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10' />
+ <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11' />
</dhcp>
</ip>
- <ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0">
+ <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'>
</ip>
- <ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64">
+ <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'>
</ip>
- <ip family="ipv6" address="2001:db8:ac10:fd01::1" prefix="64">
+ <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'>
</ip>
- <ip family="ipv4" address="10.24.10.1">
+ <ip family='ipv4' address='10.24.10.1'>
</ip>
</network>
diff --git a/tests/networkxml2xmlin/netboot-network.xml b/tests/networkxml2xmlin/netboot-network.xml
index ed75663..d6b842c 100644
--- a/tests/networkxml2xmlin/netboot-network.xml
+++ b/tests/networkxml2xmlin/netboot-network.xml
@@ -1,14 +1,14 @@
<network>
<name>netboot</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
- <bridge name="virbr1" stp='off' delay='1'/>
- <domain name="example.com"/>
+ <bridge name='virbr1' stp='off' delay='1'/>
+ <domain name='example.com'/>
<forward/>
- <ip address="192.168.122.1" netmask="255.255.255.0">
- <tftp root="/var/lib/tftproot" />
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <tftp root='/var/lib/tftproot' />
<dhcp>
- <range start="192.168.122.2" end="192.168.122.254" />
- <bootp file="pxeboot.img" />
+ <range start='192.168.122.2' end='192.168.122.254' />
+ <bootp file='pxeboot.img' />
</dhcp>
</ip>
</network>
diff --git a/tests/networkxml2xmlin/netboot-proxy-network.xml b/tests/networkxml2xmlin/netboot-proxy-network.xml
index ecb6738..f07a4b2 100644
--- a/tests/networkxml2xmlin/netboot-proxy-network.xml
+++ b/tests/networkxml2xmlin/netboot-proxy-network.xml
@@ -1,13 +1,13 @@
<network>
<name>netboot</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
- <bridge name="virbr1" stp='off' delay='1'/>
- <domain name="example.com"/>
+ <bridge name='virbr1' stp='off' delay='1'/>
+ <domain name='example.com'/>
<forward/>
- <ip address="192.168.122.1" netmask="255.255.255.0">
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
- <range start="192.168.122.2" end="192.168.122.254" />
- <bootp file="pxeboot.img" server="10.20.30.40" />
+ <range start='192.168.122.2' end='192.168.122.254' />
+ <bootp file='pxeboot.img' server='10.20.30.40' />
</dhcp>
</ip>
</network>
diff --git a/tests/networkxml2xmlin/routed-network.xml b/tests/networkxml2xmlin/routed-network.xml
index 61d73c0..5e47038 100644
--- a/tests/networkxml2xmlin/routed-network.xml
+++ b/tests/networkxml2xmlin/routed-network.xml
@@ -1,9 +1,9 @@
<network>
<name>local</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
- <bridge name="virbr1" />
+ <bridge name='virbr1' />
<mac address='12:34:56:78:9A:BC'/>
- <forward mode="route" dev="eth1"/>
- <ip address="192.168.122.1" netmask="255.255.255.0">
+ <forward mode='route' dev='eth1'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
</ip>
</network>
diff --git a/tests/networkxml2xmlin/vepa-net.xml b/tests/networkxml2xmlin/vepa-net.xml
index b1a40c6..5672ed3 100644
--- a/tests/networkxml2xmlin/vepa-net.xml
+++ b/tests/networkxml2xmlin/vepa-net.xml
@@ -1,22 +1,22 @@
<network>
<name>vepa-net</name>
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a8b</uuid>
- <forward mode="vepa">
- <interface dev="eth1"/>
- <interface dev="eth2"/>
- <interface dev="eth3"/>
+ <forward mode='vepa'>
+ <interface dev='eth1'/>
+ <interface dev='eth2'/>
+ <interface dev='eth3'/>
</forward>
- <virtualport type="802.1Qbg">
- <parameters managerid="11" typeid="1193047" typeidversion="2" instanceid="b153fa89-1b87-9719-ec12-99e0054fb844"/>
+ <virtualport type='802.1Qbg'>
+ <parameters managerid='11' typeid='1193047' typeidversion='2' instanceid='b153fa89-1b87-9719-ec12-99e0054fb844'/>
</virtualport>
- <portgroup name="bob" default="yes">
- <virtualport type="802.1Qbg">
- <parameters managerid="12" typeid="2193047" typeidversion="3" instanceid="5d00e0ba-e15c-959c-fbb6-b595b0655735"/>
+ <portgroup name='bob' default='yes'>
+ <virtualport type='802.1Qbg'>
+ <parameters managerid='12' typeid='2193047' typeidversion='3' instanceid='5d00e0ba-e15c-959c-fbb6-b595b0655735'/>
</virtualport>
</portgroup>
- <portgroup name="alice">
- <virtualport type="802.1Qbg">
- <parameters managerid="13" typeid="3193047" typeidversion="4" instanceid="70bf45f9-01a8-f5ee-3c0f-e25a0a2e44a6"/>
+ <portgroup name='alice'>
+ <virtualport type='802.1Qbg'>
+ <parameters managerid='13' typeid='3193047' typeidversion='4' instanceid='70bf45f9-01a8-f5ee-3c0f-e25a0a2e44a6'/>
</virtualport>
</portgroup>
</network>
diff --git a/tests/nwfilterxml2xmlin/stp-test.xml b/tests/nwfilterxml2xmlin/stp-test.xml
index de9d3e2..3056df8 100644
--- a/tests/nwfilterxml2xmlin/stp-test.xml
+++ b/tests/nwfilterxml2xmlin/stp-test.xml
@@ -8,14 +8,14 @@
<rule action='return' direction='out'>
<stp srcmacaddr='1:2:3:4:5:6' srcmacmask='ff:ff:ff:ff:ff:ff'
root-priority='0x1234' root-priority-hi='0x2345'
- root-address="6:5:4:3:2:1" root-address-mask='ff:ff:ff:ff:ff:ff'
+ root-address='6:5:4:3:2:1' root-address-mask='ff:ff:ff:ff:ff:ff'
root-cost='0x11223344' root-cost-hi='0x22334455' />
</rule>
<rule action='reject' direction='in'>
<stp srcmacaddr='1:2:3:4:5:6' srcmacmask='ff:ff:ff:ff:ff:ff'
sender-priority='0x1234'
- sender-address="6:5:4:3:2:1"
+ sender-address='6:5:4:3:2:1'
port='123' port-hi='234'
age='5544' age-hi='5555'
max-age='7777' max-age-hi='8888'
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml
index 9fcdda8..de03711 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml
@@ -9,10 +9,10 @@
<boot dev='network'/>
</os>
<cpu>
- <topology sockets="2" cores="4" threads="2"/>
+ <topology sockets='2' cores='4' threads='2'/>
<numa>
- <cell cpus="0-7" memory="109550"/>
- <cell cpus="8-15" memory="109550"/>
+ <cell cpus='0-7' memory='109550'/>
+ <cell cpus='8-15' memory='109550'/>
</numa>
</cpu>
<clock offset='utc'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml
index 9fcdda8..de03711 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml
@@ -9,10 +9,10 @@
<boot dev='network'/>
</os>
<cpu>
- <topology sockets="2" cores="4" threads="2"/>
+ <topology sockets='2' cores='4' threads='2'/>
<numa>
- <cell cpus="0-7" memory="109550"/>
- <cell cpus="8-15" memory="109550"/>
+ <cell cpus='0-7' memory='109550'/>
+ <cell cpus='8-15' memory='109550'/>
</numa>
</cpu>
<clock offset='utc'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
index 6b37207..7530950 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
@@ -9,7 +9,7 @@
<boot dev='network'/>
</os>
<cpu>
- <topology sockets="3" cores="2" threads="1"/>
+ <topology sockets='3' cores='2' threads='1'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
index 9f09e81..904d4fe 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
@@ -10,7 +10,7 @@
</os>
<cpu match='exact'>
<model>core2duo</model>
- <topology sockets="1" cores="2" threads="3"/>
+ <topology sockets='1' cores='2' threads='3'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
index 6b37207..7530950 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
@@ -9,7 +9,7 @@
<boot dev='network'/>
</os>
<cpu>
- <topology sockets="3" cores="2" threads="1"/>
+ <topology sockets='3' cores='2' threads='1'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.xml b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.xml
index 66ec6d0..dff63e4 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.xml
@@ -5,7 +5,7 @@
<currentMemory>219136</currentMemory>
<vcpu>2</vcpu>
<numatune>
- <memory mode="strict" nodeset="0-5,^4"/>
+ <memory mode='strict' nodeset='0-5,^4'/>
</numatune>
<os>
<type arch='i686' machine='pc'>hvm</type>
diff --git a/tests/storagepoolxml2xmlin/pool-iscsi-auth.xml b/tests/storagepoolxml2xmlin/pool-iscsi-auth.xml
index f7d4d52..f0755bf 100644
--- a/tests/storagepoolxml2xmlin/pool-iscsi-auth.xml
+++ b/tests/storagepoolxml2xmlin/pool-iscsi-auth.xml
@@ -2,8 +2,8 @@
<name>virtimages</name>
<uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
<source>
- <host name="iscsi.example.com"/>
- <device path="demo-target"/>
+ <host name='iscsi.example.com'/>
+ <device path='demo-target'/>
<auth type='chap' login='foobar' passwd='frobbar'/>
</source>
<target>
diff --git a/tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml b/tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml
index 01fbd9b..3889464 100644
--- a/tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml
+++ b/tests/storagepoolxml2xmlin/pool-iscsi-vendor-product.xml
@@ -2,8 +2,8 @@
<name>virtimages</name>
<uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
<source>
- <host name="iscsi.example.com"/>
- <device path="demo-target"/>
+ <host name='iscsi.example.com'/>
+ <device path='demo-target'/>
<auth type='chap' login='foobar' passwd='frobbar'/>
<vendor name='test-vendor'/>
<product name='test-product'/>
diff --git a/tests/storagepoolxml2xmlin/pool-iscsi.xml b/tests/storagepoolxml2xmlin/pool-iscsi.xml
index 37a16f7..c22b02e 100644
--- a/tests/storagepoolxml2xmlin/pool-iscsi.xml
+++ b/tests/storagepoolxml2xmlin/pool-iscsi.xml
@@ -2,8 +2,8 @@
<name>virtimages</name>
<uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
<source>
- <host name="iscsi.example.com"/>
- <device path="demo-target"/>
+ <host name='iscsi.example.com'/>
+ <device path='demo-target'/>
</source>
<target>
<path>/dev/disk/by-path</path>
diff --git a/tests/storagepoolxml2xmlin/pool-logical-create.xml b/tests/storagepoolxml2xmlin/pool-logical-create.xml
index 4c67089..9b3a6f3 100644
--- a/tests/storagepoolxml2xmlin/pool-logical-create.xml
+++ b/tests/storagepoolxml2xmlin/pool-logical-create.xml
@@ -5,9 +5,9 @@
<allocation>99220455424</allocation>
<available>671088640</available>
<source>
- <device path="/dev/sdb1"/>
- <device path="/dev/sdb2"/>
- <device path="/dev/sdb3"/>
+ <device path='/dev/sdb1'/>
+ <device path='/dev/sdb2'/>
+ <device path='/dev/sdb3'/>
</source>
<target>
<path>/dev/HostVG</path>
diff --git a/tests/storagepoolxml2xmlin/pool-mpath.xml b/tests/storagepoolxml2xmlin/pool-mpath.xml
index a5fbbcb..7144cc3 100644
--- a/tests/storagepoolxml2xmlin/pool-mpath.xml
+++ b/tests/storagepoolxml2xmlin/pool-mpath.xml
@@ -1,4 +1,4 @@
-<pool type="mpath">
+<pool type='mpath'>
<name>mpath</name>
<uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
<target>
diff --git a/tests/storagepoolxml2xmlin/pool-scsi.xml b/tests/storagepoolxml2xmlin/pool-scsi.xml
index 3650e43..85720d0 100644
--- a/tests/storagepoolxml2xmlin/pool-scsi.xml
+++ b/tests/storagepoolxml2xmlin/pool-scsi.xml
@@ -1,8 +1,8 @@
-<pool type="scsi">
+<pool type='scsi'>
<name>hba0</name>
<uuid>e9392370-2917-565e-692b-d057f46512d6</uuid>
<source>
- <adapter name="host0"/>
+ <adapter name='host0'/>
</source>
<target>
<path>/dev/disk/by-path</path>
diff --git a/tests/storagevolxml2xmlin/vol-file.xml b/tests/storagevolxml2xmlin/vol-file.xml
index d7de0aa..f9a3635 100644
--- a/tests/storagevolxml2xmlin/vol-file.xml
+++ b/tests/storagevolxml2xmlin/vol-file.xml
@@ -1,7 +1,7 @@
<volume>
<name>sparse.img</name>
<source/>
- <capacity unit="T">1</capacity>
+ <capacity unit='T'>1</capacity>
<allocation>0</allocation>
<target>
<path>/var/lib/libvirt/images/sparse.img</path>
diff --git a/tests/storagevolxml2xmlin/vol-qcow2.xml b/tests/storagevolxml2xmlin/vol-qcow2.xml
index b4924de..22ce6a0 100644
--- a/tests/storagevolxml2xmlin/vol-qcow2.xml
+++ b/tests/storagevolxml2xmlin/vol-qcow2.xml
@@ -3,7 +3,7 @@
<key>/var/lib/libvirt/images/OtherDemo.img</key>
<source>
</source>
- <capacity unit="G">5</capacity>
+ <capacity unit='G'>5</capacity>
<allocation>294912</allocation>
<target>
<path>/var/lib/libvirt/images/OtherDemo.img</path>
diff --git a/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.xml b/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.xml
index 83daf82..73cfda7 100644
--- a/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.xml
+++ b/tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.xml
@@ -17,12 +17,12 @@
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
- <interface type="bridge">
- <mac address="00:11:22:33:44:55"/>
- <source bridge="xenbr2"/>
- <ip address="192.0.2.1"/>
- <script path="vif-bridge"/>
- <target dev="vif4.0"/>
+ <interface type='bridge'>
+ <mac address='00:11:22:33:44:55'/>
+ <source bridge='xenbr2'/>
+ <ip address='192.0.2.1'/>
+ <script path='vif-bridge'/>
+ <target dev='vif4.0'/>
</interface>
<console tty='/dev/pts/4'/>
</devices>
diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.xml b/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.xml
index 97d88e0..1cdc850 100644
--- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.xml
+++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blkback.xml
@@ -14,7 +14,7 @@
<on_crash>destroy</on_crash>
<devices>
<disk type='block' device='disk'>
- <driver name="phy"/>
+ <driver name='phy'/>
<source dev='/dev/MainVG/GuestLV'/>
<target dev='xvda'/>
</disk>
diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml
index 008658c..91e22c7 100644
--- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml
+++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml
@@ -14,7 +14,7 @@
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name="tap" type="qcow"/>
+ <driver name='tap' type='qcow'/>
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml
index 630b3f9..218a8e4 100644
--- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml
+++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml
@@ -14,7 +14,7 @@
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name="tap" type="aio"/>
+ <driver name='tap' type='aio'/>
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.xml b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.xml
index 324b6d0..4b9a88b 100644
--- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.xml
+++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap.xml
@@ -14,7 +14,7 @@
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name="tap"/>
+ <driver name='tap'/>
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.xml b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.xml
index 0cc37cc..6a18368 100644
--- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.xml
+++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2-raw.xml
@@ -14,7 +14,7 @@
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name="tap2" type="aio"/>
+ <driver name='tap2' type='aio'/>
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.xml b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.xml
index 67cce17..44d0ee7 100644
--- a/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.xml
+++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-blktap2.xml
@@ -14,7 +14,7 @@
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name="tap2"/>
+ <driver name='tap2'/>
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
diff --git a/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.xml b/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.xml
index 978ca7c..cd5d7cc 100644
--- a/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.xml
+++ b/tests/xml2sexprdata/xml2sexpr-disk-drv-loop.xml
@@ -14,7 +14,7 @@
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
- <driver name="file"/>
+ <driver name='file'/>
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
diff --git a/tests/xml2sexprdata/xml2sexpr-escape.xml b/tests/xml2sexprdata/xml2sexpr-escape.xml
index 6eed578..bca2c81 100644
--- a/tests/xml2sexprdata/xml2sexpr-escape.xml
+++ b/tests/xml2sexprdata/xml2sexpr-escape.xml
@@ -5,7 +5,7 @@
<type>hvm</type>
<kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel>
<initrd>/var/lib/xen/initrd.img.0u-Vhq</initrd>
- <cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test..."devel" </cmdline>
+ <cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test..." </cmdline>
<loader>/usr/lib/xen/boot/hvmloader</loader>
</os>
<memory>430080</memory>
diff --git a/tests/xml2sexprdata/xml2sexpr-net-bridged.xml b/tests/xml2sexprdata/xml2sexpr-net-bridged.xml
index 5f68a6d..80a91ac 100644
--- a/tests/xml2sexprdata/xml2sexpr-net-bridged.xml
+++ b/tests/xml2sexprdata/xml2sexpr-net-bridged.xml
@@ -17,11 +17,11 @@
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
- <interface type="bridge">
- <mac address="00:11:22:33:44:55"/>
- <source bridge="xenbr2"/>
- <script path="vif-bridge"/>
- <target dev="vif4.0"/>
+ <interface type='bridge'>
+ <mac address='00:11:22:33:44:55'/>
+ <source bridge='xenbr2'/>
+ <script path='vif-bridge'/>
+ <target dev='vif4.0'/>
</interface>
<console tty='/dev/pts/4'/>
</devices>
diff --git a/tests/xml2sexprdata/xml2sexpr-net-e1000.xml b/tests/xml2sexprdata/xml2sexpr-net-e1000.xml
index 6e9ce94..3916d54 100644
--- a/tests/xml2sexprdata/xml2sexpr-net-e1000.xml
+++ b/tests/xml2sexprdata/xml2sexpr-net-e1000.xml
@@ -17,12 +17,12 @@
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
- <interface type="bridge">
- <mac address="00:11:22:33:44:55"/>
- <source bridge="xenbr2"/>
- <script path="vif-bridge"/>
+ <interface type='bridge'>
+ <mac address='00:11:22:33:44:55'/>
+ <source bridge='xenbr2'/>
+ <script path='vif-bridge'/>
<model type='e1000'/>
- <target dev="vif4.0"/>
+ <target dev='vif4.0'/>
</interface>
<console tty='/dev/pts/4'/>
</devices>
diff --git a/tests/xml2sexprdata/xml2sexpr-net-routed.xml b/tests/xml2sexprdata/xml2sexpr-net-routed.xml
index 778c911..1fa24e6 100644
--- a/tests/xml2sexprdata/xml2sexpr-net-routed.xml
+++ b/tests/xml2sexprdata/xml2sexpr-net-routed.xml
@@ -17,12 +17,12 @@
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
- <interface type="ethernet">
- <mac address="00:11:22:33:44:55"/>
- <ip address="172.14.5.6"/>
- <source dev="eth3"/>
- <script path="vif-routed"/>
- <target dev="vif4.0"/>
+ <interface type='ethernet'>
+ <mac address='00:11:22:33:44:55'/>
+ <ip address='172.14.5.6'/>
+ <source dev='eth3'/>
+ <script path='vif-routed'/>
+ <target dev='vif4.0'/>
</interface>
<console tty='/dev/pts/4'/>
</devices>
diff --git a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.xml b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.xml
index c17d9d5..ec12fb3 100644
--- a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.xml
+++ b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new-auto.xml
@@ -18,6 +18,6 @@
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
- <graphics type='vnc' port='-1' autoport='yes' listen="127.0.0.1" passwd="123456" keymap="ja"/>
+ <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123456' keymap='ja'/>
</devices>
</domain>
diff --git a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.xml b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.xml
index a8430eb..5b0d19a 100644
--- a/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.xml
+++ b/tests/xml2sexprdata/xml2sexpr-pv-vfb-new.xml
@@ -18,6 +18,6 @@
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
- <graphics type='vnc' port='5906' listen="127.0.0.1" passwd="123456" keymap="ja"/>
+ <graphics type='vnc' port='5906' listen='127.0.0.1' passwd='123456' keymap='ja'/>
</devices>
</domain>
diff --git a/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.xml b/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.xml
index a8430eb..5b0d19a 100644
--- a/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.xml
+++ b/tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.xml
@@ -18,6 +18,6 @@
<source file='/root/some.img'/>
<target dev='xvda'/>
</disk>
- <graphics type='vnc' port='5906' listen="127.0.0.1" passwd="123456" keymap="ja"/>
+ <graphics type='vnc' port='5906' listen='127.0.0.1' passwd='123456' keymap='ja'/>
</devices>
</domain>
diff --git a/tests/xml2vmxdata/xml2vmx-serial-network-client.xml b/tests/xml2vmxdata/xml2vmx-serial-network-client.xml
index e2a5afe..a40b135 100644
--- a/tests/xml2vmxdata/xml2vmx-serial-network-client.xml
+++ b/tests/xml2vmxdata/xml2vmx-serial-network-client.xml
@@ -7,8 +7,8 @@
</os>
<devices>
<serial type='tcp'>
- <source mode="connect" host="192.168.0.17" service="42001"/>
- <protocol type="raw"/>
+ <source mode='connect' host='192.168.0.17' service='42001'/>
+ <protocol type='raw'/>
<target port='0'/>
</serial>
</devices>
diff --git a/tests/xml2vmxdata/xml2vmx-serial-network-server.xml b/tests/xml2vmxdata/xml2vmx-serial-network-server.xml
index a17e2fe..2d33073 100644
--- a/tests/xml2vmxdata/xml2vmx-serial-network-server.xml
+++ b/tests/xml2vmxdata/xml2vmx-serial-network-server.xml
@@ -7,8 +7,8 @@
</os>
<devices>
<serial type='tcp'>
- <source mode="bind" host="0.0.0.0" service="42001"/>
- <protocol type="tls"/>
+ <source mode='bind' host='0.0.0.0' service='42001'/>
+ <protocol type='tls'/>
<target port='0'/>
</serial>
</devices>
--
1.7.7.3
13 years, 4 months
[libvirt] [PATCH 0/6] Add new command domiftune
by Hu Tao
This series adds a new command domiftune to get/set parameters of
domain's network interfaces. Supported parameters are bandwidth
settings.
Currently the network interface bandwidth can only be set:
- in domain's xml before the domain is up
- when attaching an interface by attach-interface
With this series, users can change network interface bandwidth
settings using virsh, whether the domain is running or not.
Hu Tao (6):
Add API virDomain{S,G}etInterfaceParameters
virDomain{S,G}etInterfaceParameters: the main entry points
Add virDomain{S,G}etInterfaceparameters support to the remote driver
Add virDomain{S,G}etInterfaceParameters support to qemu driver
Enable the virDomain{S,G}etInterfaceParameters in virsh
Add document for the new command domiftune
daemon/remote.c | 64 ++++++
include/libvirt/libvirt.h.in | 50 +++++
python/generator.py | 2 +
src/driver.h | 12 ++
src/libvirt.c | 118 ++++++++++++
src/libvirt_public.syms | 6 +
src/qemu/qemu_driver.c | 434 ++++++++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 52 +++++
src/remote/remote_protocol.x | 28 +++-
src/remote_protocol-structs | 24 +++
tools/virsh.c | 227 ++++++++++++++++++++++
tools/virsh.pod | 21 ++
12 files changed, 1037 insertions(+), 1 deletions(-)
--
1.7.3.1
13 years, 4 months
[libvirt] a compilation issue
by Alex Jia
Hi developers,
I met the following compilation issue when I 'git checkout v0.9.8-rc1' tag
then run './configure && make':
<snip>
Copying file ._bootmp/gnulib/lib/netinet_in.in.h
Copying file ._bootmp/gnulib/lib/nonblocking.c
Copying file ._bootmp/gnulib/lib/nonblocking.h
Copying file ._bootmp/gnulib/lib/open.c
.gnulib/gnulib-tool: line 1475: patch: command not found
.gnulib/gnulib-tool: *** patch file gnulib/local/lib/openpty.c.diff didn't apply cleanly
.gnulib/gnulib-tool: *** Stop.
Failed to bootstrap, please investigate.
make: *** [_autogen] Error 1
</snip>
Has any advice about this?
BTW, it's fine when I compiled latest GIT head.
Thanks,
Alex
--------------------------------------------
IRC: #virt, #libvirt-qe, #apac-qa
Phone: +86-10-6260-8185
--------------------------------------------
13 years, 4 months
[libvirt] [PATCH] Prevent crash of libvirtd when attaching to existing qemu process
by Jim Fehlig
With security_driver set to "none" in /etc/libvirt/qemu.conf,
libvirtd would crash when attempted to attach to an existing
qemu process. Only copy the security model if it actually exists.
---
src/qemu/qemu_process.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 9309761..45ed011 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3609,7 +3609,8 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
if (virSecurityManagerGetProcessLabel(driver->securityManager,
vm, seclabel) < 0)
goto cleanup;
- if (!(vm->def->seclabel.model = strdup(driver->caps->host.secModel.model)))
+ if (driver->caps->host.secModel.model &&
+ !(vm->def->seclabel.model = strdup(driver->caps->host.secModel.model)))
goto no_memory;
if (!(vm->def->seclabel.label = strdup(seclabel->label)))
goto no_memory;
--
1.7.7
13 years, 4 months
[libvirt] [PATCH 1/2] Fix typo in virDomainResume API doc
by Christophe Fergeau
It's referring to virSuspendDomain instead of
virDomainSuspend.
---
src/libvirt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 68074e7..9977915 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2391,7 +2391,7 @@ error:
* @domain: a domain object
*
* Resume a suspended domain, the process is restarted from the state where
- * it was frozen by calling virSuspendDomain().
+ * it was frozen by calling virDomainSuspend().
* This function may require privileged access
*
* Returns 0 in case of success and -1 in case of failure.
--
1.7.7.3
13 years, 4 months
[libvirt] [PATCH] API: Share code between virConnectOpen functions
by Eduardo Lima (Etrunko)
From: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
Signed-off-by: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
---
src/libvirt.c | 30 ++----------------------------
1 files changed, 2 insertions(+), 28 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 68074e7..ca7a9a2 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1341,20 +1341,7 @@ failed:
virConnectPtr
virConnectOpen (const char *name)
{
- virConnectPtr ret = NULL;
- if (!initialized)
- if (virInitialize() < 0)
- goto error;
-
- VIR_DEBUG("name=%s", name);
- ret = do_open (name, NULL, 0);
- if (!ret)
- goto error;
- return ret;
-
-error:
- virDispatchError(NULL);
- return NULL;
+ return virConnectOpenAuth(name, NULL, 0);
}
/**
@@ -1375,20 +1362,7 @@ error:
virConnectPtr
virConnectOpenReadOnly(const char *name)
{
- virConnectPtr ret = NULL;
- if (!initialized)
- if (virInitialize() < 0)
- goto error;
-
- VIR_DEBUG("name=%s", name);
- ret = do_open (name, NULL, VIR_CONNECT_RO);
- if (!ret)
- goto error;
- return ret;
-
-error:
- virDispatchError(NULL);
- return NULL;
+ return virConnectOpenAuth(name, NULL, VIR_CONNECT_RO);
}
/**
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH] qemu: Ignore shutdown event from destroyed domain
by Jiri Denemark
During virDomainDestroy, QEMU may emit SHUTDOWN event as a response to
SIGTERM and since domain object is still locked, the event is processed
after the domain is destroyed. We need to ignore this event in such case
to avoid changing domain state from shutoff to shutdown.
---
src/qemu/qemu_process.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5e8a20a..9309761 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -471,6 +471,10 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
VIR_DEBUG("Ignoring repeated SHUTDOWN event from domain %s",
vm->def->name);
goto unlock;
+ } else if (!virDomainObjIsActive(vm)) {
+ VIR_DEBUG("Ignoring SHUTDOWN event from inactive domain %s",
+ vm->def->name);
+ goto unlock;
}
priv->gotShutdown = true;
--
1.7.8
13 years, 4 months
[libvirt] [libvirt-glib] Add "priority" argument to gvir_stream_add_watch_full
by Christophe Fergeau
This is more consistent with what all the other glib _full APIs
are doing.
---
libvirt-gobject/libvirt-gobject-input-stream.c | 1 +
libvirt-gobject/libvirt-gobject-output-stream.c | 1 +
libvirt-gobject/libvirt-gobject-stream.c | 5 +++++
libvirt-gobject/libvirt-gobject-stream.h | 1 +
4 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-input-stream.c b/libvirt-gobject/libvirt-gobject-input-stream.c
index a890471..6b9f075 100644
--- a/libvirt-gobject/libvirt-gobject-input-stream.c
+++ b/libvirt-gobject/libvirt-gobject-input-stream.c
@@ -161,6 +161,7 @@ static void gvir_input_stream_read_async(GInputStream *stream,
g_return_if_fail(input_stream->priv->result == NULL);
gvir_stream_add_watch_full(input_stream->priv->stream,
+ G_PRIORITY_DEFAULT,
GVIR_STREAM_IO_CONDITION_READABLE,
gvir_input_stream_read_ready,
g_object_ref(stream),
diff --git a/libvirt-gobject/libvirt-gobject-output-stream.c b/libvirt-gobject/libvirt-gobject-output-stream.c
index f70f282..741b2bc 100644
--- a/libvirt-gobject/libvirt-gobject-output-stream.c
+++ b/libvirt-gobject/libvirt-gobject-output-stream.c
@@ -161,6 +161,7 @@ static void gvir_output_stream_write_async(GOutputStream *stream,
g_return_if_fail(output_stream->priv->result == NULL);
gvir_stream_add_watch_full(output_stream->priv->stream,
+ G_PRIORITY_DEFAULT,
GVIR_STREAM_IO_CONDITION_WRITABLE,
gvir_output_stream_write_ready,
g_object_ref(stream),
diff --git a/libvirt-gobject/libvirt-gobject-stream.c b/libvirt-gobject/libvirt-gobject-stream.c
index c1ae765..1e4721f 100644
--- a/libvirt-gobject/libvirt-gobject-stream.c
+++ b/libvirt-gobject/libvirt-gobject-stream.c
@@ -605,6 +605,7 @@ guint gvir_stream_add_watch(GVirStream *stream,
gpointer opaque)
{
return gvir_stream_add_watch_full(stream,
+ G_PRIORITY_DEFAULT,
cond,
func,
opaque,
@@ -612,6 +613,7 @@ guint gvir_stream_add_watch(GVirStream *stream,
}
guint gvir_stream_add_watch_full(GVirStream *stream,
+ gint priority,
GVirStreamIOCondition cond,
GVirStreamIOFunc func,
gpointer opaque,
@@ -625,6 +627,9 @@ guint gvir_stream_add_watch_full(GVirStream *stream,
source->stream = stream;
source->cond = cond;
+ if (priority != G_PRIORITY_DEFAULT)
+ g_source_set_priority((GSource*)source, priority);
+
priv->sources = g_list_append(priv->sources, source);
gvir_stream_update_events(source->stream);
diff --git a/libvirt-gobject/libvirt-gobject-stream.h b/libvirt-gobject/libvirt-gobject-stream.h
index 3caadc3..d3c9347 100644
--- a/libvirt-gobject/libvirt-gobject-stream.h
+++ b/libvirt-gobject/libvirt-gobject-stream.h
@@ -109,6 +109,7 @@ guint gvir_stream_add_watch(GVirStream *stream,
GVirStreamIOFunc func,
gpointer opaque);
guint gvir_stream_add_watch_full(GVirStream *stream,
+ gint priority,
GVirStreamIOCondition cond,
GVirStreamIOFunc func,
gpointer opaque,
--
1.7.7.3
13 years, 4 months