xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <wei.liu2@citrix.com>,
	"Changlong Xie" <xiecl.fnst@cn.fujitsu.com>,
	"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
	"Wen Congyang" <wency@cn.fujitsu.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH 3/3] libxl: colo: only build COLO on Linux
Date: Tue, 5 Apr 2016 21:06:02 +0100	[thread overview]
Message-ID: <1459886762-8815-4-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1459886762-8815-1-git-send-email-wei.liu2@citrix.com>

Linux's netlink is required when initialising COLO, so make sure only to
compile COLO on Linux.

Provide necessary stub functions in case COLO is disabled. This should
fix libxl build on FreeBSD.

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

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index a433aaa..47564b3 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_Linux),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_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

  parent reply	other threads:[~2016-04-05 20:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 20:05 [PATCH 0/3] COLO: only build on Linux Wei Liu
2016-04-05 20:06 ` [PATCH 1/3] libxl: colo: rearrange things in header files Wei Liu
2016-04-06 13:41   ` Ian Jackson
2016-04-05 20:06 ` [PATCH 2/3] libxl: colo: move netlink related stuff to libxl_colo_proxy.c Wei Liu
2016-04-06 13:41   ` Ian Jackson
2016-04-05 20:06 ` Wei Liu [this message]
2016-04-06 10:24   ` [PATCH 3/3] libxl: colo: only build COLO on Linux Wei Liu
2016-04-06  1:24 ` [PATCH 0/3] COLO: only build " Wen Congyang
2016-04-06 10:17   ` Wei Liu
2016-04-06 10:20     ` Wen Congyang
2016-04-06 10:22       ` Wei Liu
2016-04-06  6:19 ` Changlong Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459886762-8815-4-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wency@cn.fujitsu.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xiecl.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).