[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast |
Date: |
Wed, 2 Dec 2009 20:19:11 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On Wed, Dec 02, 2009 at 07:19:17PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" <address@hidden> wrote:
> > On Wed, Dec 02, 2009 at 01:04:04PM +0100, Juan Quintela wrote:
> >> virtio_common_init() creates a struct with the right size, DO_UPCAST
> >> is the appropiate thing here
> >>
> >> Signed-off-by: Juan Quintela <address@hidden>
> >
> > BTW why not container_of? That one does not require
> > field to be at the beginning of structure.
>
> VirtIO devices (and PCIDevices) are declared in this way:
>
> typedef struct VirtIOBalloon
> {
> VirtIODevice vdev;
> VirtQueue *ivq, *dvq;
> uint32_t num_pages;
> uint32_t actual;
> } VirtIOBalloon;
>
>
> I.e. the virtioDevice is always the 1st element, otherwise things don't
> work. There are code that requires it to be the 1st element.
I know. But I think we should slowly fix these assumptions, and not
introduce more of them. IOW: don't use DO_UPCAST.
>
> Later, Juan.
- [Qemu-devel] [PATCH 01/41] virtio: Teach virtio-balloon about DO_UPCAST, (continued)
- [Qemu-devel] [PATCH 01/41] virtio: Teach virtio-balloon about DO_UPCAST, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 02/41] virtio: Teach virtio-blk about DO_UPCAST, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 03/41] virtio: Teach virtio-console about DO_UPCAST, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 04/41] virtio: Teach virtio-net about DO_UPCAST, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 05/41] virtio-console: Remove useless casts, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 07/41] virtio-pci: Remove duplicate test, Juan Quintela, 2009/12/02
- [Qemu-devel] [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/02
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Michael S. Tsirkin, 2009/12/02
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/02
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast,
Michael S. Tsirkin <=
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/02
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Michael S. Tsirkin, 2009/12/02
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/02
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Michael S. Tsirkin, 2009/12/03
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/03
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Michael S. Tsirkin, 2009/12/03
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/03
- Re: [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Avi Kivity, 2009/12/03
[Qemu-devel] [PATCH 08/41] msix: Store sizes that we send/receive, Juan Quintela, 2009/12/02