mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
conf: Add support for initiator IQN setting for iSCSI hostdevs
We already allow controlling the initiator IQN for iSCSI based disks. Add the same for host devices. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
fdc0d13b2c
commit
90df0f8288
@ -3771,6 +3771,9 @@ or:
|
|||||||
<auth username='myuser'>
|
<auth username='myuser'>
|
||||||
<secret type='iscsi' usage='libvirtiscsi'/>
|
<secret type='iscsi' usage='libvirtiscsi'/>
|
||||||
</auth>
|
</auth>
|
||||||
|
<initiator>
|
||||||
|
<iqn name='iqn.2020-07.com.example:test'/>
|
||||||
|
</initiator>
|
||||||
</source>
|
</source>
|
||||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
@ -3910,6 +3913,10 @@ or:
|
|||||||
same ``name`` attribute and optionally using the ``auth`` element to
|
same ``name`` attribute and optionally using the ``auth`` element to
|
||||||
provide the authentication credentials to the iSCSI server.
|
provide the authentication credentials to the iSCSI server.
|
||||||
|
|
||||||
|
:since:`Since 6.7.0`, the optional ``initiator`` sub-element controls the
|
||||||
|
IQN of the initiator ran by the hypervisor via it's ``<iqn name='iqn...'``
|
||||||
|
subelement.
|
||||||
|
|
||||||
``scsi_host``
|
``scsi_host``
|
||||||
:since:`Since 2.5.0` , multiple LUNs behind a single SCSI HBA are
|
:since:`Since 2.5.0` , multiple LUNs behind a single SCSI HBA are
|
||||||
described by a ``protocol`` attribute set to "vhost" and a ``wwpn``
|
described by a ``protocol`` attribute set to "vhost" and a ``wwpn``
|
||||||
|
@ -5058,6 +5058,9 @@
|
|||||||
<optional>
|
<optional>
|
||||||
<ref name='diskAuth'/>
|
<ref name='diskAuth'/>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<ref name="initiatorinfo"/>
|
||||||
|
</optional>
|
||||||
</interleave>
|
</interleave>
|
||||||
</group>
|
</group>
|
||||||
</choice>
|
</choice>
|
||||||
|
@ -8354,6 +8354,8 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode,
|
|||||||
iscsisrc->src->auth = g_steal_pointer(&authdef);
|
iscsisrc->src->auth = g_steal_pointer(&authdef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virStorageSourceInitiatorParseXML(ctxt, &iscsisrc->src->initiator);
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_DEF_PARSE_STATUS &&
|
if (flags & VIR_DOMAIN_DEF_PARSE_STATUS &&
|
||||||
xmlopt && xmlopt->privateData.storageParse) {
|
xmlopt && xmlopt->privateData.storageParse) {
|
||||||
if ((ctxt->node = virXPathNode("./privateData", ctxt)) &&
|
if ((ctxt->node = virXPathNode("./privateData", ctxt)) &&
|
||||||
@ -26164,6 +26166,9 @@ virDomainHostdevDefFormatSubsysSCSI(virBufferPtr buf,
|
|||||||
|
|
||||||
if (iscsisrc->src->auth)
|
if (iscsisrc->src->auth)
|
||||||
virStorageAuthDefFormat(&sourceChildBuf, iscsisrc->src->auth);
|
virStorageAuthDefFormat(&sourceChildBuf, iscsisrc->src->auth);
|
||||||
|
|
||||||
|
virStorageSourceInitiatorFormatXML(&iscsisrc->src->initiator,
|
||||||
|
&sourceChildBuf);
|
||||||
} else {
|
} else {
|
||||||
virBufferAsprintf(&sourceChildBuf, "<adapter name='%s'/>\n",
|
virBufferAsprintf(&sourceChildBuf, "<adapter name='%s'/>\n",
|
||||||
scsihostsrc->adapter);
|
scsihostsrc->adapter);
|
||||||
|
@ -60,7 +60,8 @@ data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
|
|||||||
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
|
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
|
||||||
-drive file.driver=iscsi,file.portal=example.org:3260,\
|
-drive file.driver=iscsi,file.portal=example.org:3260,\
|
||||||
file.target=iqn.1992-01.com.example:storage,file.lun=2,file.transport=tcp,\
|
file.target=iqn.1992-01.com.example:storage,file.lun=2,file.transport=tcp,\
|
||||||
file.user=myname,file.password-secret=hostdev5-secret0,if=none,format=raw,\
|
file.user=myname,file.password-secret=hostdev5-secret0,\
|
||||||
|
file.initiator-name=iqn.2020-07.com.example:test,if=none,format=raw,\
|
||||||
id=drive-hostdev5 \
|
id=drive-hostdev5 \
|
||||||
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=5,\
|
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=5,\
|
||||||
drive=drive-hostdev5,id=hostdev5 \
|
drive=drive-hostdev5,id=hostdev5 \
|
||||||
|
@ -67,6 +67,7 @@ keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
|
|||||||
-blockdev '{"driver":"iscsi","portal":"example.org:3260",\
|
-blockdev '{"driver":"iscsi","portal":"example.org:3260",\
|
||||||
"target":"iqn.1992-01.com.example:storage","lun":2,"transport":"tcp",\
|
"target":"iqn.1992-01.com.example:storage","lun":2,"transport":"tcp",\
|
||||||
"user":"myname","password-secret":"hostdev5-secret0",\
|
"user":"myname","password-secret":"hostdev5-secret0",\
|
||||||
|
"initiator-name":"iqn.2020-07.com.example:test",\
|
||||||
"node-name":"libvirt-hostdev5-backend","read-only":false}' \
|
"node-name":"libvirt-hostdev5-backend","read-only":false}' \
|
||||||
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=5,\
|
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=5,\
|
||||||
drive=libvirt-hostdev5-backend,id=hostdev5 \
|
drive=libvirt-hostdev5-backend,id=hostdev5 \
|
||||||
|
@ -67,6 +67,9 @@
|
|||||||
<auth username='myname'>
|
<auth username='myname'>
|
||||||
<secret type='iscsi' usage='mycluster_myname'/>
|
<secret type='iscsi' usage='mycluster_myname'/>
|
||||||
</auth>
|
</auth>
|
||||||
|
<initiator>
|
||||||
|
<iqn name='iqn.2020-07.com.example:test'/>
|
||||||
|
</initiator>
|
||||||
</source>
|
</source>
|
||||||
<address type='drive' controller='0' bus='0' target='3' unit='5'/>
|
<address type='drive' controller='0' bus='0' target='3' unit='5'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
|
@ -74,6 +74,9 @@
|
|||||||
<auth username='myname'>
|
<auth username='myname'>
|
||||||
<secret type='iscsi' usage='mycluster_myname'/>
|
<secret type='iscsi' usage='mycluster_myname'/>
|
||||||
</auth>
|
</auth>
|
||||||
|
<initiator>
|
||||||
|
<iqn name='iqn.2020-07.com.example:test'/>
|
||||||
|
</initiator>
|
||||||
</source>
|
</source>
|
||||||
<address type='drive' controller='0' bus='0' target='3' unit='5'/>
|
<address type='drive' controller='0' bus='0' target='3' unit='5'/>
|
||||||
</hostdev>
|
</hostdev>
|
||||||
|
Loading…
Reference in New Issue
Block a user