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

Re: [Xen-devel] [PATCH v3 04/17] libxl/arm: prepare for constructing ACPI tables




On 2016/7/7 23:50, Wei Liu wrote:
> On Tue, Jul 05, 2016 at 11:12:34AM +0800, Shannon Zhao wrote:
>> > From: Shannon Zhao <shannon.zhao@xxxxxxxxxx>
>> > 
>> > It only constructs the ACPI tables for 64-bit ARM DomU when user enables
>> > acpi because 32-bit DomU doesn't support ACPI.
>> > 
>> > Signed-off-by: Shannon Zhao <shannon.zhao@xxxxxxxxxx>
>> > ---
>> >  tools/libxl/Makefile         |  4 ++++
>> >  tools/libxl/libxl_arm.c      | 19 ++++++++++++++-
>> >  tools/libxl/libxl_arm.h      | 33 ++++++++++++++++++++++++++
>> >  tools/libxl/libxl_arm_acpi.c | 56 
>> > ++++++++++++++++++++++++++++++++++++++++++++
>> >  4 files changed, 111 insertions(+), 1 deletion(-)
>> >  create mode 100644 tools/libxl/libxl_arm.h
>> >  create mode 100644 tools/libxl/libxl_arm_acpi.c
>> > 
>> > diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
>> > index 0cf9f6a..88ab4d2 100644
>> > --- a/tools/libxl/Makefile
>> > +++ b/tools/libxl/Makefile
>> > @@ -91,6 +91,10 @@ acpi:
>> >  
>> >  LIBXL_OBJS-$(CONFIG_X86) += libxl_cpuid.o libxl_x86.o libxl_psr.o 
>> > libxl_x86_acpi.o
>> >  LIBXL_OBJS-$(CONFIG_ARM) += libxl_nocpuid.o libxl_arm.o 
>> > libxl_libfdt_compat.o
>> > +LIBXL_OBJS-$(CONFIG_ARM) += libxl_arm_acpi.o
>> > +
>> > +libxl_arm_acpi.o: libxl_arm_acpi.c
>> > +  $(CC) -c $(CFLAGS) -I../../xen/include/ -o $@ libxl_arm_acpi.c
>> >  
>> >  ifeq ($(CONFIG_NetBSD),y)
>> >  LIBXL_OBJS-y += libxl_netbsd.o
>> > diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
>> > index 4a57dd7..7c522e1 100644
>> > --- a/tools/libxl/libxl_arm.c
>> > +++ b/tools/libxl/libxl_arm.c
>> > @@ -1,6 +1,7 @@
>> >  #include "libxl_internal.h"
>> >  #include "libxl_arch.h"
>> >  #include "libxl_libfdt_compat.h"
>> > +#include "libxl_arm.h"
>> >  
>> >  #include <xc_dom.h>
>> >  #include <stdbool.h>
>> > @@ -885,8 +886,24 @@ int libxl__arch_domain_init_hw_description(libxl__gc 
>> > *gc,
>> >                                             libxl__domain_build_state 
>> > *state,
>> >                                             struct xc_dom_image *dom)
>> >  {
>> > +    int rc;
>> > +
>> >      assert(info->type == LIBXL_DOMAIN_TYPE_PV);
>> > -    return libxl__prepare_dtb(gc, info, state, dom);
>> > +    rc = libxl__prepare_dtb(gc, info, state, dom);
>> > +    if (rc)
>> > +        return rc;
>> > +
>> > +    if (!libxl_defbool_val(info->arch_arm.acpi)) {
>> > +        LOG(DEBUG, "Generating ACPI tables is disabled by user.");
>> > +        return 0;
>> > +    }
>> > +
>> > +    if (strcmp(dom->guest_type, "xen-3.0-aarch64")) {
>> > +        LOG(ERROR, "Can not enable xl option 'acpi' for %s", 
>> > dom->guest_type);
>> > +        return ERROR_FAIL;
>> > +    }
>> > +
>> > +    return libxl__prepare_acpi(gc, info, state, dom);
> Please use goto style error handling for consistency. See
> tools/libxl/CODING_STYLE. Please fix all other instances as well.
> 
Ok, will fix these. Thanks.

-- 
Shannon


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

 


Rackspace

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