[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/5] virtio-blk: remove layout assumption
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH 5/5] virtio-blk: remove layout assumption |
Date: |
Thu, 18 Mar 2010 09:21:51 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
Use container_of to remove assumption that vdev
is 1st member of device state.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio-blk.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index b89f1f4..4ab6671 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -32,7 +32,7 @@ typedef struct VirtIOBlock
static VirtIOBlock *to_virtio_blk(VirtIODevice *vdev)
{
- return (VirtIOBlock *)vdev;
+ return container_of(vdev, VirtIOBlock, vdev);
}
typedef struct VirtIOBlockReq
--
1.7.0.2.280.gc6f05
- [Qemu-devel] [PATCH 0/5] virtio: cleanup layout assumptions, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] [PATCH 1/5] virtio: add type safe API, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] [PATCH 2/5] virtio-net: remove layout assumptions, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] [PATCH 3/5] virtio-serial: remove struct layout assumptions, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] [PATCH 4/5] virtio-balloon: remove layout assumptions, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] [PATCH 5/5] virtio-blk: remove layout assumption,
Michael S. Tsirkin <=
- [Qemu-devel] Re: [PATCH 0/5] virtio: cleanup layout assumptions, Juan Quintela, 2010/03/18