[PATCH 4/5] virtio-blk: declare VirtIOBlock::rq with a type

Stefan Hajnoczi posted 5 patches 9 months, 3 weeks ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>
There is a newer version of this series
[PATCH 4/5] virtio-blk: declare VirtIOBlock::rq with a type
Posted by Stefan Hajnoczi 9 months, 3 weeks ago
The VirtIOBlock::rq field has had the type void * since its introduction
in commit 869a5c6df19a ("Stop VM on error in virtio-blk. (Gleb
Natapov)").

Perhaps this was done to avoid the forward declaration of
VirtIOBlockReq.

Hanna Czenczek <hreitz@redhat.com> pointed out the missing type. Specify
the actual type because there is no need to use void * here.

Suggested-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/hw/virtio/virtio-blk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index 833a9a344f..5c14110c4b 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -55,7 +55,7 @@ struct VirtIOBlock {
     VirtIODevice parent_obj;
     BlockBackend *blk;
     QemuMutex rq_lock;
-    void *rq; /* protected by rq_lock */
+    struct VirtIOBlockReq *rq; /* protected by rq_lock */
     VirtIOBlkConf conf;
     unsigned short sector_mask;
     bool original_wce;
-- 
2.43.0
Re: [PATCH 4/5] virtio-blk: declare VirtIOBlock::rq with a type
Posted by Hanna Czenczek 9 months, 3 weeks ago
On 05.02.24 18:26, Stefan Hajnoczi wrote:
> The VirtIOBlock::rq field has had the type void * since its introduction
> in commit 869a5c6df19a ("Stop VM on error in virtio-blk. (Gleb
> Natapov)").
>
> Perhaps this was done to avoid the forward declaration of
> VirtIOBlockReq.
>
> Hanna Czenczek <hreitz@redhat.com> pointed out the missing type. Specify
> the actual type because there is no need to use void * here.
>
> Suggested-by: Hanna Czenczek <hreitz@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>   include/hw/virtio/virtio-blk.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Re: [PATCH 4/5] virtio-blk: declare VirtIOBlock::rq with a type
Posted by Manos Pitsidianakis 9 months, 3 weeks ago
On Mon, 05 Feb 2024 19:26, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>The VirtIOBlock::rq field has had the type void * since its introduction
>in commit 869a5c6df19a ("Stop VM on error in virtio-blk. (Gleb
>Natapov)").
>
>Perhaps this was done to avoid the forward declaration of
>VirtIOBlockReq.
>
>Hanna Czenczek <hreitz@redhat.com> pointed out the missing type. Specify
>the actual type because there is no need to use void * here.
>
>Suggested-by: Hanna Czenczek <hreitz@redhat.com>
>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>---
> include/hw/virtio/virtio-blk.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
>index 833a9a344f..5c14110c4b 100644
>--- a/include/hw/virtio/virtio-blk.h
>+++ b/include/hw/virtio/virtio-blk.h
>@@ -55,7 +55,7 @@ struct VirtIOBlock {
>     VirtIODevice parent_obj;
>     BlockBackend *blk;
>     QemuMutex rq_lock;
>-    void *rq; /* protected by rq_lock */
>+    struct VirtIOBlockReq *rq; /* protected by rq_lock */
>     VirtIOBlkConf conf;
>     unsigned short sector_mask;
>     bool original_wce;
>-- 
>2.43.0
>

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>