mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-03 20:01:16 +00:00
a4bd62adc1
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.
|
||
---|---|---|
.. | ||
pool-dir-naming.xml | ||
pool-dir.xml | ||
pool-disk.xml | ||
pool-fs.xml | ||
pool-gluster-sub.xml | ||
pool-gluster.xml | ||
pool-iscsi-auth.xml | ||
pool-iscsi-multiiqn.xml | ||
pool-iscsi-vendor-product.xml | ||
pool-iscsi.xml | ||
pool-logical-create.xml | ||
pool-logical-nopath.xml | ||
pool-logical.xml | ||
pool-mpath.xml | ||
pool-netfs-gluster.xml | ||
pool-netfs.xml | ||
pool-rbd.xml | ||
pool-scsi-type-fc-host.xml | ||
pool-scsi-type-scsi-host-stable.xml | ||
pool-scsi-type-scsi-host.xml | ||
pool-scsi.xml | ||
pool-sheepdog.xml |