Re: [PATCH v1 02/19] util: Allow a vhost protocol for scsi hostdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
> Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
> ---
>  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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]