conf: Introduce new attribute for device address format

* src/conf/domain_conf.h: Add new member "target" to struct
  _virDomainDeviceDriveAddress.

* src/conf/domain_conf.c: Parse and format "target"

* Lots of tests (.xml) in tests/domainsnapshotxml2xmlout,
  tests/qemuxml2argvdata, tests/qemuxml2xmloutdata, and
  tests/vmx2xmldata/ are modified for newly introduced
  attribute "target" for address of "drive" type.
This commit is contained in:
Osier Yang
2012-02-28 14:27:11 +08:00
parent 7eadfddad5
commit 4288b22fb2
194 changed files with 292 additions and 264 deletions
+10 -2
View File
@@ -1094,6 +1094,12 @@
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<disk type='block' device='lun'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sda'/<
<target dev='sda' bus='scsi'/<
<address type='drive' controller='0' bus='0' target='3' unit='0'/<
</disk>
</devices>
...</pre>
@@ -1401,8 +1407,9 @@
Multifunction defaults to 'off'; any other value requires
QEMU 0.1.3 and <span class="since">libvirt 0.9.7</span>. For a
"drive" controller, additional attributes
<code>controller</code>, <code>bus</code>,
and <code>unit</code> are available, each defaulting to 0.
<code>controller</code>, <code>bus</code>, <code>target</code>
(<span class="since">libvirt 0.9.11</span>), and <code>unit</code>
are available, each defaulting to 0.
</dd>
<dt><code>auth</code></dt>
<dd>If present, the <code>auth</code> element provides the
@@ -1592,6 +1599,7 @@
<dd>Drive addresses have the following additional
attributes: <code>controller</code> (a 2-digit controller
number), <code>bus</code> (a 2-digit bus number),
<code>target</code> (a 2-digit bus number),
and <code>unit</code> (a 2-digit unit number on the bus).
</dd>
<dt><code>type='virtio-serial'</code></dt>
+10
View File
@@ -2459,6 +2459,11 @@
<ref name="driveBus"/>
</attribute>
</optional>
<optional>
<attribute name="target">
<ref name="driveTarget"/>
</attribute>
</optional>
<optional>
<attribute name="unit">
<ref name="driveUnit"/>
@@ -3147,6 +3152,11 @@
<param name="pattern">[0-9]{1,2}</param>
</data>
</define>
<define name="driveTarget">
<data type="string">
<param name="pattern">[0-9]{1,2}</param>
</data>
</define>
<define name="driveUnit">
<data type="string">
<param name="pattern">[0-9]{1,2}</param>