[lxc-devel] [go-lxc/v2] Check for LXC_DEVEL

brauner on Github lxc-bot at linuxcontainers.org
Wed Oct 5 08:47:28 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 466 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161005/2bd84e8e/attachment.bin>
-------------- next part --------------
From d027b2ffc8c3d64c33981f2d41cbb2da1bbf7466 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at canonical.com>
Date: Wed, 5 Oct 2016 10:39:33 +0200
Subject: [PATCH 1/2] bindings C: check for LXC_DEVEL in version.h file

Signed-off-by: Christian Brauner <christian.brauner at canonical.com>
---
 lxc-binding.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lxc-binding.c b/lxc-binding.c
index 4592b68..110f952 100644
--- a/lxc-binding.c
+++ b/lxc-binding.c
@@ -15,10 +15,14 @@
 
 #include "lxc-binding.h"
 
+#ifndef LXC_DEVEL
+#define LXC_DEVEL 0
+#endif
+
 #define VERSION_AT_LEAST(major, minor, micro)							\
-	(!(major > LXC_VERSION_MAJOR ||								\
+	((LXC_DEVEL == 1) || (!(major > LXC_VERSION_MAJOR ||					\
 	major == LXC_VERSION_MAJOR && minor > LXC_VERSION_MINOR ||				\
-	major == LXC_VERSION_MAJOR && minor == LXC_VERSION_MINOR && micro > LXC_VERSION_MICRO))
+	major == LXC_VERSION_MAJOR && minor == LXC_VERSION_MINOR && micro > LXC_VERSION_MICRO)))
 
 bool go_lxc_defined(struct lxc_container *c) {
 	return c->is_defined(c);

From 802f80e44f468ddde4166516451050e6b5ec75e8 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at canonical.com>
Date: Wed, 5 Oct 2016 10:40:30 +0200
Subject: [PATCH 2/2] bindings go: check for LXC_DEVEL in version.h

Signed-off-by: Christian Brauner <christian.brauner at canonical.com>
---
 lxc-binding.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lxc-binding.go b/lxc-binding.go
index 2fc3056..b1af36e 100644
--- a/lxc-binding.go
+++ b/lxc-binding.go
@@ -8,6 +8,9 @@ package lxc
 
 // #cgo pkg-config: lxc
 // #cgo LDFLAGS: -llxc -lutil
+// #ifndef LXC_DEVEL
+// #define LXC_DEVEL 0
+// #endif
 // #include <lxc/lxccontainer.h>
 // #include <lxc/version.h>
 // #include "lxc-binding.h"
@@ -198,6 +201,10 @@ func VersionNumber() (major int, minor int) {
 }
 
 func VersionAtLeast(major int, minor int, micro int) bool {
+	if C.LXC_DEVEL == 1 {
+		return true
+	}
+
 	if major > C.LXC_VERSION_MAJOR {
 		return false
 	}


More information about the lxc-devel mailing list