From patchwork Tue Jan 26 15:52:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 8124361 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E5D41BEEE5 for ; Tue, 26 Jan 2016 15:54:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB3E32026C for ; Tue, 26 Jan 2016 15:54:35 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3EF42025A for ; Tue, 26 Jan 2016 15:54:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aO5uu-0000Cf-9R; Tue, 26 Jan 2016 15:52:28 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aO5ut-0000BV-1x for xen-devel@lists.xensource.com; Tue, 26 Jan 2016 15:52:27 +0000 Received: from [85.158.143.35] by server-2.bemta-4.messagelabs.com id 1E/A4-08977-A3697A65; Tue, 26 Jan 2016 15:52:26 +0000 X-Env-Sender: prvs=826ae1113=Stefano.Stabellini@citrix.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1453823543!12208250!1 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: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34276 invoked from network); 26 Jan 2016 15:52:25 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 26 Jan 2016 15:52:25 -0000 X-IronPort-AV: E=Sophos;i="5.22,350,1449532800"; d="scan'208";a="334045000" From: Stefano Stabellini To: Date: Tue, 26 Jan 2016 15:52:07 +0000 Message-ID: <1453823527-22312-8-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , xen-devel@lists.xensource.com, qemu-devel@nongnu.org, Stefano Stabellini Subject: [Xen-devel] [PULL 8/8] xen: make it possible to build without the Xen PV domain builder X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org 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 From: Ian Campbell Until the previous patch this relied on xc_fd(), which was only implemented for Xen 4.0 and earlier. Given this wasn't working since Xen 4.0 I have marked this as disabled by default. Removing this support drops the use of a bunch of symbols from libxenctrl, specifically: - xc_domain_create - xc_domain_destroy - xc_domain_getinfo - xc_domain_max_vcpus - xc_domain_setmaxmem - xc_domain_unpause - xc_evtchn_alloc_unbound - xc_linux_build This is another step towards only using Xen libraries which provide a stable inteface. Signed-off-by: Ian Campbell Reviewed-by: Stefano Stabellini --- configure | 15 +++++++++++++++ hw/xenpv/Makefile.objs | 4 +++- hw/xenpv/xen_machine_pv.c | 15 +++++++++++---- include/hw/xen/xen_common.h | 2 ++ 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 9ead31d..3506e44 100755 --- a/configure +++ b/configure @@ -250,6 +250,7 @@ vnc_jpeg="" vnc_png="" xen="" xen_ctrl_version="" +xen_pv_domain_build="no" xen_pci_passthrough="" linux_aio="" cap_ng="" @@ -927,6 +928,10 @@ for opt do ;; --enable-xen-pci-passthrough) xen_pci_passthrough="yes" ;; + --disable-xen-pv-domain-build) xen_pv_domain_build="no" + ;; + --enable-xen-pv-domain-build) xen_pv_domain_build="yes" + ;; --disable-brlapi) brlapi="no" ;; --enable-brlapi) brlapi="yes" @@ -2229,6 +2234,12 @@ if test "$xen_pci_passthrough" != "no"; then fi fi +if test "$xen_pv_domain_build" = "yes" && + test "$xen" != "yes"; then + error_exit "User requested Xen PV domain builder support" \ + "which requires Xen support." +fi + ########################################## # libtool probe @@ -4848,6 +4859,7 @@ fi echo "xen support $xen" if test "$xen" = "yes" ; then echo "xen ctrl version $xen_ctrl_version" + echo "pv dom build $xen_pv_domain_build" fi echo "brlapi support $brlapi" echo "bluez support $bluez" @@ -5219,6 +5231,9 @@ fi if test "$xen" = "yes" ; then echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak + if test "$xen_pv_domain_build" = "yes" ; then + echo "CONFIG_XEN_PV_DOMAIN_BUILD=y" >> $config_host_mak + fi fi if test "$linux_aio" = "yes" ; then echo "CONFIG_LINUX_AIO=y" >> $config_host_mak diff --git a/hw/xenpv/Makefile.objs b/hw/xenpv/Makefile.objs index 49f6e9e..bbf5873 100644 --- a/hw/xenpv/Makefile.objs +++ b/hw/xenpv/Makefile.objs @@ -1,2 +1,4 @@ # Xen PV machine support -obj-$(CONFIG_XEN) += xen_domainbuild.o xen_machine_pv.o +obj-$(CONFIG_XEN) += xen_machine_pv.o +# Xen PV machine builder support +obj-$(CONFIG_XEN_PV_DOMAIN_BUILD) += xen_domainbuild.o diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 23d6ef0..3250b94 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -30,9 +30,6 @@ static void xen_init_pv(MachineState *machine) { - const char *kernel_filename = machine->kernel_filename; - const char *kernel_cmdline = machine->kernel_cmdline; - const char *initrd_filename = machine->initrd_filename; DriveInfo *dinfo; int i; @@ -46,17 +43,27 @@ static void xen_init_pv(MachineState *machine) case XEN_ATTACH: /* nothing to do, xend handles everything */ break; - case XEN_CREATE: +#ifdef CONFIG_XEN_PV_DOMAIN_BUILD + case XEN_CREATE: { + const char *kernel_filename = machine->kernel_filename; + const char *kernel_cmdline = machine->kernel_cmdline; + const char *initrd_filename = machine->initrd_filename; if (xen_domain_build_pv(kernel_filename, initrd_filename, kernel_cmdline) < 0) { fprintf(stderr, "xen pv domain creation failed\n"); exit(1); } break; + } +#endif case XEN_EMULATE: fprintf(stderr, "xen emulation not implemented (yet)\n"); exit(1); break; + default: + fprintf(stderr, "unhandled xen_mode %d\n", xen_mode); + exit(1); + break; } xen_be_register("console", &xen_console_ops); diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index be7a915..0d83891 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -505,6 +505,7 @@ static inline int xen_xc_domain_add_to_physmap(XenXC xch, uint32_t domid, } #endif +#ifdef CONFIG_XEN_PV_DOMAIN_BUILD #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 470 static inline int xen_domain_create(XenXC xc, uint32_t ssidref, xen_domain_handle_t handle, uint32_t flags, @@ -520,6 +521,7 @@ static inline int xen_domain_create(XenXC xc, uint32_t ssidref, return xc_domain_create(xc, ssidref, handle, flags, pdomid, NULL); } #endif +#endif #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471