提交 785a8940 编写于 作者: J John Ferlan

scsi: Need to translate disk source pool in config attach path

https://bugzilla.redhat.com/show_bug.cgi?id=1228007

When attaching a scsi volume lun via the attach-device --config or
--persistent options, there was no translation of the source pool
like there was for the live path, thus the attempt to modify the config
would fail since not enough was known about the disk.
上级 c1dff918
...@@ -1944,8 +1944,10 @@ ...@@ -1944,8 +1944,10 @@
defaulting to "disk". defaulting to "disk".
<p> <p>
Using "lun" (<span class="since">since 0.9.10</span>) is only Using "lun" (<span class="since">since 0.9.10</span>) is only
valid when type is "block" or "network" using the iSCSI protocol, valid when the <code>type</code> is "block" or "network" for
and behaves identically to "disk", <code>protocol='iscsi'</code> or when the <code>type</code>
is "volume" when using an iSCSI source <code>pool</code>.
Configured in this manner, the LUN behaves identically to "disk",
except that generic SCSI commands from the guest are accepted except that generic SCSI commands from the guest are accepted
and passed through to the physical device. Also note that and passed through to the physical device. Also note that
device='lun' will only be recognized for actual raw devices, device='lun' will only be recognized for actual raw devices,
...@@ -2062,6 +2064,13 @@ ...@@ -2062,6 +2064,13 @@
Using "host" as the <code>mode</code> value indicates to use the Using "host" as the <code>mode</code> value indicates to use the
LUN's path as it shows up on host (e.g. LUN's path as it shows up on host (e.g.
'file=/dev/disk/by-path/ip-example.com:3260-iscsi-iqn.2013-07.com.example:iscsi-pool-lun-1'). 'file=/dev/disk/by-path/ip-example.com:3260-iscsi-iqn.2013-07.com.example:iscsi-pool-lun-1').
Using a LUN from an iSCSI source pool provides the same
features as a <code>disk</code> configured using
<code>type</code> 'block' or 'network and <code>device</code>
of 'lun' with respect to how the LUN is presented to and
may used by the guest.
</p> </p>
</dd> </dd>
</dl> </dl>
......
...@@ -1218,6 +1218,7 @@ ...@@ -1218,6 +1218,7 @@
<choice> <choice>
<ref name="diskSourceNetwork"/> <ref name="diskSourceNetwork"/>
<ref name="diskSourceBlock"/> <ref name="diskSourceBlock"/>
<ref name="diskSourceVolume"/>
</choice> </choice>
<ref name="diskSpecsExtra"/> <ref name="diskSpecsExtra"/>
</interleave> </interleave>
......
...@@ -8016,7 +8016,8 @@ qemuDomainUpdateDeviceLive(virConnectPtr conn, ...@@ -8016,7 +8016,8 @@ qemuDomainUpdateDeviceLive(virConnectPtr conn,
static int static int
qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
virDomainDefPtr vmdef, virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev) virDomainDeviceDefPtr dev,
virConnectPtr conn)
{ {
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
virDomainNetDefPtr net; virDomainNetDefPtr net;
...@@ -8033,6 +8034,8 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, ...@@ -8033,6 +8034,8 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
_("target %s already exists"), disk->dst); _("target %s already exists"), disk->dst);
return -1; return -1;
} }
if (virStorageTranslateDiskSourcePool(conn, disk) < 0)
return -1;
if (qemuCheckDiskConfig(disk) < 0) if (qemuCheckDiskConfig(disk) < 0)
return -1; return -1;
if (virDomainDiskInsert(vmdef, disk)) if (virDomainDiskInsert(vmdef, disk))
...@@ -8501,7 +8504,8 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml, ...@@ -8501,7 +8504,8 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
VIR_DOMAIN_DEVICE_ACTION_ATTACH) < 0) VIR_DOMAIN_DEVICE_ACTION_ATTACH) < 0)
goto endjob; goto endjob;
if ((ret = qemuDomainAttachDeviceConfig(qemuCaps, vmdef, dev)) < 0) if ((ret = qemuDomainAttachDeviceConfig(qemuCaps, vmdef, dev,
dom->conn)) < 0)
goto endjob; goto endjob;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册