From patchwork Tue Apr 5 20:06:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 8754801 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 06A5D9F39A for ; Tue, 5 Apr 2016 20:07:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CCBB20351 for ; Tue, 5 Apr 2016 20:07:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D8EE200E3 for ; Tue, 5 Apr 2016 20:07:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anXDc-0001nL-BH; Tue, 05 Apr 2016 20:04:56 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anXDb-0001mr-2a for xen-devel@lists.xenproject.org; Tue, 05 Apr 2016 20:04:55 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id D4/AA-02978-66A14075; Tue, 05 Apr 2016 20:04:54 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHSDvW6qFEu 4wbtpehbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bZdXtZC7olKib/WsXYwHhBuIuRk0NCwF/i 7uLNTCA2m4CyxM/OXjYQW0RAT6LpwHPGLkYuDmaBW4wSOzu7WUASwgJWEos3dYHZLAIqEp/u3 wJr4BVwkrjV/YwZYqicxPnjP8FsTgFnic4Pl4BqODiEgGounlAECQsJKEh0TD/GBNEqKHFy5h OwkcwCEhIHX7yAGsMtcfv0VOYJjHyzkJTNQlK2gJFpFaN6cWpRWWqRrqFeUlFmekZJbmJmjq6 hgbFebmpxcWJ6ak5iUrFecn7uJkZgSDEAwQ7G5R+dDjFKcjApifLue88cLsSXlJ9SmZFYnBFf VJqTWnyIUYaDQ0mCN1CSJVxIsCg1PbUiLTMHGNwwaQkOHiUR3u0gad7igsTc4sx0iNQpRkUpc V43kIQASCKjNA+uDRZRlxhlpYR5GYEOEeIpSC3KzSxBlX/FKM7BqCQMMZ4nM68EbvoroMVMQI vrhZlAFpckIqSkGhj1zqvaPHnHm5j7LnjRhEXq0gYJXgGr1x54XzW527SnXPVT3/6D361F4tt 3t3w40/MoillvTdVBXefHUX+PPvCY93BiWWFkfZ189LZlXw6WL97a+/eTr8Vdvo4bi9yyZ57c +6SqQkorIX7WGUeF6/E1WkZfzths+tRSu227wsE7potmih3JUH+uxFKckWioxVxUnAgAkB6Ze 6MCAAA= X-Env-Sender: prvs=896d5009f=wei.liu2@citrix.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1459886691!25684337!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2975 invoked from network); 5 Apr 2016 20:04:53 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 5 Apr 2016 20:04:53 -0000 X-IronPort-AV: E=Sophos;i="5.24,445,1454976000"; d="scan'208";a="351729138" From: Wei Liu To: Xen-devel Date: Tue, 5 Apr 2016 21:06:02 +0100 Message-ID: <1459886762-8815-4-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459886762-8815-1-git-send-email-wei.liu2@citrix.com> References: <1459886762-8815-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Wei Liu , Changlong Xie , Ian Jackson , Wen Congyang , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [PATCH 3/3] libxl: colo: only build COLO on Linux X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 + * + * 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: + */