summarylogtreecommitdiffstats
path: root/lxc-version-check.patch
blob: b190b04bf719d499f643ae3ae0af5b0c3a682867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/lxc-binding.c b/lxc-binding.c
index 4592b68..d26b9ef 100644
--- a/lxc-binding.c
+++ b/lxc-binding.c
@@ -15,11 +15,6 @@
 
 #include "lxc-binding.h"
 
-#define VERSION_AT_LEAST(major, minor, micro)							\
-	(!(major > LXC_VERSION_MAJOR ||								\
-	major == LXC_VERSION_MAJOR && minor > LXC_VERSION_MINOR ||				\
-	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);
 }
diff --git a/lxc-binding.h b/lxc-binding.h
index f7ccd84..ed1829a 100644
--- a/lxc-binding.h
+++ b/lxc-binding.h
@@ -2,6 +2,11 @@
 // Use of this source code is governed by a LGPLv2.1
 // license that can be found in the LICENSE file.
 
+#define VERSION_AT_LEAST(major, minor, micro)							\
+	((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)))
+
 extern bool go_lxc_add_device_node(struct lxc_container *c, const char *src_path, const char *dest_path);
 extern void go_lxc_clear_config(struct lxc_container *c);
 extern bool go_lxc_clear_config_item(struct lxc_container *c, const char *key);
@@ -72,7 +77,7 @@ extern bool go_lxc_restore(struct lxc_container *c, char *directory, bool verbos
  * we don't want to have to pass all the arguments in to let conditional
  * compilation handle things, but the call will still fail
  */
-#if LXC_VERSION_MAJOR != 2
+#if !VERSION_AT_LEAST(2, 0, 0)
 struct migrate_opts {
 	char *directory;
 	bool verbose;