mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
conf: introduce initiator IQN support for domain disks
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
be16f170e7
commit
9ea3fdc6e9
@ -2733,6 +2733,17 @@
|
||||
</source>
|
||||
<target dev='sdb' bus='scsi'/>
|
||||
</disk>
|
||||
</disk>
|
||||
<disk type='network' device='lun'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<source protocol='iscsi' name='iqn.2013-07.com.example:iscsi-nopool/0'>
|
||||
<host name='example.com' port='3260'/>
|
||||
<initiator>
|
||||
<iqn name='iqn.2013-07.com.example:client'/>
|
||||
</initiator>
|
||||
</source>
|
||||
<target dev='sdb' bus='scsi'/>
|
||||
</disk>
|
||||
<disk type='volume' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/>
|
||||
@ -3090,6 +3101,15 @@
|
||||
It's recommended to allow libvirt manage the persistent
|
||||
reservations.
|
||||
</dd>
|
||||
<dt><code>initiator</code></dt>
|
||||
<dd><span class="since">Since libvirt 4.7.0</span>, the
|
||||
<code>initiator</code> element is supported for a disk
|
||||
<code>type</code> "network" that is using a <code>source</code>
|
||||
element with the <code>protocol</code> attribute "iscsi".
|
||||
If present, the <code>initiator</code> element provides the
|
||||
initiator IQN needed to access the source via mandatory
|
||||
attribute <code>name</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p>
|
||||
|
@ -1699,6 +1699,9 @@
|
||||
<optional>
|
||||
<ref name="encryption"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="initiatorinfo"/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
|
@ -8853,6 +8853,8 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node,
|
||||
|
||||
virStorageSourceNetworkAssignDefaultPorts(src);
|
||||
|
||||
virStorageSourceInitiatorParseXML(ctxt, &src->initiator);
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
@ -23568,6 +23570,8 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrBuf,
|
||||
virBufferEscapeString(childBuf, "<snapshot name='%s'/>\n", src->snapshot);
|
||||
virBufferEscapeString(childBuf, "<config file='%s'/>\n", src->configFile);
|
||||
|
||||
virStorageSourceInitiatorFormatXML(&src->initiator, childBuf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -30194,6 +30198,12 @@ virDomainDiskTranslateISCSIDirect(virDomainDiskDefPtr def,
|
||||
if (virDomainDiskAddISCSIPoolSourceHost(def, pooldef) < 0)
|
||||
return -1;
|
||||
|
||||
if (!def->src->initiator.iqn && pooldef->source.initiator.iqn &&
|
||||
virStorageSourceInitiatorCopy(&def->src->initiator,
|
||||
&pooldef->source.initiator) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2272,6 +2272,9 @@ virStorageSourceCopy(const virStorageSource *src,
|
||||
!(ret->pr = virStoragePRDefCopy(src->pr)))
|
||||
goto error;
|
||||
|
||||
if (virStorageSourceInitiatorCopy(&ret->initiator, &src->initiator))
|
||||
goto error;
|
||||
|
||||
if (backingChain && src->backingStore) {
|
||||
if (!(ret->backingStore = virStorageSourceCopy(src->backingStore,
|
||||
true)))
|
||||
@ -2503,6 +2506,8 @@ virStorageSourceClear(virStorageSourcePtr def)
|
||||
VIR_FREE(def->tlsAlias);
|
||||
VIR_FREE(def->tlsCertdir);
|
||||
|
||||
virStorageSourceInitiatorClear(&def->initiator);
|
||||
|
||||
memset(def, 0, sizeof(*def));
|
||||
}
|
||||
|
||||
|
@ -261,6 +261,8 @@ struct _virStorageSource {
|
||||
bool encryptionInherited;
|
||||
virStoragePRDefPtr pr;
|
||||
|
||||
virStorageSourceInitiatorDef initiator;
|
||||
|
||||
virObjectPtr privateData;
|
||||
|
||||
int format; /* virStorageFileFormat in domain backing chains, but
|
||||
|
Loading…
Reference in New Issue
Block a user