On 25.07.2016 22:48, Eric Farman wrote:
Make sure that the new vhost protocol does not drive the existing
virtio SCSI code.
Also, do a little minor formatting in virHostdevReAttachSCSIDevices,
to match the similar functions elsewhere.
Signed-off-by: Eric Farman <farman(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
src/util/virhostdev.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 9b5ca6f..7e3bf34 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -1106,6 +1106,8 @@ virHostdevUpdateActiveSCSIDevices(virHostdevManagerPtr mgr,
if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) {
continue; /* Not supported for iSCSI */
+ } else if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_VHOST)
{
+ continue; /* Not supported for vhost */
} else {
if (virHostdevUpdateActiveSCSIHostDevices(mgr, hostdev, scsisrc,
drv_name, dom_name) < 0)
I wonder if we should turn those if - else if - else into:
switch((virDomainHostdevSCSIProtocolType) scsisrc->protocol) { ... }
Not a show stopper, could be done in a follow up patch.
@@ -1405,6 +1407,8 @@
virHostdevPrepareSCSIDevices(virHostdevManagerPtr mgr,
if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) {
continue; /* Not supported for iSCSI */
+ } else if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_VHOST)
{
+ continue; /* Not supported for vhost */
} else {
if (virHostdevPrepareSCSIHostDevices(hostdev, scsisrc, list) < 0)
goto cleanup;
@@ -1595,11 +1599,14 @@ virHostdevReAttachSCSIDevices(virHostdevManagerPtr mgr,
hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)
continue;
- if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
- continue; /* Not supported for iSCSI */
- else
+ if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) {
+ continue; /* Not supported for iSCSI */
+ } else if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_VHOST)
{
+ continue; /* Not supported for vhost */
+ } else {
virHostdevReAttachSCSIHostDevices(mgr, hostdev, scsisrc,
drv_name, dom_name);
+ }
}
virObjectUnlock(mgr->activeSCSIHostdevs);
}
Michal