[Qemu-devel] [PATCH 17/27] vhost-user-scsi: remove unimplemented functions

Marc-André Lureau posted 27 patches 8 years, 5 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 17/27] vhost-user-scsi: remove unimplemented functions
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 | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
index 429e3065ea..882d887a32 100644
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
@@ -469,16 +469,6 @@ static void vus_del_watch_cb(VuDev *vu_dev, int fd)
     }
 }
 
-static void vus_proc_ctl(VuDev *vu_dev, int idx)
-{
-    /* Control VQ not implemented */
-}
-
-static void vus_proc_evt(VuDev *vu_dev, int idx)
-{
-    /* Event VQ not implemented */
-}
-
 static void vus_proc_req(VuDev *vu_dev, int idx)
 {
     vhost_scsi_dev_t *vdev_scsi;
@@ -559,14 +549,9 @@ static void vus_queue_set_started(VuDev *vu_dev, int idx, bool started)
 
     vq = vu_get_queue(vu_dev, idx);
 
-    switch (idx) {
-    case 0:
-        vu_set_queue_handler(vu_dev, vq, started ? vus_proc_ctl : NULL);
-        break;
-    case 1:
-        vu_set_queue_handler(vu_dev, vq, started ? vus_proc_evt : NULL);
-        break;
-    default:
+    if (idx == 0 || idx == 1) {
+        PDBG("queue %d unimplemented", idx);
+    } else {
         vu_set_queue_handler(vu_dev, vq, started ? vus_proc_req : NULL);
     }
 }
-- 
2.14.1.146.gd35faa819


Re: [Qemu-devel] [PATCH 17/27] vhost-user-scsi: remove unimplemented functions
Posted by Paolo Bonzini 8 years, 4 months ago
On 23/08/2017 18:19, Marc-André Lureau wrote:
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  contrib/vhost-user-scsi/vhost-user-scsi.c | 21 +++------------------
>  1 file changed, 3 insertions(+), 18 deletions(-)
> 
> diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
> index 429e3065ea..882d887a32 100644
> --- a/contrib/vhost-user-scsi/vhost-user-scsi.c
> +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
> @@ -469,16 +469,6 @@ static void vus_del_watch_cb(VuDev *vu_dev, int fd)
>      }
>  }
>  
> -static void vus_proc_ctl(VuDev *vu_dev, int idx)
> -{
> -    /* Control VQ not implemented */
> -}
> -
> -static void vus_proc_evt(VuDev *vu_dev, int idx)
> -{
> -    /* Event VQ not implemented */
> -}
> -
>  static void vus_proc_req(VuDev *vu_dev, int idx)
>  {
>      vhost_scsi_dev_t *vdev_scsi;
> @@ -559,14 +549,9 @@ static void vus_queue_set_started(VuDev *vu_dev, int idx, bool started)
>  
>      vq = vu_get_queue(vu_dev, idx);
>  
> -    switch (idx) {
> -    case 0:
> -        vu_set_queue_handler(vu_dev, vq, started ? vus_proc_ctl : NULL);
> -        break;
> -    case 1:
> -        vu_set_queue_handler(vu_dev, vq, started ? vus_proc_evt : NULL);
> -        break;
> -    default:
> +    if (idx == 0 || idx == 1) {
> +        PDBG("queue %d unimplemented", idx);
> +    } else {
>          vu_set_queue_handler(vu_dev, vq, started ? vus_proc_req : NULL);
>      }
>  }
> 


Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>