[libvirt] [PATCH] fix libvirt alignment on arm platforms

Michal Privoznik mprivozn at redhat.com
Thu Dec 12 18:55:36 UTC 2013


On 01.01.1970 01:03, Michele Paolino wrote:
> With the changes added by the latest commits (e.g.
> 8a29ffcf9aee45b61a0a12ee45c656cfd52333e8) related to "new events feature
> v2",
> we are unable to compile libvirt on ARM target (OMAP5).
> The error is due to alignment:
> conf/domain_event.c: In function 'virDomainEventDispatchDefaultFunc':
> conf/domain_event.c:1198:30: error: cast increases required alignment of
> target type [-Werror=cast-align]
> conf/domain_event.c:1314:34: error: cast increases required alignment of
> target type [-Werror=cast-align]
> cc1: all warnings being treated as errors
> 
> Using ATTRIBUTE_PACKED we force a structure to not follow architecture and
> compiler best alignments.
> ---
>  src/conf/domain_event.c         |   20 ++++++++++----------
>  src/conf/network_event.c        |    2 +-
>  src/conf/object_event_private.h |    2 +-
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
> index 64035f7..7d58367 100644
> --- a/src/conf/domain_event.c
> +++ b/src/conf/domain_event.c
> @@ -76,7 +76,7 @@ struct _virDomainEventLifecycle {
>  
>      int type;
>      int detail;
> -};
> +} ATTRIBUTE_PACKED;

(What an ancient e-mail :-) )

I've raised the problem here:

https://www.redhat.com/archives/libvir-list/2013-December/msg00635.html

And Eric replied suggesting a fix:

https://www.redhat.com/archives/libvir-list/2013-December/msg00662.html

But I must say I like your approach more. Eric?

Michal




More information about the libvir-list mailing list