[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/8] virtio: put struct VirtIOFeature in a heade
From: |
Anthony Liguori |
Subject: |
Re: [Qemu-devel] [PATCH 2/8] virtio: put struct VirtIOFeature in a header |
Date: |
Tue, 19 Feb 2013 14:36:40 -0600 |
User-agent: |
Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) |
Jesse Larrew <address@hidden> writes:
> Move the definition of struct VirtIOFeature from virtio-net.c to virtio.h
> so other virtio devices can benefit.
>
> Signed-off-by: Jesse Larrew <address@hidden>
Reviewed-by: Anthony Liguori <address@hidden>
Regards,
Anthony Liguori
> ---
> hw/virtio-net.c | 12 ------------
> hw/virtio.h | 12 ++++++++++++
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index bdbfc18..78dc97d 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -75,18 +75,6 @@ typedef struct VirtIONet
> uint16_t curr_queues;
> } VirtIONet;
>
> -/*
> - * Calculate the number of bytes up to and including the given 'field' of
> - * 'container'.
> - */
> -#define endof(container, field) \
> - (offsetof(container, field) + sizeof(((container *)0)->field))
> -
> -typedef struct VirtIOFeature {
> - uint32_t flags;
> - size_t end;
> -} VirtIOFeature;
> -
> static VirtIOFeature feature_sizes[] = {
> {.flags = 1 << VIRTIO_NET_F_MAC,
> .end = endof(struct virtio_net_config, mac)},
> diff --git a/hw/virtio.h b/hw/virtio.h
> index 1e206b8..7755fec 100644
> --- a/hw/virtio.h
> +++ b/hw/virtio.h
> @@ -67,6 +67,18 @@
> /* This means don't interrupt guest when buffer consumed. */
> #define VRING_AVAIL_F_NO_INTERRUPT 1
>
> +/*
> + * Calculate the number of bytes up to and including the given 'field' of
> + * 'container'.
> + */
> +#define endof(container, field) \
> + (offsetof(container, field) + sizeof(((container *)0)->field))
> +
> +typedef struct VirtIOFeature {
> + uint32_t flags;
> + size_t end;
> +} VirtIOFeature;
> +
> struct VirtQueue;
>
> static inline hwaddr vring_align(hwaddr addr,
> --
> 1.7.11.7
- [Qemu-devel] [PATCH 0/8] virtio: set config size using host features, Jesse Larrew, 2013/02/18
- [Qemu-devel] [PATCH 1/8] virtio-net: replace redundant config_size field with config_len, Jesse Larrew, 2013/02/18
- [Qemu-devel] [PATCH 8/8] virtio-blk: fill in the feature table, Jesse Larrew, 2013/02/18
- [Qemu-devel] [PATCH 6/8] virtio-serial: fill in the feature table, Jesse Larrew, 2013/02/18
- [Qemu-devel] [PATCH 7/8] virtio-scsi: fill in table of feature sizes, Jesse Larrew, 2013/02/18
- [Qemu-devel] [PATCH 2/8] virtio: put struct VirtIOFeature in a header, Jesse Larrew, 2013/02/18
- Re: [Qemu-devel] [PATCH 2/8] virtio: put struct VirtIOFeature in a header,
Anthony Liguori <=
- [Qemu-devel] [PATCH 4/8] virtio: set config size using host features, Jesse Larrew, 2013/02/18
- [Qemu-devel] [PATCH 5/8] virtio-balloon: fill in the table of feature_sizes, Jesse Larrew, 2013/02/18
- [Qemu-devel] [PATCH 3/8] virtio: pass host features to driver init functions, Jesse Larrew, 2013/02/18
- Re: [Qemu-devel] [PATCH 0/8] virtio: set config size using host features, Anthony Liguori, 2013/02/19