xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] COLO: only build when libnl is available
@ 2016-04-06 11:01 Wei Liu
  2016-04-06 11:01 ` [PATCH v2 1/4] libxl: colo: rearrange things in header files Wei Liu
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Wei Liu @ 2016-04-06 11:01 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

COLO depends on netlink which is only available on Linux. This series cleans up
COLO code and make it only build when libnl is available.  This should fix
FreeBSD build.

Tested building on Linux with and without libnl-3-dev and libnl3-route-dev.

git rebase -i HEAD~4 --exec \
  './configure --disable-stubdom && \
   CCACHE_DISABLE=1 make -C tools/libxl clean && \
   CCACHE_DISABLE=1 make -C tools/libxl -j8'

Both build tests on every single commit passed.

Wei.


Wei Liu (4):
  libxl: colo: rearrange things in header files
  libxl: colo: move netlink related stuff to libxl_colo_proxy.c
  build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL
  libxl: colo: make it depend on availability of libnl

 config/Tools.mk.in             |  2 +-
 tools/configure                | 10 +++----
 tools/configure.ac             |  6 ++--
 tools/hotplug/Linux/Makefile   |  2 +-
 tools/libxl/Makefile           | 11 ++++++--
 tools/libxl/libxl_colo.h       | 52 +++++++++++++++++------------------
 tools/libxl/libxl_colo_proxy.c | 13 +++++++++
 tools/libxl/libxl_internal.h   | 36 ++++++++----------------
 tools/libxl/libxl_no_colo.c    | 62 ++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 130 insertions(+), 64 deletions(-)
 create mode 100644 tools/libxl/libxl_no_colo.c

-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/4] libxl: colo: rearrange things in header files
  2016-04-06 11:01 [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
@ 2016-04-06 11:01 ` Wei Liu
  2016-04-06 11:01 ` [PATCH v2 2/4] libxl: colo: move netlink related stuff to libxl_colo_proxy.c Wei Liu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Wei Liu @ 2016-04-06 11:01 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

We need to separate COLO code from common code as clean as possible.
With this patch, all COLO structures are now in libxl_colo.h.

It does the following:
1. Move two typedefs for libxl__domain_create_state{,cb} back to
   libxl_internal.h.
2. Move libxl__colo_save_state to libxl_colo.h.
3. Include libxl_internal.h in libxl_colo.h.
4. Move a bunch of colo typedefs to the top of libxl_internal.h.
5. Move the inclusion of libxl_colo.h to the right place in
   libxl_internal.h.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_colo.h     | 40 +++++++++++++++++++++++++---------------
 tools/libxl/libxl_internal.h | 36 ++++++++++++------------------------
 2 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/tools/libxl/libxl_colo.h b/tools/libxl/libxl_colo.h
index 30fd1dc..4f6a612 100644
--- a/tools/libxl/libxl_colo.h
+++ b/tools/libxl/libxl_colo.h
@@ -16,13 +16,9 @@
 #ifndef LIBXL_COLO_H
 #define LIBXL_COLO_H
 
+#include "libxl_internal.h"
 #include <linux/netlink.h>
 
-struct libxl__ao;
-struct libxl__egc;
-struct libxl__colo_save_state;
-struct libxl__checkpoint_devices_state;
-
 /* Consistent with the new COLO netlink channel in kernel side */
 #define NETLINK_COLO 28
 
@@ -65,16 +61,15 @@ enum colo_netlink_op {
     COLO_PROXY_RESET, /* UNUSED, will be used for continuous FT */
 };
 
-typedef struct libxl__colo_device_nic {
+struct libxl__colo_device_nic {
     int devid;
     const char *vif;
-} libxl__colo_device_nic;
+};
 
-typedef struct libxl__colo_qdisk {
+struct libxl__colo_qdisk {
     bool setuped;
-} libxl__colo_qdisk;
+};
 
-typedef struct libxl__colo_proxy_state libxl__colo_proxy_state;
 struct libxl__colo_proxy_state {
     /* set by caller of colo_proxy_setup */
     struct libxl__ao *ao;
@@ -83,12 +78,27 @@ struct libxl__colo_proxy_state {
     int index;
 };
 
-typedef struct libxl__domain_create_state libxl__domain_create_state;
-typedef void libxl__domain_create_cb(struct libxl__egc *egc,
-                                     libxl__domain_create_state *dcs,
-                                     int rc, uint32_t domid);
+struct libxl__colo_save_state {
+    int send_fd;
+    int recv_fd;
+    char *colo_proxy_script;
+
+    /* private */
+    libxl__stream_read_state srs;
+    void (*callback)(libxl__egc *, libxl__colo_save_state *, int);
+    bool svm_running;
+    bool paused;
+
+    /* private, used by qdisk block replication */
+    bool qdisk_used;
+    bool qdisk_setuped;
+
+    /* private, used by colo-proxy */
+    libxl__colo_proxy_state cps;
+    libxl__ev_child child;
+};
+
 
-typedef struct libxl__colo_restore_state libxl__colo_restore_state;
 typedef void libxl__colo_callback(struct libxl__egc *egc,
                                   libxl__colo_restore_state *crs, int rc);
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 7df2711..0107298 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -87,8 +87,6 @@
 #include "_libxl_types_internal.h"
 #include "_libxl_types_internal_json.h"
 
-#include "libxl_colo.h"
-
 #define LIBXL_INIT_TIMEOUT 10
 #define LIBXL_DESTROY_TIMEOUT 10
 #define LIBXL_HOTPLUG_TIMEOUT 40
@@ -184,6 +182,17 @@ typedef struct libxl__aop_occurred libxl__aop_occurred;
 typedef struct libxl__osevent_hook_nexus libxl__osevent_hook_nexus;
 typedef struct libxl__osevent_hook_nexi libxl__osevent_hook_nexi;
 
+typedef struct libxl__domain_create_state libxl__domain_create_state;
+typedef void libxl__domain_create_cb(struct libxl__egc *egc,
+                                     libxl__domain_create_state *dcs,
+                                     int rc, uint32_t domid);
+
+typedef struct libxl__colo_device_nic libxl__colo_device_nic;
+typedef struct libxl__colo_qdisk libxl__colo_qdisk;
+typedef struct libxl__colo_proxy_state libxl__colo_proxy_state;
+typedef struct libxl__colo_save_state libxl__colo_save_state;
+typedef struct libxl__colo_restore_state libxl__colo_restore_state;
+
 _hidden void libxl__alloc_failed(libxl_ctx *, const char *func,
                          size_t nmemb, size_t size) __attribute__((noreturn));
   /* func, size and nmemb are used only in the log message.
@@ -3134,6 +3143,7 @@ libxl__stream_read_inuse(const libxl__stream_read_state *stream)
     return stream->running;
 }
 
+#include "libxl_colo.h"
 
 /*----- Domain suspend (save) state structure -----*/
 /*
@@ -3210,28 +3220,6 @@ libxl__stream_write_inuse(const libxl__stream_write_state *stream)
     return stream->running;
 }
 
-/*----- colo related state structure -----*/
-typedef struct libxl__colo_save_state libxl__colo_save_state;
-struct libxl__colo_save_state {
-    int send_fd;
-    int recv_fd;
-    char *colo_proxy_script;
-
-    /* private */
-    libxl__stream_read_state srs;
-    void (*callback)(libxl__egc *, libxl__colo_save_state *, int);
-    bool svm_running;
-    bool paused;
-
-    /* private, used by qdisk block replication */
-    bool qdisk_used;
-    bool qdisk_setuped;
-
-    /* private, used by colo-proxy */
-    libxl__colo_proxy_state cps;
-    libxl__ev_child child;
-};
-
 typedef struct libxl__logdirty_switch {
     /* Set by caller of libxl__domain_common_switch_qemu_logdirty */
     libxl__ao *ao;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/4] libxl: colo: move netlink related stuff to libxl_colo_proxy.c
  2016-04-06 11:01 [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
  2016-04-06 11:01 ` [PATCH v2 1/4] libxl: colo: rearrange things in header files Wei Liu
@ 2016-04-06 11:01 ` Wei Liu
  2016-04-06 11:01 ` [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL Wei Liu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Wei Liu @ 2016-04-06 11:01 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

They are only used there, no need to expose them to other parts of
libxl.

This is necessary to make libxl build on FreeBSD again because FreeBSD
doesn't have netlink.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_colo.h       | 12 ------------
 tools/libxl/libxl_colo_proxy.c | 13 +++++++++++++
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/tools/libxl/libxl_colo.h b/tools/libxl/libxl_colo.h
index 4f6a612..f0e438e 100644
--- a/tools/libxl/libxl_colo.h
+++ b/tools/libxl/libxl_colo.h
@@ -17,10 +17,6 @@
 #define LIBXL_COLO_H
 
 #include "libxl_internal.h"
-#include <linux/netlink.h>
-
-/* Consistent with the new COLO netlink channel in kernel side */
-#define NETLINK_COLO 28
 
 /* Maximum time(5s) to wait for colo proxy checkpoit */
 #define COLO_PROXY_CHECKPOINT_TIMEOUT 5000000
@@ -53,14 +49,6 @@ enum {
     LIBXL_COLO_RESUMED,
 };
 
-enum colo_netlink_op {
-    COLO_QUERY_CHECKPOINT = (NLMSG_MIN_TYPE + 1),
-    COLO_CHECKPOINT,
-    COLO_FAILOVER,
-    COLO_PROXY_INIT,
-    COLO_PROXY_RESET, /* UNUSED, will be used for continuous FT */
-};
-
 struct libxl__colo_device_nic {
     int devid;
     const char *vif;
diff --git a/tools/libxl/libxl_colo_proxy.c b/tools/libxl/libxl_colo_proxy.c
index 991bd0d..034e76c 100644
--- a/tools/libxl/libxl_colo_proxy.c
+++ b/tools/libxl/libxl_colo_proxy.c
@@ -17,6 +17,19 @@
 
 #include "libxl_internal.h"
 
+#include <linux/netlink.h>
+
+/* Consistent with the new COLO netlink channel in kernel side */
+#define NETLINK_COLO 28
+
+enum colo_netlink_op {
+    COLO_QUERY_CHECKPOINT = (NLMSG_MIN_TYPE + 1),
+    COLO_CHECKPOINT,
+    COLO_FAILOVER,
+    COLO_PROXY_INIT,
+    COLO_PROXY_RESET, /* UNUSED, will be used for continuous FT */
+};
+
 /* ========= colo-proxy: helper functions ========== */
 
 static int colo_proxy_send(libxl__colo_proxy_state *cps, uint8_t *buff,
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL
  2016-04-06 11:01 [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
  2016-04-06 11:01 ` [PATCH v2 1/4] libxl: colo: rearrange things in header files Wei Liu
  2016-04-06 11:01 ` [PATCH v2 2/4] libxl: colo: move netlink related stuff to libxl_colo_proxy.c Wei Liu
@ 2016-04-06 11:01 ` Wei Liu
  2016-04-06 11:29   ` Andrew Cooper
  2016-04-06 13:44   ` Ian Jackson
  2016-04-06 11:01 ` [PATCH v2 4/4] libxl: colo: make it depend on availability of libnl Wei Liu
  2016-04-06 11:04 ` [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
  4 siblings, 2 replies; 12+ messages in thread
From: Wei Liu @ 2016-04-06 11:01 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

COLO and Remus net buffer support both depend on the availability of
libnl. Use a generic name.

No functional changes.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
I committed configure changes as well. Feel free to rerun autogen.sh.
---
 config/Tools.mk.in           |  2 +-
 tools/configure              | 10 +++++-----
 tools/configure.ac           |  6 +++---
 tools/hotplug/Linux/Makefile |  2 +-
 tools/libxl/Makefile         |  6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index ccfe137..0f79f4e 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -58,7 +58,7 @@ CONFIG_QEMU_TRAD    := @qemu_traditional@
 CONFIG_QEMU_XEN     := @qemu_xen@
 CONFIG_BLKTAP2      := @blktap2@
 CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@
-CONFIG_REMUS_NETBUF := @remus_netbuf@
+CONFIG_LIBNL        := @libnl@
 
 CONFIG_SYSTEMD      := @systemd@
 SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
diff --git a/tools/configure b/tools/configure
index ee6c33f..bd22115 100755
--- a/tools/configure
+++ b/tools/configure
@@ -629,7 +629,7 @@ SYSTEMD_CFLAGS
 SYSTEMD_MODULES_LOAD
 SYSTEMD_DIR
 systemd
-remus_netbuf
+libnl
 LIBNL3_LIBS
 LIBNL3_CFLAGS
 argp_ldflags
@@ -9068,18 +9068,18 @@ fi
 
 if test "x$libnl3_lib" = "xn" ; then :
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling support for Remus network buffering.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling support for Remus network buffering and COLO.
     Please install libnl3 libraries, command line tools and devel
     headers - version 3.2.8 or higher" >&5
-$as_echo "$as_me: WARNING: Disabling support for Remus network buffering.
+$as_echo "$as_me: WARNING: Disabling support for Remus network buffering and COLO.
     Please install libnl3 libraries, command line tools and devel
     headers - version 3.2.8 or higher" >&2;}
-    remus_netbuf=n
+    libnl=n
 
 
 else
 
-    remus_netbuf=y
+    libnl=y
 
 
 fi
diff --git a/tools/configure.ac b/tools/configure.ac
index 5b5dda4..79ff25e 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -410,12 +410,12 @@ PKG_CHECK_MODULES(LIBNL3, [libnl-3.0 >= 3.2.8 libnl-route-3.0 >= 3.2.8],
     [libnl3_lib="y"], [libnl3_lib="n"])
 
 AS_IF([test "x$libnl3_lib" = "xn" ], [
-    AC_MSG_WARN([Disabling support for Remus network buffering.
+    AC_MSG_WARN([Disabling support for Remus network buffering and COLO.
     Please install libnl3 libraries, command line tools and devel
     headers - version 3.2.8 or higher])
-    AC_SUBST(remus_netbuf, [n])
+    AC_SUBST(libnl, [n])
     ],[
-    AC_SUBST(remus_netbuf, [y])
+    AC_SUBST(libnl, [y])
 ])
 
 AC_SUBST(LIBNL3_LIBS)
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index b5fd2db..6d6ccee 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -18,7 +18,7 @@ XEN_SCRIPTS += vif-nat
 XEN_SCRIPTS += vif-openvswitch
 XEN_SCRIPTS += vif2
 XEN_SCRIPTS += vif-setup
-XEN_SCRIPTS-$(CONFIG_REMUS_NETBUF) += remus-netbuf-setup
+XEN_SCRIPTS-$(CONFIG_LIBNL) += remus-netbuf-setup
 XEN_SCRIPTS += block
 XEN_SCRIPTS += block-enbd block-nbd
 XEN_SCRIPTS += xen-hotplug-cleanup
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index a433aaa..ca29512 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -21,7 +21,7 @@ endif
 
 LIBXL_LIBS =
 LIBXL_LIBS = $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
-ifeq ($(CONFIG_REMUS_NETBUF),y)
+ifeq ($(CONFIG_LIBNL),y)
 LIBXL_LIBS += $(LIBNL3_LIBS)
 endif
 
@@ -31,7 +31,7 @@ CFLAGS_LIBXL += $(CFLAGS_libxenctrl)
 CFLAGS_LIBXL += $(CFLAGS_libxenguest)
 CFLAGS_LIBXL += $(CFLAGS_libxenstore)
 CFLAGS_LIBXL += $(CFLAGS_libblktapctl) 
-ifeq ($(CONFIG_REMUS_NETBUF),y)
+ifeq ($(CONFIG_LIBNL),y)
 CFLAGS_LIBXL += $(LIBNL3_CFLAGS)
 endif
 CFLAGS_LIBXL += -Wshadow
@@ -52,7 +52,7 @@ else
 LIBXL_OBJS-y += libxl_noblktap2.o
 endif
 
-ifeq ($(CONFIG_REMUS_NETBUF),y)
+ifeq ($(CONFIG_LIBNL),y)
 LIBXL_OBJS-y += libxl_netbuffer.o
 else
 LIBXL_OBJS-y += libxl_nonetbuffer.o
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 4/4] libxl: colo: make it depend on availability of libnl
  2016-04-06 11:01 [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
                   ` (2 preceding siblings ...)
  2016-04-06 11:01 ` [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL Wei Liu
@ 2016-04-06 11:01 ` Wei Liu
  2016-04-06 13:44   ` Ian Jackson
  2016-04-06 11:04 ` [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
  4 siblings, 1 reply; 12+ messages in thread
From: Wei Liu @ 2016-04-06 11:01 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

Netlink is required when initialising COLO, so make sure only to compile
COLO when netlink is available. Change the inclusion of linux/netlink.h
to netlink/netlink.h.

Provide necessary stub functions in case COLO is disabled. This should
fix build on FreeBSD because there is no netlink there. It would also
make libxl build properly when netlink is not present on a Linux
system.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/Makefile           |  5 ++++
 tools/libxl/libxl_colo_proxy.c |  2 +-
 tools/libxl/libxl_no_colo.c    | 62 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 tools/libxl/libxl_no_colo.c

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index ca29512..4fc264d 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -65,10 +65,15 @@ LIBXL_OBJS-y += libxl_no_convert_callout.o
 endif
 
 LIBXL_OBJS-y += libxl_remus.o libxl_checkpoint_device.o libxl_remus_disk_drbd.o
+
+ifeq ($(CONFIG_LIBNL),y)
 LIBXL_OBJS-y += libxl_colo_restore.o libxl_colo_save.o
 LIBXL_OBJS-y += libxl_colo_qdisk.o
 LIBXL_OBJS-y += libxl_colo_proxy.o
 LIBXL_OBJS-y += libxl_colo_nic.o
+else
+LIBXL_OBJS-y += libxl_no_colo.o
+endif
 
 LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o libxl_psr.o
 LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o libxl_arm.o libxl_libfdt_compat.o
diff --git a/tools/libxl/libxl_colo_proxy.c b/tools/libxl/libxl_colo_proxy.c
index 034e76c..d4b73ee 100644
--- a/tools/libxl/libxl_colo_proxy.c
+++ b/tools/libxl/libxl_colo_proxy.c
@@ -17,7 +17,7 @@
 
 #include "libxl_internal.h"
 
-#include <linux/netlink.h>
+#include <netlink/netlink.h>
 
 /* Consistent with the new COLO netlink channel in kernel side */
 #define NETLINK_COLO 28
diff --git a/tools/libxl/libxl_no_colo.c b/tools/libxl/libxl_no_colo.c
new file mode 100644
index 0000000..152f198
--- /dev/null
+++ b/tools/libxl/libxl_no_colo.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2016
+ * Author Wei Liu <wei.liu2@citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_osdeps.h" /* must come before any other headers */
+
+#include "libxl_internal.h"
+
+void libxl__colo_restore_setup(libxl__egc *egc,
+                               libxl__colo_restore_state *crs)
+{
+    STATE_AO_GC(crs->ao);
+
+    LOG(ERROR, "COLO is not supported");
+
+    crs->callback(egc, crs, ERROR_FAIL);
+}
+
+void libxl__colo_restore_teardown(libxl__egc *egc, void *dcs_void,
+                                  int ret, int retval, int errnoval)
+{
+    /* Shouldn't be here because setup already failed */
+    abort();
+}
+
+void libxl__colo_save_setup(libxl__egc *egc, libxl__colo_save_state *css)
+{
+    libxl__domain_save_state *dss = CONTAINER_OF(css, *dss, css);
+    STATE_AO_GC(dss->ao);
+
+    LOG(ERROR, "COLO is not supported");
+
+    dss->callback(egc, dss, ERROR_FAIL);
+}
+
+void libxl__colo_save_teardown(libxl__egc *egc,
+                               libxl__colo_save_state *css,
+                               int rc)
+{
+    /* Shouldn't be here because setup already failed */
+    abort();
+}
+
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/4] COLO: only build when libnl is available
  2016-04-06 11:01 [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
                   ` (3 preceding siblings ...)
  2016-04-06 11:01 ` [PATCH v2 4/4] libxl: colo: make it depend on availability of libnl Wei Liu
@ 2016-04-06 11:04 ` Wei Liu
  2016-04-06 13:56   ` Wei Liu
  4 siblings, 1 reply; 12+ messages in thread
From: Wei Liu @ 2016-04-06 11:04 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

On Wed, Apr 06, 2016 at 12:01:12PM +0100, Wei Liu wrote:
> COLO depends on netlink which is only available on Linux. This series cleans up
> COLO code and make it only build when libnl is available.  This should fix
> FreeBSD build.
> 
> Tested building on Linux with and without libnl-3-dev and libnl3-route-dev.
> 
> git rebase -i HEAD~4 --exec \
>   './configure --disable-stubdom && \
>    CCACHE_DISABLE=1 make -C tools/libxl clean && \
>    CCACHE_DISABLE=1 make -C tools/libxl -j8'
> 
> Both build tests on every single commit passed.
> 

This series can be found at:

  git://xenbits.xen.org/people/liuw/xen.git wip.colo-freebsd-fix-v2

The head of that branch builds OK on FreeBSD now -- but not every single
commit though because the build is fixed in the final commit.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL
  2016-04-06 11:01 ` [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL Wei Liu
@ 2016-04-06 11:29   ` Andrew Cooper
  2016-04-06 11:32     ` Wei Liu
  2016-04-06 13:44   ` Ian Jackson
  1 sibling, 1 reply; 12+ messages in thread
From: Andrew Cooper @ 2016-04-06 11:29 UTC (permalink / raw)
  To: Wei Liu, Xen-devel
  Cc: Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

On 06/04/16 12:01, Wei Liu wrote:
> diff --git a/tools/configure.ac b/tools/configure.ac
> index 5b5dda4..79ff25e 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -410,12 +410,12 @@ PKG_CHECK_MODULES(LIBNL3, [libnl-3.0 >= 3.2.8 libnl-route-3.0 >= 3.2.8],
>      [libnl3_lib="y"], [libnl3_lib="n"])
>  
>  AS_IF([test "x$libnl3_lib" = "xn" ], [
> -    AC_MSG_WARN([Disabling support for Remus network buffering.
> +    AC_MSG_WARN([Disabling support for Remus network buffering and COLO.
>      Please install libnl3 libraries, command line tools and devel
>      headers - version 3.2.8 or higher])

While playing in this area, could the text be expanded to something like:

"Please install libnl3 libraries (including libnl-route)"

I spent a rather long time trying to work out I couldn't enable netbuf
on a fresh install, as they are separate packages.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL
  2016-04-06 11:29   ` Andrew Cooper
@ 2016-04-06 11:32     ` Wei Liu
  0 siblings, 0 replies; 12+ messages in thread
From: Wei Liu @ 2016-04-06 11:32 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Changlong Xie, Wei Liu, Wen Congyang, Ian Jackson, Xen-devel,
	Roger Pau Monné

On Wed, Apr 06, 2016 at 12:29:34PM +0100, Andrew Cooper wrote:
> On 06/04/16 12:01, Wei Liu wrote:
> > diff --git a/tools/configure.ac b/tools/configure.ac
> > index 5b5dda4..79ff25e 100644
> > --- a/tools/configure.ac
> > +++ b/tools/configure.ac
> > @@ -410,12 +410,12 @@ PKG_CHECK_MODULES(LIBNL3, [libnl-3.0 >= 3.2.8 libnl-route-3.0 >= 3.2.8],
> >      [libnl3_lib="y"], [libnl3_lib="n"])
> >  
> >  AS_IF([test "x$libnl3_lib" = "xn" ], [
> > -    AC_MSG_WARN([Disabling support for Remus network buffering.
> > +    AC_MSG_WARN([Disabling support for Remus network buffering and COLO.
> >      Please install libnl3 libraries, command line tools and devel
> >      headers - version 3.2.8 or higher])
> 
> While playing in this area, could the text be expanded to something like:
> 
> "Please install libnl3 libraries (including libnl-route)"
> 
> I spent a rather long time trying to work out I couldn't enable netbuf
> on a fresh install, as they are separate packages.
> 

Oh sure. :-)

Wei.

> ~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL
  2016-04-06 11:01 ` [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL Wei Liu
  2016-04-06 11:29   ` Andrew Cooper
@ 2016-04-06 13:44   ` Ian Jackson
  1 sibling, 0 replies; 12+ messages in thread
From: Ian Jackson @ 2016-04-06 13:44 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel, Changlong Xie, Wen Congyang, Roger Pau Monné

Wei Liu writes ("[PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL"):
> COLO and Remus net buffer support both depend on the availability of
> libnl. Use a generic name.
> 
> No functional changes.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> I committed configure changes as well. Feel free to rerun autogen.sh.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/4] libxl: colo: make it depend on availability of libnl
  2016-04-06 11:01 ` [PATCH v2 4/4] libxl: colo: make it depend on availability of libnl Wei Liu
@ 2016-04-06 13:44   ` Ian Jackson
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Jackson @ 2016-04-06 13:44 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel, Changlong Xie, Wen Congyang, Roger Pau Monné

Wei Liu writes ("[PATCH v2 4/4] libxl: colo: make it depend on availability of libnl"):
> Netlink is required when initialising COLO, so make sure only to compile
> COLO when netlink is available. Change the inclusion of linux/netlink.h
> to netlink/netlink.h.
> 
> Provide necessary stub functions in case COLO is disabled. This should
> fix build on FreeBSD because there is no netlink there. It would also
> make libxl build properly when netlink is not present on a Linux
> system.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/4] COLO: only build when libnl is available
  2016-04-06 11:04 ` [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
@ 2016-04-06 13:56   ` Wei Liu
  2016-04-06 14:10     ` Ian Jackson
  0 siblings, 1 reply; 12+ messages in thread
From: Wei Liu @ 2016-04-06 13:56 UTC (permalink / raw)
  To: Xen-devel
  Cc: Wei Liu, Changlong Xie, Ian Jackson, Wen Congyang, Roger Pau Monné

On Wed, Apr 06, 2016 at 12:04:23PM +0100, Wei Liu wrote:
> On Wed, Apr 06, 2016 at 12:01:12PM +0100, Wei Liu wrote:
> > COLO depends on netlink which is only available on Linux. This series cleans up
> > COLO code and make it only build when libnl is available.  This should fix
> > FreeBSD build.
> > 
> > Tested building on Linux with and without libnl-3-dev and libnl3-route-dev.
> > 
> > git rebase -i HEAD~4 --exec \
> >   './configure --disable-stubdom && \
> >    CCACHE_DISABLE=1 make -C tools/libxl clean && \
> >    CCACHE_DISABLE=1 make -C tools/libxl -j8'
> > 
> > Both build tests on every single commit passed.
> > 
> 
> This series can be found at:
> 
>   git://xenbits.xen.org/people/liuw/xen.git wip.colo-freebsd-fix-v2


I've made change per Andrew's request and folded in all the acks.

Please pull from 

  git://xenbits.xen.org/people/liuw/xen.git wip.colo-freebsd-fix-v3


Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/4] COLO: only build when libnl is available
  2016-04-06 13:56   ` Wei Liu
@ 2016-04-06 14:10     ` Ian Jackson
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Jackson @ 2016-04-06 14:10 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel, Changlong Xie, Wen Congyang, Roger Pau Monné

Wei Liu writes ("Re: [PATCH v2 0/4] COLO: only build when libnl is available"):
> I've made change per Andrew's request and folded in all the acks.

Thank you.

> Please pull from 
> 
>   git://xenbits.xen.org/people/liuw/xen.git wip.colo-freebsd-fix-v3

Queued.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-04-06 14:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06 11:01 [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
2016-04-06 11:01 ` [PATCH v2 1/4] libxl: colo: rearrange things in header files Wei Liu
2016-04-06 11:01 ` [PATCH v2 2/4] libxl: colo: move netlink related stuff to libxl_colo_proxy.c Wei Liu
2016-04-06 11:01 ` [PATCH v2 3/4] build: rename CONFIG_REMUS_NETBUF to CONFIG_LIBNL Wei Liu
2016-04-06 11:29   ` Andrew Cooper
2016-04-06 11:32     ` Wei Liu
2016-04-06 13:44   ` Ian Jackson
2016-04-06 11:01 ` [PATCH v2 4/4] libxl: colo: make it depend on availability of libnl Wei Liu
2016-04-06 13:44   ` Ian Jackson
2016-04-06 11:04 ` [PATCH v2 0/4] COLO: only build when libnl is available Wei Liu
2016-04-06 13:56   ` Wei Liu
2016-04-06 14:10     ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).