[Qemu-devel] [PATCH 15/27] vhost-user-scsi: remove vdev_scsi_add_iscsi_lun()

Marc-André Lureau posted 27 patches 8 years, 5 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 15/27] vhost-user-scsi: remove vdev_scsi_add_iscsi_lun()
Posted by Marc-André Lureau 8 years, 5 months ago
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 contrib/vhost-user-scsi/vhost-user-scsi.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
index 988417393f..f6f9e7b192 100644
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
@@ -658,20 +658,6 @@ static vhost_scsi_dev_t *vdev_scsi_new(int server_sock)
     return vdev_scsi;
 }
 
-static int vdev_scsi_add_iscsi_lun(vhost_scsi_dev_t *vdev_scsi,
-                                   char *iscsi_uri, uint32_t lun)
-{
-    assert(vdev_scsi);
-    assert(iscsi_uri);
-    assert(lun < VUS_MAX_LUNS);
-
-    if (iscsi_add_lun(&vdev_scsi->luns[lun], iscsi_uri) != 0) {
-        return -1;
-    }
-
-    return 0;
-}
-
 static int vdev_scsi_run(vhost_scsi_dev_t *vdev_scsi)
 {
     GIOChannel *chan;
@@ -736,7 +722,7 @@ int main(int argc, char **argv)
     }
     vdev_scsi = vdev_scsi_new(sock);
 
-    if (vdev_scsi_add_iscsi_lun(vdev_scsi, iscsi_uri, 0) != 0) {
+    if (iscsi_add_lun(&vdev_scsi->luns[0], iscsi_uri) != 0) {
         goto err;
     }
 
-- 
2.14.1.146.gd35faa819


Re: [Qemu-devel] [PATCH 15/27] vhost-user-scsi: remove vdev_scsi_add_iscsi_lun()
Posted by Philippe Mathieu-Daudé 8 years, 5 months ago
On 08/23/2017 01:19 PM, Marc-André Lureau wrote:
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>   contrib/vhost-user-scsi/vhost-user-scsi.c | 16 +---------------
>   1 file changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
> index 988417393f..f6f9e7b192 100644
> --- a/contrib/vhost-user-scsi/vhost-user-scsi.c
> +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
> @@ -658,20 +658,6 @@ static vhost_scsi_dev_t *vdev_scsi_new(int server_sock)
>       return vdev_scsi;
>   }
>   
> -static int vdev_scsi_add_iscsi_lun(vhost_scsi_dev_t *vdev_scsi,
> -                                   char *iscsi_uri, uint32_t lun)
> -{
> -    assert(vdev_scsi);
> -    assert(iscsi_uri);
> -    assert(lun < VUS_MAX_LUNS);
> -
> -    if (iscsi_add_lun(&vdev_scsi->luns[lun], iscsi_uri) != 0) {
> -        return -1;
> -    }
> -
> -    return 0;
> -}
> -
>   static int vdev_scsi_run(vhost_scsi_dev_t *vdev_scsi)
>   {
>       GIOChannel *chan;
> @@ -736,7 +722,7 @@ int main(int argc, char **argv)
>       }
>       vdev_scsi = vdev_scsi_new(sock);
>   
> -    if (vdev_scsi_add_iscsi_lun(vdev_scsi, iscsi_uri, 0) != 0) {
> +    if (iscsi_add_lun(&vdev_scsi->luns[0], iscsi_uri) != 0) {
>           goto err;
>       }
>   
>