[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 3/9] virtio: Teach virtio-blk about DO_UPCAST
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] Re: [PATCH 3/9] virtio: Teach virtio-blk about DO_UPCAST |
Date: |
Thu, 18 Mar 2010 09:29:42 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On Tue, Mar 16, 2010 at 07:51:19PM +0100, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <address@hidden>
Sent a replacement patch for this.
> ---
> hw/virtio-blk.c | 11 +++--------
> 1 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
> index 8939bb2..ce8b604 100644
> --- a/hw/virtio-blk.c
> +++ b/hw/virtio-blk.c
> @@ -29,11 +29,6 @@ typedef struct VirtIOBlock
> BlockConf *conf;
> } VirtIOBlock;
>
> -static VirtIOBlock *to_virtio_blk(VirtIODevice *vdev)
> -{
> - return (VirtIOBlock *)vdev;
> -}
> -
> typedef struct VirtIOBlockReq
> {
> VirtIOBlock *dev;
> @@ -320,7 +315,7 @@ static void virtio_blk_handle_request(VirtIOBlockReq *req,
>
> static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq)
> {
> - VirtIOBlock *s = to_virtio_blk(vdev);
> + VirtIOBlock *s = DO_UPCAST(VirtIOBlock, vdev, vdev);
> VirtIOBlockReq *req;
> MultiReqBuffer mrb = {
> .num_writes = 0,
> @@ -392,7 +387,7 @@ static void virtio_blk_reset(VirtIODevice *vdev)
> */
> static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
> {
> - VirtIOBlock *s = to_virtio_blk(vdev);
> + VirtIOBlock *s = DO_UPCAST(VirtIOBlock, vdev, vdev);
> struct virtio_blk_config blkcfg;
> uint64_t capacity;
> int cylinders, heads, secs;
> @@ -415,7 +410,7 @@ static void virtio_blk_update_config(VirtIODevice *vdev,
> uint8_t *config)
>
> static uint32_t virtio_blk_get_features(VirtIODevice *vdev, uint32_t
> features)
> {
> - VirtIOBlock *s = to_virtio_blk(vdev);
> + VirtIOBlock *s = DO_UPCAST(VirtIOBlock, vdev, vdev);
>
> features |= (1 << VIRTIO_BLK_F_SEG_MAX);
> features |= (1 << VIRTIO_BLK_F_GEOMETRY);
> --
> 1.6.6.1
>
>
- [Qemu-devel] [PATCH 0/9] Virtio cleanups, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 1/9] qemu/pci: document msix_entries_nr field, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 2/9] virtio: Teach virtio-balloon about DO_UPCAST, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 3/9] virtio: Teach virtio-blk about DO_UPCAST, Juan Quintela, 2010/03/16
- [Qemu-devel] Re: [PATCH 3/9] virtio: Teach virtio-blk about DO_UPCAST,
Michael S. Tsirkin <=
- [Qemu-devel] [PATCH 5/9] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 7/9] QLIST: Introduce QLIST_COPY_HEAD, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/16
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/18