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>
<auth username='myuser'>
<secret type='iscsi' usage='libvirtiscsi'/>
</auth>
+ <initiator>
+ <iqn name='iqn.2020-07.com.example:test'/>
+ </initiator>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</hostdev>
same ``name`` attribute and optionally using the ``auth`` element to
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``
:since:`Since 2.5.0` , multiple LUNs behind a single SCSI HBA are
described by a ``protocol`` attribute set to "vhost" and a ``wwpn``
<optional>
<ref name='diskAuth'/>
</optional>
+ <optional>
+ <ref name="initiatorinfo"/>
+ </optional>
</interleave>
</group>
</choice>
iscsisrc->src->auth = g_steal_pointer(&authdef);
}
+ virStorageSourceInitiatorParseXML(ctxt, &iscsisrc->src->initiator);
+
if (flags & VIR_DOMAIN_DEF_PARSE_STATUS &&
xmlopt && xmlopt->privateData.storageParse) {
if ((ctxt->node = virXPathNode("./privateData", ctxt)) &&
if (iscsisrc->src->auth)
virStorageAuthDefFormat(&sourceChildBuf, iscsisrc->src->auth);
+
+ virStorageSourceInitiatorFormatXML(&iscsisrc->src->initiator,
+ &sourceChildBuf);
} else {
virBufferAsprintf(&sourceChildBuf, "<adapter name='%s'/>\n",
scsihostsrc->adapter);
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
-drive file.driver=iscsi,file.portal=example.org:3260,\
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 \
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=5,\
drive=drive-hostdev5,id=hostdev5 \
-blockdev '{"driver":"iscsi","portal":"example.org:3260",\
"target":"iqn.1992-01.com.example:storage","lun":2,"transport":"tcp",\
"user":"myname","password-secret":"hostdev5-secret0",\
+"initiator-name":"iqn.2020-07.com.example:test",\
"node-name":"libvirt-hostdev5-backend","read-only":false}' \
-device scsi-generic,bus=scsi0.0,channel=0,scsi-id=3,lun=5,\
drive=libvirt-hostdev5-backend,id=hostdev5 \
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
</auth>
+ <initiator>
+ <iqn name='iqn.2020-07.com.example:test'/>
+ </initiator>
</source>
<address type='drive' controller='0' bus='0' target='3' unit='5'/>
</hostdev>
<auth username='myname'>
<secret type='iscsi' usage='mycluster_myname'/>
</auth>
+ <initiator>
+ <iqn name='iqn.2020-07.com.example:test'/>
+ </initiator>
</source>
<address type='drive' controller='0' bus='0' target='3' unit='5'/>
</hostdev>