Next in thread → Next in month →

Re: [virtio] [OASIS Issue Tracker] Created: (VIRTIO-36) balloon: align val in virtio_balloon_stat

From
Rusty Russell <>
Date
2013-09-24T12:03:57+00:00
ID
Thread
Re: [virtio] [OASIS Issue Tracker] Created: (VIRTIO-36) balloon: align val in virtio_balloon_stat
OASIS Issues Tracker <> writes:

> balloon: align val in virtio_balloon_stat
> -----------------------------------------
>
>                  Key: VIRTIO-36
>                  URL: http://tools.oasis-open.org/issues/browse/VIRTIO-36
>              Project: OASIS Virtual I/O Device (VIRTIO) TC
>           Issue Type: Improvement
>             Reporter: Michael Tsirkin
>
>
> we have:
>         struct virtio_balloon_stat {
>         #define VIRTIO_BALLOON_S_SWAP_IN  0
>         #define VIRTIO_BALLOON_S_SWAP_OUT 1
>         #define VIRTIO_BALLOON_S_MAJFLT   2
>         #define VIRTIO_BALLOON_S_MINFLT   3
>         #define VIRTIO_BALLOON_S_MEMFREE  4
>         #define VIRTIO_BALLOON_S_MEMTOT   5
>                 u16 tag;
>                 u64 val;
>         } __attribute__((packed));
>
> val is 8 bytes but aligned at a 2 byte boundary.
> this is ugly and unusual, and requires implementations
> to use packed structures for access, which is error-prone.

Yeah, I think we fix this by creating a new, clean virtio-balloon
device.  See VIRTIO-28:	Implement new balloon device (ID 13)

Cheers,
Rusty.
Next in thread → Next in month →