libvirt/tests/storagepoolxml2xmlin
Osier Yang a4bd62adc1 storage: Introduce parentaddr into virStoragePoolSourceAdapter
Between reboots and kernel reloads, the SCSI host number used for SCSI
storage pools may change requiring modification to the storage pool XML
in order to use a specific SCSI host adapter.

This patch introduces the "parentaddr" element and "unique_id" attribute
for the SCSI host adapter in order to uniquely identify the adapter
between reboots and kernel reloads. For now the goal is to only parse
and format the XML. Both will be required to be provided in order to
uniquely identify the desired SCSI host.

The new XML is expected to be as follows:

  <adapter type='scsi_host'>
    <parentaddr unique_id='3'>
      <address domain='0x0000' bus='0x00' slot='0x1f' func='0x2'/>
    </parentaddr>
  </adapter>

where "parentaddr" is the parent device of the SCSI host using the PCI
address on which the device resides and the value from the unique_id file
for the device. Both the PCI address and unique_id values will be used
to traverse the /sys/class/scsi_host/ directories looking at each link
to match the PCI address reformatted to the directory link format where
"domain🚌slot:function" is found.  Then for each matching directory
the unique_id file for the scsi_host will be used to match the unique_id
value in the xml.

For a PCI address listed above, this will be formatted to "0000:00:1f.2"
and the links in /sys/class/scsi_host will be used to find the host#
to be used for the 'scsi_host' device. Each entry is a link to the
/sys/bus/pci/devices directories, e.g.:

%  ls -al /sys/class/scsi_host/host2
lrwxrwxrwx. 1 root root 0 Jun  1 00:22 /sys/class/scsi_host/host2 -> ../../devices/pci0000:00/0000:00:1f.2/ata3/host2/scsi_host/host2

% cat /sys/class/scsi_host/host2/unique_id
3

The "parentaddr" and "name" attributes are mutually exclusive to identify
the SCSI host number. Use of the "parentaddr" element will be the preferred
mechanism.

This patch only supports to parse and format the XMLs. Later patches will
add code to find out the scsi host number.
2014-07-21 12:55:10 -04:00
..
pool-dir-naming.xml storage: use valid XML for awkward volume names 2013-11-21 17:29:47 -07:00
pool-dir.xml Update xml schemas according to libvirt source 2012-08-02 14:36:23 -06:00
pool-disk.xml tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
pool-fs.xml tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
pool-gluster-sub.xml storage: document gluster pool 2013-11-25 11:03:19 -07:00
pool-gluster.xml storage: document gluster pool 2013-11-25 11:03:19 -07:00
pool-iscsi-auth.xml storage: allow interleave in pool XML 2013-10-16 10:15:44 -06:00
pool-iscsi-multiiqn.xml Add multiIQN tests 2010-06-08 13:14:26 -04:00
pool-iscsi-vendor-product.xml storage_pool: Rework chap XML to mimic ceph 2013-07-15 12:41:12 -04:00
pool-iscsi.xml tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
pool-logical-create.xml Make logical pools independent on target path 2013-07-16 12:16:37 +02:00
pool-logical-nopath.xml Make logical pools independent on target path 2013-07-16 12:16:37 +02:00
pool-logical.xml tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
pool-mpath.xml tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
pool-netfs-gluster-without-slash.xml schema: pool: netfs: Don't enforce slash in glusterfs pool source 2014-07-21 18:28:17 +02:00
pool-netfs-gluster.xml storage: fix RNG validation of gluster via netfs 2013-11-13 12:10:00 -07:00
pool-netfs.xml tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
pool-rbd.xml Storage: Fix the indention of rbd test file 2013-06-03 11:20:01 +08:00
pool-scsi-type-fc-host.xml New XML attributes for storage pool source adapter 2013-04-08 18:41:06 +08:00
pool-scsi-type-scsi-host-stable.xml storage: Introduce parentaddr into virStoragePoolSourceAdapter 2014-07-21 12:55:10 -04:00
pool-scsi-type-scsi-host.xml New XML attributes for storage pool source adapter 2013-04-08 18:41:06 +08:00
pool-scsi.xml tests: Add XML 2 XML tests for storage pools. 2009-10-16 10:21:47 -04:00
pool-sheepdog.xml storage: allow interleave in pool XML 2013-10-16 10:15:44 -06:00