[libvirt] [PATCH] virInitctlRequest: Don't hardcode 384 bytes size

When MAXHOSTNAMELEN is set we have to take it's value into account. Otherwise the build fails on kFreeBSD (FreeBSD kernel and GNU userland) --- src/util/virinitctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c index 1618ffa..9a3e8a3 100644 --- a/src/util/virinitctl.c +++ b/src/util/virinitctl.c @@ -103,7 +103,11 @@ struct virInitctlRequest { } i; }; -verify(sizeof(struct virInitctlRequest) == 384); +# ifdef MAXHOSTNAMELEN + verify(sizeof(struct virInitctlRequest) == 320 + MAXHOSTNAMELEN); +# else + verify(sizeof(struct virInitctlRequest) == 384); +#endif /* * Send a message to init to change the runlevel -- 1.7.10.4

On 05/01/2013 02:39 PM, Guido Günther wrote:
When MAXHOSTNAMELEN is set we have to take it's value into account. Otherwise the build fails on kFreeBSD (FreeBSD kernel and GNU userland) --- src/util/virinitctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
ACK. Qualifies as a build-breaker.
diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c index 1618ffa..9a3e8a3 100644 --- a/src/util/virinitctl.c +++ b/src/util/virinitctl.c @@ -103,7 +103,11 @@ struct virInitctlRequest { } i; };
-verify(sizeof(struct virInitctlRequest) == 384); +# ifdef MAXHOSTNAMELEN + verify(sizeof(struct virInitctlRequest) == 320 + MAXHOSTNAMELEN); +# else + verify(sizeof(struct virInitctlRequest) == 384); +#endif
/* * Send a message to init to change the runlevel
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, May 01, 2013 at 02:48:35PM -0600, Eric Blake wrote:
On 05/01/2013 02:39 PM, Guido Günther wrote:
When MAXHOSTNAMELEN is set we have to take it's value into account. Otherwise the build fails on kFreeBSD (FreeBSD kernel and GNU userland) --- src/util/virinitctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
ACK. Qualifies as a build-breaker.
Pushed. Thanks, -- Guido
diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c index 1618ffa..9a3e8a3 100644 --- a/src/util/virinitctl.c +++ b/src/util/virinitctl.c @@ -103,7 +103,11 @@ struct virInitctlRequest { } i; };
-verify(sizeof(struct virInitctlRequest) == 384); +# ifdef MAXHOSTNAMELEN + verify(sizeof(struct virInitctlRequest) == 320 + MAXHOSTNAMELEN); +# else + verify(sizeof(struct virInitctlRequest) == 384); +#endif
/* * Send a message to init to change the runlevel
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, May 02, 2013 at 08:19:11AM +0200, Guido Günther wrote:
On Wed, May 01, 2013 at 02:48:35PM -0600, Eric Blake wrote:
On 05/01/2013 02:39 PM, Guido Günther wrote:
When MAXHOSTNAMELEN is set we have to take it's value into account. Otherwise the build fails on kFreeBSD (FreeBSD kernel and GNU userland) --- src/util/virinitctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
ACK. Qualifies as a build-breaker.
Pushed. Thanks,
...and I pushed another one that unbreaks make syntax-check. Sorry about that unfortunately this overlapped with the 1.0.5 release. Cheers, -- Guido
-- Guido
diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c index 1618ffa..9a3e8a3 100644 --- a/src/util/virinitctl.c +++ b/src/util/virinitctl.c @@ -103,7 +103,11 @@ struct virInitctlRequest { } i; };
-verify(sizeof(struct virInitctlRequest) == 384); +# ifdef MAXHOSTNAMELEN + verify(sizeof(struct virInitctlRequest) == 320 + MAXHOSTNAMELEN); +# else + verify(sizeof(struct virInitctlRequest) == 384); +#endif
/* * Send a message to init to change the runlevel
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Guido Günther