[libvirt] [PATCH] util: implement virProcessGetStartTime on GNU/kFreeBSD

Use the virProcessGetStartTime implementation also when only the kernel is FreeBSD, such as on GNU/kFreeBSD. --- src/util/virprocess.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index e6b78ef..43118f8 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -36,11 +36,11 @@ # include <sched.h> #endif -#if defined(__FreeBSD__) || HAVE_BSD_CPU_AFFINITY +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || HAVE_BSD_CPU_AFFINITY # include <sys/param.h> #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include <sys/sysctl.h> # include <sys/user.h> #endif @@ -937,7 +937,7 @@ int virProcessGetStartTime(pid_t pid, VIR_FREE(buf); return ret; } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int virProcessGetStartTime(pid_t pid, unsigned long long *timestamp) { -- 2.1.0

On Thu, Oct 15, 2015 at 01:50:42PM +0200, Pino Toscano wrote:
Use the virProcessGetStartTime implementation also when only the kernel is FreeBSD, such as on GNU/kFreeBSD. --- src/util/virprocess.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/virprocess.c b/src/util/virprocess.c index e6b78ef..43118f8 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -36,11 +36,11 @@ # include <sched.h> #endif
-#if defined(__FreeBSD__) || HAVE_BSD_CPU_AFFINITY +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || HAVE_BSD_CPU_AFFINITY
I'm guessing __FreeBSD_kernel__ is not defined when compiling on pure FreeBSD, so we cannot use just __FreeBSD_kernel__, right? Weak ACK -- I have nowhere to try it and I'm lazy to install such machine just for trying out this patch, but I can clearly see it won't break anything that works right now, so... Also, if this works, then I believe there will be way more functions that could use this reasoning to make libvirt more Whatever/kFreeBSD friendly. Would you care to check some of those, like virSecurityDACGetProcessLabelInternal() etc.? I'm not pushing it if someone else has a chance to try it or review it since I'm not \kFreeBSD experienced.
# include <sys/param.h> #endif
-#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include <sys/sysctl.h> # include <sys/user.h> #endif @@ -937,7 +937,7 @@ int virProcessGetStartTime(pid_t pid, VIR_FREE(buf); return ret; } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int virProcessGetStartTime(pid_t pid, unsigned long long *timestamp) { -- 2.1.0
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Martin Kletzander wrote:
On Thu, Oct 15, 2015 at 01:50:42PM +0200, Pino Toscano wrote:
Use the virProcessGetStartTime implementation also when only the kernel is FreeBSD, such as on GNU/kFreeBSD. --- src/util/virprocess.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/virprocess.c b/src/util/virprocess.c index e6b78ef..43118f8 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -36,11 +36,11 @@ # include <sched.h> #endif
-#if defined(__FreeBSD__) || HAVE_BSD_CPU_AFFINITY +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || HAVE_BSD_CPU_AFFINITY
I'm guessing __FreeBSD_kernel__ is not defined when compiling on pure FreeBSD, so we cannot use just __FreeBSD_kernel__, right?
That's true.
Weak ACK -- I have nowhere to try it and I'm lazy to install such machine just for trying out this patch, but I can clearly see it won't break anything that works right now, so...
FWIW, it also looks fine to me (though I do not have GNU\kFreeBSD boxes as well, only FreeBSD ones). I can build-test on FreeBSD just to be on a safe side, but it doesn't seem like it could break something indeed. Roman Bogorodskiy

On Tue, 2015-10-27 at 14:54 +0300, Roman Bogorodskiy wrote:
Weak ACK -- I have nowhere to try it and I'm lazy to install such machine just for trying out this patch, but I can clearly see it won't break anything that works right now, so...
FWIW, it also looks fine to me (though I do not have GNU\kFreeBSD boxes as well, only FreeBSD ones). I can build-test on FreeBSD just to be on a safe side, but it doesn't seem like it could break something indeed.
I'd like to point out that FreeBSD builds are now performed regularly, so any breakage affecting FreeBDS should be detected pretty quickly. https://ci.centos.org/view/libvirt-project/job/libvirt-freebsd/ Cheers. -- Andrea Bolognani Software Engineer - Virtualization Team

Andrea Bolognani wrote:
On Tue, 2015-10-27 at 14:54 +0300, Roman Bogorodskiy wrote:
Weak ACK -- I have nowhere to try it and I'm lazy to install such machine just for trying out this patch, but I can clearly see it won't break anything that works right now, so...
FWIW, it also looks fine to me (though I do not have GNU\kFreeBSD boxes as well, only FreeBSD ones). I can build-test on FreeBSD just to be on a safe side, but it doesn't seem like it could break something indeed.
I'd like to point out that FreeBSD builds are now performed regularly, so any breakage affecting FreeBDS should be detected pretty quickly.
https://ci.centos.org/view/libvirt-project/job/libvirt-freebsd/
Cheers.
That's great! Actually, I have Jenkins job configured for a while now. It simply pulls sources from the github mirror and does 'make check syntax-check' 2 times per day. https://people.freebsd.org/~novel/misc/libvirt_freebsd_ci.png There are some occasional failures in tests and syntax-check is not working quite well because of the 'file list too long' problem, still in TODO list to fix that... Roman Bogorodskiy

Martin Kletzander wrote:
On Thu, Oct 15, 2015 at 01:50:42PM +0200, Pino Toscano wrote:
Use the virProcessGetStartTime implementation also when only the kernel is FreeBSD, such as on GNU/kFreeBSD. --- Weak ACK -- I have nowhere to try it and I'm lazy to install such machine just for trying out this patch, but I can clearly see it won't break anything that works right now, so...
Works fine on FreeBSD, as expected, so ACKed and pushed. Roman Bogorodskiy
participants (4)
-
Andrea Bolognani
-
Martin Kletzander
-
Pino Toscano
-
Roman Bogorodskiy