Re: [libvirt] [PATCH] configure: Check for MSG_NOSIGNAL availability

2016-07-20 Thread Justin Clift
On 19 Jul 2016, at 15:48, Andrea Bolognani  wrote:
> On Tue, 2016-07-19 at 16:23 +0200, Ján Tomko wrote:
>> On Tue, Jul 19, 2016 at 04:00:25PM +0200, Andrea Bolognani wrote:
>>>  
>>> The symbol being missing has been reported as causing build
>>> failures on OS X. Check for its availability before using it.
>>> ---
>>> See https://www.redhat.com/archives/libvir-list/2016-July/msg00613.html
>>>  
>>> configure.ac  | 4 
>>> src/util/virsystemd.c | 4 ++--
>>> 2 files changed, 6 insertions(+), 2 deletions(-)
>>>  
>>> diff --git a/configure.ac b/configure.ac
>>> index 2c81c95..af5d2f8 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -402,6 +402,10 @@ AC_CHECK_TYPE([struct sockpeercred],
>>>[], [[#include 
>>>]])
>>>  
>>> +AC_CHECK_DECLS([MSG_NOSIGNAL],
>>> +  [], [], [[#include 
>>> +  ]])
>>> +
>>> AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, 
>>> ETH_FLAG_LRO,
>>>  ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, 
>>> ETHTOOL_GFEATURES],
>>>[], [], [[#include 
>>> diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
>>> index 969cd68..d2f4bfb 100644
>>> --- a/src/util/virsystemd.c
>>> +++ b/src/util/virsystemd.c
>>> @@ -482,7 +482,7 @@ int virSystemdTerminateMachine(const char *name)
>>> void
>>> virSystemdNotifyStartup(void)
>>> {
>>> -#ifdef HAVE_SYS_UN_H
>>> +#if defined(HAVE_SYS_UN_H) && defined(HAVE_MSG_NOSIGNAL)
>>  
>> What are the benefits of checking this at configure-time?
>>  
>> Seems to me we could just as well use defined(MSG_NOSIGNAL) without
>> slowing configure down even more if we aren't going to base other
>> configure-time decisions on it.
> 
> You're of course right. I'm not quite sure what I was thinking
> when I added the configure check.

Heh Heh Heh

Guessing this means there'll be a new version of the patch I need
to test? ;)

+ Justin

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] configure: Check for MSG_NOSIGNAL availability

2016-07-19 Thread Andrea Bolognani
On Tue, 2016-07-19 at 16:23 +0200, Ján Tomko wrote:
> On Tue, Jul 19, 2016 at 04:00:25PM +0200, Andrea Bolognani wrote:
> > 
> > The symbol being missing has been reported as causing build
> > failures on OS X. Check for its availability before using it.
> > ---
> > See https://www.redhat.com/archives/libvir-list/2016-July/msg00613.html
> > 
> > configure.ac  | 4 
> > src/util/virsystemd.c | 4 ++--
> > 2 files changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 2c81c95..af5d2f8 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -402,6 +402,10 @@ AC_CHECK_TYPE([struct sockpeercred],
> >   [], [[#include 
> >   ]])
> > 
> > +AC_CHECK_DECLS([MSG_NOSIGNAL],
> > +  [], [], [[#include 
> > +  ]])
> > +
> > AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, 
> > ETH_FLAG_LRO,
> > ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, 
> >ETHTOOL_GFEATURES],
> >   [], [], [[#include 
> > diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
> > index 969cd68..d2f4bfb 100644
> > --- a/src/util/virsystemd.c
> > +++ b/src/util/virsystemd.c
> > @@ -482,7 +482,7 @@ int virSystemdTerminateMachine(const char *name)
> > void
> > virSystemdNotifyStartup(void)
> > {
> > -#ifdef HAVE_SYS_UN_H
> > +#if defined(HAVE_SYS_UN_H) && defined(HAVE_MSG_NOSIGNAL)
> 
> What are the benefits of checking this at configure-time?
> 
> Seems to me we could just as well use defined(MSG_NOSIGNAL) without
> slowing configure down even more if we aren't going to base other
> configure-time decisions on it.

You're of course right. I'm not quite sure what I was thinking
when I added the configure check.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] configure: Check for MSG_NOSIGNAL availability

2016-07-19 Thread Ján Tomko

On Tue, Jul 19, 2016 at 04:00:25PM +0200, Andrea Bolognani wrote:

The symbol being missing has been reported as causing build
failures on OS X. Check for its availability before using it.
---
See https://www.redhat.com/archives/libvir-list/2016-July/msg00613.html

configure.ac  | 4 
src/util/virsystemd.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2c81c95..af5d2f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -402,6 +402,10 @@ AC_CHECK_TYPE([struct sockpeercred],
  [], [[#include 
  ]])

+AC_CHECK_DECLS([MSG_NOSIGNAL],
+  [], [], [[#include 
+  ]])
+
AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, ETH_FLAG_LRO,
ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATURES],
  [], [], [[#include 
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 969cd68..d2f4bfb 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -482,7 +482,7 @@ int virSystemdTerminateMachine(const char *name)
void
virSystemdNotifyStartup(void)
{
-#ifdef HAVE_SYS_UN_H
+#if defined(HAVE_SYS_UN_H) && defined(HAVE_MSG_NOSIGNAL)


What are the benefits of checking this at configure-time?

Seems to me we could just as well use defined(MSG_NOSIGNAL) without
slowing configure down even more if we aren't going to base other
configure-time decisions on it.

Jan

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] configure: Check for MSG_NOSIGNAL availability

2016-07-19 Thread Andrea Bolognani
The symbol being missing has been reported as causing build
failures on OS X. Check for its availability before using it.
---
See https://www.redhat.com/archives/libvir-list/2016-July/msg00613.html

 configure.ac  | 4 
 src/util/virsystemd.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2c81c95..af5d2f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -402,6 +402,10 @@ AC_CHECK_TYPE([struct sockpeercred],
   [], [[#include 
   ]])
 
+AC_CHECK_DECLS([MSG_NOSIGNAL],
+  [], [], [[#include 
+  ]])
+
 AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, 
ETH_FLAG_LRO,
 ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATURES],
   [], [], [[#include 
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 969cd68..d2f4bfb 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -482,7 +482,7 @@ int virSystemdTerminateMachine(const char *name)
 void
 virSystemdNotifyStartup(void)
 {
-#ifdef HAVE_SYS_UN_H
+#if defined(HAVE_SYS_UN_H) && defined(HAVE_MSG_NOSIGNAL)
 const char *path;
 const char *msg = "READY=1";
 int fd;
@@ -526,7 +526,7 @@ virSystemdNotifyStartup(void)
 VIR_WARN("Failed to notify systemd");
 
 VIR_FORCE_CLOSE(fd);
-#endif /* HAVE_SYS_UN_H */
+#endif /* defined(HAVE_SYS_UN_H) && defined(HAVE_MSG_NOSIGNAL) */
 }
 
 static int
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list