[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 06/10] arm: compile libxenguest



On Fri, 2012-02-10 at 12:02 +0000, Stefano Stabellini wrote:
> Introduce an empty implementation of the arch specific ARM functions in
> xc_dom_arm.c.

This bit:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> Also provide empty implementations of xc_domain_save, xc_domain_restore
> and xc_hvm_build_target_mem when CONFIG_HVM or CONFIG_MIGRATE are not
> set.

Less sure about this bit.

Is the content of xc_hvm_build x86 specific? ia64 seems to have it's own
version in tools/libxc/ia64/xc_ia64_hvm_build.c. (I guess ia64 does not
define CONFG_HVM, despite apparently supporting HVM? Otherwise I don't
see how the tools/libxc/Makefile stuff could work)

Perhaps xc_hvm_build should go to xc_x86_hvm_build.c and
xc_x86_arm_build.c should have stubs?

Also xc_hvm_build.c has public functions other than the one you have
stubbed out in it. Should stub them too?

The migrate case seems more like a temporary band-aid since we will
eventually want to support that on ARM -- I guess there's no quick hack
to make it compile since we'd need to define all sorts of things we
aren't ready to define yet?

> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> ---
>  tools/libxc/Makefile       |   15 ++++++++++--
>  tools/libxc/xc_dom_arm.c   |   49 
> ++++++++++++++++++++++++++++++++++++++++++++
>  tools/libxc/xc_nohvm.c     |   31 +++++++++++++++++++++++++++
>  tools/libxc/xc_nomigrate.c |   40 +++++++++++++++++++++++++++++++++++
>  4 files changed, 132 insertions(+), 3 deletions(-)
>  create mode 100644 tools/libxc/xc_dom_arm.c
>  create mode 100644 tools/libxc/xc_nohvm.c
>  create mode 100644 tools/libxc/xc_nomigrate.c
> 
> diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
> index f2e1ba7..57ceee6 100644
> --- a/tools/libxc/Makefile
> +++ b/tools/libxc/Makefile
> @@ -42,9 +42,17 @@ CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
>  
>  GUEST_SRCS-y :=
>  GUEST_SRCS-y += xg_private.c xc_suspend.c
> -GUEST_SRCS-$(CONFIG_MIGRATE) += xc_domain_restore.c xc_domain_save.c
> -GUEST_SRCS-$(CONFIG_MIGRATE) += xc_offline_page.c xc_compression.c
> -GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
> +ifeq ($(CONFIG_MIGRATE),y)
> +GUEST_SRCS-y += xc_domain_restore.c xc_domain_save.c
> +GUEST_SRCS-y += xc_offline_page.c xc_compression.c
> +else
> +GUEST_SRCS-y += xc_nomigrate.c
> +endif
> +ifeq ($(CONFIG_HVM),y)
> +GUEST_SRCS-y += xc_hvm_build.c
> +else
> +GUEST_SRCS-y += xc_nohvm.c
> +endif
>  
>  vpath %.c ../../xen/common/libelf
>  CFLAGS += -I../../xen/common/libelf
> @@ -62,6 +70,7 @@ GUEST_SRCS-y                 += xc_dom_compat_linux.c
>  GUEST_SRCS-$(CONFIG_X86)     += xc_dom_x86.c
>  GUEST_SRCS-$(CONFIG_X86)     += xc_cpuid_x86.c
>  GUEST_SRCS-$(CONFIG_IA64)    += xc_dom_ia64.c
> +GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_arm.c
>  
>  OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
>  
> diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
> new file mode 100644
> index 0000000..bdd28e1
> --- /dev/null
> +++ b/tools/libxc/xc_dom_arm.c
> @@ -0,0 +1,49 @@
> +/*
> + * Xen domain builder -- ARM
> + *
> + * This library 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 of the License.
> + *
> + * This library 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.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
>  USA
> + *
> + * Copyright (c) 2011, Citrix Systems
> + */
> +#include <inttypes.h>
> +#include <xen/xen.h>
> +#include "xg_private.h"
> +#include "xc_dom.h"
> +
> +int arch_setup_meminit(struct xc_dom_image *dom)
> +{
> +    return -ENOSYS;
> +}
> +
> +int arch_setup_bootearly(struct xc_dom_image *dom)
> +{
> +    DOMPRINTF("%s: doing nothing", __FUNCTION__);
> +    return 0;
> +}
> +
> +int arch_setup_bootlate(struct xc_dom_image *dom)
> +{
> +    DOMPRINTF("%s: doing nothing", __FUNCTION__);
> +    return 0;
> +}
> +/*
> + * Local variables:
> + * mode: C
> + * c-set-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/tools/libxc/xc_nohvm.c b/tools/libxc/xc_nohvm.c
> new file mode 100644
> index 0000000..a899f7c
> --- /dev/null
> +++ b/tools/libxc/xc_nohvm.c
> @@ -0,0 +1,31 @@
> +/******************************************************************************
> + * This library 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 of the License.
> + *
> + * This library 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.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
>  USA
> + *
> + * Copyright (c) 2011, Citrix Systems
> + */
> +
> +#include <inttypes.h>
> +#include <errno.h>
> +#include <xenctrl.h>
> +#include <xenguest.h>
> +
> +int xc_hvm_build_target_mem(xc_interface *xch,
> +                           uint32_t domid,
> +                           int memsize,
> +                           int target,
> +                           const char *image_name)
> +{
> +    return -ENOSYS;
> +}
> diff --git a/tools/libxc/xc_nomigrate.c b/tools/libxc/xc_nomigrate.c
> new file mode 100644
> index 0000000..63090e0
> --- /dev/null
> +++ b/tools/libxc/xc_nomigrate.c
> @@ -0,0 +1,40 @@
> +/******************************************************************************
> + * This library 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 of the License.
> + *
> + * This library 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.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
>  USA
> + *
> + * Copyright (c) 2011, Citrix Systems
> + */
> +
> +#include <inttypes.h>
> +#include <errno.h>
> +#include <xenctrl.h>
> +#include <xenguest.h>
> +
> +int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t 
> max_iters,
> +                   uint32_t max_factor, uint32_t flags,
> +                   struct save_callbacks* callbacks, int hvm,
> +                   unsigned long vm_generationid_addr)
> +{
> +    return -ENOSYS;
> +}
> +
> +int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
> +                      unsigned int store_evtchn, unsigned long *store_mfn,
> +                      unsigned int console_evtchn, unsigned long 
> *console_mfn,
> +                      unsigned int hvm, unsigned int pae, int superpages,
> +                      int no_incr_generationid,
> +                      unsigned long *vm_generationid_addr)
> +{
> +    return -ENOSYS;
> +}



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.