Message ID | 20170823162004.27337-17-marcandre.lureau@redhat.com |
---|---|
State | New |
Headers | show |
On 08/23/2017 01:19 PM, Marc-André Lureau wrote: > There is no code to support more than 1 yet, no need for that today. > > 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 | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c > index f6f9e7b192..429e3065ea 100644 > --- a/contrib/vhost-user-scsi/vhost-user-scsi.c > +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c > @@ -53,8 +53,6 @@ > > /** vhost-user-scsi specific definitions **/ > > - /* Only 1 LUN and device supported today */ > -#define VUS_MAX_LUNS 1 > #define VUS_ISCSI_INITIATOR "iqn.2016-11.com.nutanix:vhost-user-scsi" > > typedef struct iscsi_lun { > @@ -67,7 +65,7 @@ typedef struct vhost_scsi_dev { > int server_sock; > GMainLoop *loop; > GTree *fdmap; /* fd -> gsource context id */ > - iscsi_lun_t luns[VUS_MAX_LUNS]; > + iscsi_lun_t lun; > } vhost_scsi_dev_t; > > /** glib event loop integration for libvhost-user and misc callbacks **/ > @@ -533,7 +531,7 @@ static void vus_proc_req(VuDev *vu_dev, int idx) > } > rsp = (VirtIOSCSICmdResp *)elem->in_sg[0].iov_base; > > - if (handle_cmd_sync(vdev_scsi->luns[0].iscsi_ctx, > + if (handle_cmd_sync(vdev_scsi->lun.iscsi_ctx, > req, &elem->out_sg[1], elem->out_num - 1, > rsp, &elem->in_sg[1], elem->in_num - 1) != 0) { > vus_panic_cb(vu_dev, NULL); > @@ -722,7 +720,7 @@ int main(int argc, char **argv) > } > vdev_scsi = vdev_scsi_new(sock); > > - if (iscsi_add_lun(&vdev_scsi->luns[0], iscsi_uri) != 0) { > + if (iscsi_add_lun(&vdev_scsi->lun, iscsi_uri) != 0) { > goto err; > } > >
diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c index f6f9e7b192..429e3065ea 100644 --- a/contrib/vhost-user-scsi/vhost-user-scsi.c +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c @@ -53,8 +53,6 @@ /** vhost-user-scsi specific definitions **/ - /* Only 1 LUN and device supported today */ -#define VUS_MAX_LUNS 1 #define VUS_ISCSI_INITIATOR "iqn.2016-11.com.nutanix:vhost-user-scsi" typedef struct iscsi_lun { @@ -67,7 +65,7 @@ typedef struct vhost_scsi_dev { int server_sock; GMainLoop *loop; GTree *fdmap; /* fd -> gsource context id */ - iscsi_lun_t luns[VUS_MAX_LUNS]; + iscsi_lun_t lun; } vhost_scsi_dev_t; /** glib event loop integration for libvhost-user and misc callbacks **/ @@ -533,7 +531,7 @@ static void vus_proc_req(VuDev *vu_dev, int idx) } rsp = (VirtIOSCSICmdResp *)elem->in_sg[0].iov_base; - if (handle_cmd_sync(vdev_scsi->luns[0].iscsi_ctx, + if (handle_cmd_sync(vdev_scsi->lun.iscsi_ctx, req, &elem->out_sg[1], elem->out_num - 1, rsp, &elem->in_sg[1], elem->in_num - 1) != 0) { vus_panic_cb(vu_dev, NULL); @@ -722,7 +720,7 @@ int main(int argc, char **argv) } vdev_scsi = vdev_scsi_new(sock); - if (iscsi_add_lun(&vdev_scsi->luns[0], iscsi_uri) != 0) { + if (iscsi_add_lun(&vdev_scsi->lun, iscsi_uri) != 0) { goto err; }
There is no code to support more than 1 yet, no need for that today. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> --- contrib/vhost-user-scsi/vhost-user-scsi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)