tools/libxl: move libxenlight to tools/libs/light

Carve out all libxenlight related sources and move them to
tools/libs/light in order to use the generic library build environment.

The closely related sources for libxl-save-helper and the libxl test
environment are being moved, too.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wl@xen.org>
This commit is contained in:
Juergen Gross committed 2020-10-01 13:26:09 +02:00
1 parent de16a8fa0d
commit 41aea82de2
111 files changed
+645 -299

No files matched your search

+16 -15
View File
@@ -128,6 +128,22 @@ tools/libs/guest/xc_core.h
tools/libs/guest/xc_core_arm.h
tools/libs/guest/xc_core_x86.h
tools/libs/guest/xc_private.h
tools/libs/light/_*.[ch]
tools/libs/light/*.pyc
tools/libs/light/_libxl.api-for-check
tools/libs/light/*.api-ok
tools/libs/light/libxenlight.map
tools/libs/light/libxl-save-helper
tools/libs/light/dsdt*
tools/libs/light/mk_dsdt
tools/libs/light/ssdt*
tools/libs/light/testidl
tools/libs/light/testidl.c
tools/libs/light/test_timedereg
tools/libs/light/test_fdderegrace
tools/libs/light/tmp.*
tools/libs/light/xenlight.pc
tools/libs/light/include/_*.h
tools/libs/stat/_paths.h
tools/libs/stat/headers.chk
tools/libs/stat/libxenstat.map
@@ -216,16 +232,8 @@ tools/include/xen/*
tools/include/xen-xsm/*
tools/include/xen-foreign/*.(c|h|size)
tools/include/xen-foreign/checker
tools/libxl/_libxl.api-for-check
tools/libxl/*.api-ok
tools/libxl/*.pc
tools/libxl/dsdt*
tools/libxl/libxlu_cfg_y.output
tools/libxl/mk_dsdt
tools/libxl/ssdt*
tools/libxl/testenum
tools/libxl/testenum.c
tools/libxl/tmp.*
tools/misc/cpuperf/cpuperf-perfcntr
tools/misc/cpuperf/cpuperf-xen
tools/misc/xc_shadow
@@ -380,13 +388,6 @@ tools/include/xen-foreign/arm64.h
tools/misc/xen-hptool
tools/misc/xen-mfndump
tools/libs/toolcore/include/_*.h
tools/libxl/_*.[ch]
tools/libxl/testidl
tools/libxl/testidl.c
tools/libxl/*.pyc
tools/libxl/libxl-save-helper
tools/libxl/test_timedereg
tools/libxl/test_fdderegrace
tools/firmware/etherboot/eb-roms.h
tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
tools/misc/xenhypfs
+3 -8
View File
@@ -15,9 +15,7 @@ XEN_INCLUDE = $(XEN_ROOT)/tools/include
include $(XEN_ROOT)/tools/libs/uselibs.mk
XEN_libxenlight = $(XEN_ROOT)/tools/libxl
# Currently libxlutil lives in the same directory as libxenlight
XEN_libxlutil = $(XEN_libxenlight)
XEN_libxlutil = $(XEN_ROOT)/tools/libxl
CFLAGS_xeninclude = -I$(XEN_INCLUDE)
@@ -107,6 +105,8 @@ ifeq ($(CONFIG_Linux),y)
LDLIBS_libxenstore += -ldl
endif
CFLAGS_libxenlight += $(CFLAGS_libxenctrl)
ifeq ($(debug),y)
# Disable optimizations
CFLAGS += -O0 -fno-omit-frame-pointer
@@ -116,11 +116,6 @@ else
CFLAGS += -O2 -fomit-frame-pointer
endif
CFLAGS_libxenlight = -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude)
SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) $(SHLIB_libxenguest)
LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenlight$(libextension)
SHLIB_libxenlight = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_libxenlight)
CFLAGS_libxlutil = -I$(XEN_libxlutil)
SHDEPS_libxlutil = $(SHLIB_libxenlight)
LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension)
+1 -1
View File
@@ -585,7 +585,7 @@ PACKAGE_STRING='Xen Hypervisor Tools 4.15'
PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
PACKAGE_URL='https://www.xen.org/'
ac_unique_file="libxl/libxl.c"
ac_unique_file="libs/light/libxl.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
+1 -1
View File
@@ -4,7 +4,7 @@
AC_PREREQ([2.67])
AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
[xen-devel@lists.xen.org], [xen], [https://www.xen.org/])
AC_CONFIG_SRCDIR([libxl/libxl.c])
AC_CONFIG_SRCDIR([libs/light/libxl.c])
AC_CONFIG_FILES([
../config/Tools.mk
hotplug/FreeBSD/rc.d/xencommons
+1 -1
View File
@@ -8,7 +8,7 @@ GOXL_INSTALL_DIR = $(GOCODE_DIR)/src/$(XEN_GOCODE_URL)/xenlight/
GO ?= go
LIBXL_SRC_DIR = ../../libxl
LIBXL_SRC_DIR = $(XEN_ROOT)/tools/libs/light
.PHONY: all
all: build
+1
View File
@@ -15,6 +15,7 @@ SUBDIRS-y += hypfs
SUBDIRS-y += store
SUBDIRS-y += stat
SUBDIRS-$(CONFIG_Linux) += vchan
SUBDIRS-y += light
ifeq ($(CONFIG_RUMP),y)
SUBDIRS-y := toolcore
+330
View File
@@ -0,0 +1,330 @@
LIBXENLIGHT CODING STYLE
========================
AN APOLOGY AND WARNING
----------------------
Much of the code in libxl does not yet follow this coding style
document in every respect. However, new code is expected to conform.
Patches to improve the style of existing code are welcome. Please
separate these out from functional changes.
If it is not feasible to conform fully to the style while patching old
code, without doing substantial style reengineering first, we may
accept patches which contain nonconformant elements, provided that
they don't make the coding style problem worse overall.
In this case, the new code should conform to the prevailing style in
the area being touched.
MEMORY ALLOCATION
-----------------
Memory allocation for libxl-internal purposes should normally be done
with the provided gc mechanisms; there is then no need to free. See
"libxl memory management" in libxl.h.
CONVENTIONAL VARIABLE NAMES
---------------------------
The following local variable names should be used where applicable:
int rc; /* a libxl error code - and not anything else */
int r; /* the return value from a system call (or libxc call) */
bool ok; /* the success return value from a boolean function */
uint32_t domid;
libxl__gc *gc;
libxl__egc *egc;
libxl__ao *ao;
libxl_foo_bar_state *fbs; /* local variable */
libxl_foo_bar_state foo_bar; /* inside another state struct */
CONVENIENCE MACROS
------------------
There are a number of convenience macros which shorten the program and
avoid opportunity for mistakes. In some cases non-use of the macros
produces functional bugs or incorrect error handling. Use the macros
whenever they are applicable. For example:
Usually, don't use: Instead, use (see libxl_internal.h):
libxl__log[v] LOG, LOGE, LOGEV
libxl__sprintf GCSPRINTF
libxl__*alloc et al. GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
isalnum etc. directly CTYPE
libxl__ctx_[un]lock CTX_LOCK, CTX_UNLOCK
gc=...; ao=...; EGC_GC, AO_GC, STATE_AO_GC
explicit gc creation GC_INIT, GC_FREE
memset(..,0,sizeof..) FILLZERO
Instead of malloc et al one should (as an exception to the above) use
libxl__{zalloc,calloc,realloc} etc but passing NOGC.
ERROR HANDLING
--------------
Unless, there are good reasons to do otherwise, the following error
handling and cleanup paradigm should be used:
* All local variables referring to resources which might need
cleaning up are declared at the top of the function, and
initialised to a sentinel value indicating "nothing allocated".
For example,
libxl_evgen_disk_eject *evg = NULL;
int nullfd = -1;
* If the function is to return a libxl error value, `rc' is
used to contain the error code, but it is NOT initialised:
int rc;
* There is only one error cleanup path out of the function. It
starts with a label `out:'. That error cleanup path checks for
each allocated resource and frees it iff necessary. It then
returns rc. For example,
out:
if (evg) libxl__evdisable_disk_eject(gc, evg);
if (nullfd >= 0) close(nullfd);
return rc;
* Function calls which might fail (ie most function calls) are
handled by putting the return/status value into a variable, and
then checking it in a separate statement:
char *dompath = libxl__xs_get_dompath(gc, bl->domid);
if (!dompath) { rc = ERROR_FAIL; goto out; }
* If a resource is freed in the main body of the function (for
example, in a loop), the corresponding variable has to be reset to
the sentinel at the point where it's freed.
Whether to use the `out' path for successful returns as well as error
returns is a matter of taste and convenience for the specific
function. Not reusing the out path is fine if the duplicated function
exit code is only `CTX_UNLOCK; GC_FREE;' (or similar).
If you reuse the `out' path for successful returns, there may be
resources which are to be returned to the caller rather than freed.
In that case you have to reset the local variable to `nothing here',
to avoid the resource being freed on the out path. That resetting
should be done immediately after the resource value is stored at the
applicable _r function parameter (or equivalent). Do not test `rc' in
the out section, to discover whether to free things.
The uses of the single-line formatting in the examples above are
permitted exceptions to the usual libxl code formatting rules.
IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
--------------------------------------------------
Nontrivial data structures (in structs) should come with an idempotent
_dispose function, which must free all resources associated with the
data structure (but not free the struct itself).
Such a struct should also come with an _init function which
initialises the struct so that _dispose is a no-op.
ASYNCHRONOUS/LONG-RUNNING OPERATIONS
------------------------------------
All long-running operations in libxl need to use the asynchronous
operation machinery. Consult the programmer documentation in
libxl_internal.h for details - search for "Machinery for asynchronous
operations".
The code for asynchronous operations should be laid out in
chronological order. That is, where there is a chain of callback
functions, each subsequent function should be, textually, the next
function in the file. This will normally involve predeclaring the
callback functions. Synchronous helper functions should be separated
out into a section preceding the main callback chain.
Control flow arrangements in asynchronous operations should be made as
simple as possible, because it can otherwise be very hard to see
through the tangle.
When inventing a new sub-operation in asynchronous code, consider
whether to structure it formally as a sub-operation with its own state
structure. (See, for example, libxl__datacopier_*.)
An ao-suboperation state structure should contain, in this order:
* fields that the caller must fill in, and which are,
effectively, the parameters to the operation, including:
- libxl__ao *ao
- the callback function pointer(s), which
should be named callback or callback_*.
* shared information fields or ones used for returning information
to the calling operation
* private fields
These sections should be clearly demarcated by comments.
An asynchronous operation should normally have an idempotent stop or
cancel function. It should normally also have an _init function for
its state struct, which arranges that the stop is a no-op.
The permitted order of calls into your ao operation's methods must be
documented in comments, if it is nontrivial.
When using an ao sub-operation, you should normally:
* Physically include the sub-operation state struct in your
own state struct;
* Use CONTAINER_OF to find your own state struct at the start of
your implementations of the sub-operation callback functions;
* Unconditionally initialise the sub-operation's struct (with its
_init method) in your own _init method.
* Unconditionally cancel or destroy the sub-operation in your own
cancel or destroy method.
FORMATTING AND NAMING
---------------------
Blatantly copied from qemu and linux with few modifications.
1. Whitespace
Of course, the most important aspect in any coding style is whitespace.
Crusty old coders who have trouble spotting the glasses on their noses
can tell the difference between a tab and eight spaces from a distance
of approximately fifteen parsecs. Many a flamewar have been fought and
lost on this issue.
Libxenlight indents are four spaces. Tabs are never used, except in
Makefiles where they have been irreversibly coded into the syntax.
Spaces of course are superior to tabs because:
- You have just one way to specify whitespace, not two. Ambiguity breeds
mistakes.
- The confusion surrounding 'use tabs to indent, spaces to justify' is gone.
- Tab indents push your code to the right, making your screen seriously
unbalanced.
- Tabs will be rendered incorrectly on editors who are misconfigured not
to use tab stops of eight positions.
- Tabs are rendered badly in patches, causing off-by-one errors in almost
every line.
- It is the libxenlight coding style.
Do not leave whitespace dangling off the ends of lines.
2. Line width
Lines are limited to 75 characters.
Rationale:
- Some people like to tile their 24" screens with a 6x4 matrix of 80x24
xterms and use vi in all of them. The best way to punish them is to
let them keep doing it.
- In an 80 column terminal, some room needs to be left for > quoting
characters, +/- diff characters, and so on, in emails.
- Code and especially patches is much more readable if limited to a sane
line length. Eighty is traditional.
- It is the libxenlight coding style.
3. Naming
C is a Spartan language, and so should your naming be. Unlike Modula-2
and Pascal programmers, C programmers do not use cute names like
ThisVariableIsATemporaryCounter. A C programmer would call that
variable "tmp", which is much easier to write, and not the least more
difficult to understand.
HOWEVER, while mixed-case names are frowned upon, descriptive names for
global variables are a must. To call a global function "foo" is a
shooting offense.
GLOBAL variables (to be used only if you _really_ need them) need to
have descriptive names, as do global functions. If you have a function
that counts the number of active users, you should call that
"count_active_users()" or similar, you should _not_ call it "cntusr()".
Encoding the type of a function into the name (so-called Hungarian
notation) is brain damaged - the compiler knows the types anyway and can
check those, and it only confuses the programmer.
LOCAL variable names should be short, and to the point. If you have
some random integer loop counter, it should probably be called "i".
Calling it "loop_counter" is non-productive, if there is no chance of it
being mis-understood. Similarly, "tmp" can be just about any type of
variable that is used to hold a temporary value.
Local variables used to store return values should have descriptive name
like "rc" or "ret". Following the same reasoning the label used as exit
path should be called "out".
Function arguments which are used to return values to the caller
should be suffixed `_r' or `_out'.
Variables, type names and function names are
lower_case_with_underscores.
Type names and function names use the prefix libxl__ when internal to
libxenlight and libxl_ when exported in libxl.h.
Xl should avoid using libxl_ and libxl__ as prefix for its own function
names.
When wrapping standard library functions, use the prefix libxl_ to alert
readers that they are seeing a wrapped version; otherwise avoid this prefix.
Typedefs are used to eliminate the redundant 'struct' keyword.
It is the libxenlight coding style.
4. Statements
Don't put multiple statements on a single line.
Don't put multiple assignments on a single line either.
Error code paths with an if statement and a goto or a return on the same
line are allowed. Examples:
if (rc) goto out;
if (rc < 0) return;
Libxenlight coding style is super simple. Avoid tricky expressions.
5. Block structure
Every indented statement is braced, but blocks that contain just one
statement may have the braces omitted. To avoid confusion, either all
the blocks in an if...else chain have braces, or none of them do.
The opening brace is on the line that contains the control flow
statement that introduces the new block; the closing brace is on the
same line as the else keyword, or on a line by itself if there is no
else keyword. Examples:
if (a == 5) {
printf("a was 5.\n");
} else if (a == 6) {
printf("a was 6.\n");
} else {
printf("a was something else entirely.\n");
}
if (a == 5)
printf("a was 5.\n");
An exception is the opening brace for a function; for reasons of tradition
and clarity it comes on a line by itself:
void a_function(void)
{
do_something();
}
Rationale: a consistent (except for functions...) bracing style reduces
ambiguity and avoids needless churn when lines are added or removed.
Furthermore, it is the libxenlight coding style.
+277
View File
@@ -0,0 +1,277 @@
XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
SRCS-y += osdeps.c
SRCS-y += libxl_paths.c
SRCS-y += libxl_bootloader.c
SRCS-y += flexarray.c
ifeq ($(CONFIG_LIBNL),y)
SRCS-y += libxl_netbuffer.c
else
SRCS-y += libxl_nonetbuffer.c
endif
ifeq ($(CONFIG_X86),y)
SRCS-y += libxl_convert_callout.c
else
SRCS-y += libxl_no_convert_callout.c
endif
SRCS-y += libxl_remus.c
SRCS-y += libxl_checkpoint_device.c
SRCS-y += libxl_remus_disk_drbd.c
ifeq ($(CONFIG_LIBNL),y)
SRCS-y += libxl_colo_restore.c
SRCS-y += libxl_colo_save.c
SRCS-y += libxl_colo_qdisk.c
SRCS-y += libxl_colo_proxy.c
SRCS-y += libxl_colo_nic.c
else
SRCS-y += libxl_no_colo.c
endif
ACPI_PATH = $(XEN_ROOT)/tools/libacpi
DSDT_FILES-$(CONFIG_X86) = dsdt_pvh.c
ACPI_OBJS = $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o
ACPI_PIC_OBJS = $(patsubst %.o,%.opic,$(ACPI_OBJS))
$(DSDT_FILES-y): acpi
vpath build.c $(ACPI_PATH)/
vpath static_tables.c $(ACPI_PATH)/
.PHONY: acpi
acpi:
$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
SRCS-$(CONFIG_X86) += $(ACPI_OBJS:.o=.c)
CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
-Wno-declaration-after-statement -Wformat-nonliteral
CFLAGS += -I.
SRCS-$(CONFIG_X86) += libxl_cpuid.c
SRCS-$(CONFIG_X86) += libxl_x86.c
SRCS-$(CONFIG_X86) += libxl_psr.c
SRCS-$(CONFIG_X86) += libxl_x86_acpi.c
SRCS-$(CONFIG_ARM) += libxl_nocpuid.c
SRCS-$(CONFIG_ARM) += libxl_arm.c
SRCS-$(CONFIG_ARM) += libxl_libfdt_compat.c
ifeq ($(CONFIG_ARM_64),y)
DSDT_FILES-y = dsdt_anycpu_arm.c
SRCS-y += libxl_arm_acpi.c
SRCS-y += $(DSDT_FILES-y)
dsdt_anycpu_arm.c:
$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
else
SRCS-$(CONFIG_ARM) += libxl_arm_no_acpi.c
endif
SRCS-OS-$(CONFIG_NetBSD) = libxl_netbsd.c
SRCS-OS-$(CONFIG_Linux) = libxl_linux.c
SRCS-OS-$(CONFIG_FreeBSD) = libxl_freebsd.c
ifeq ($(SRCS-OS-y),)
$(error Your Operating System is not supported by libxenlight, \
please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
endif
SRCS-y += $(SRCS-OS-y)
SRCS-y += libxl.c
SRCS-y += libxl_create.c
SRCS-y += libxl_dm.c
SRCS-y += libxl_pci.c
SRCS-y += libxl_dom.c
SRCS-y += libxl_exec.c
SRCS-y += libxl_xshelp.c
SRCS-y += libxl_device.c
SRCS-y += libxl_internal.c
SRCS-y += libxl_utils.c
SRCS-y += libxl_uuid.c
SRCS-y += libxl_json.c
SRCS-y += libxl_aoutils.c
SRCS-y += libxl_numa.c
SRCS-y += libxl_vnuma.c
SRCS-y += libxl_stream_read.c
SRCS-y += libxl_stream_write.c
SRCS-y += libxl_save_callout.c
SRCS-y += _libxl_save_msgs_callout.c
SRCS-y += libxl_qmp.c
SRCS-y += libxl_event.c
SRCS-y += libxl_fork.c
SRCS-y += libxl_dom_suspend.c
SRCS-y += libxl_dom_save.c
SRCS-y += libxl_usb.c
SRCS-y += libxl_vtpm.c
SRCS-y += libxl_nic.c
SRCS-y += libxl_disk.c
SRCS-y += libxl_console.c
SRCS-y += libxl_cpupool.c
SRCS-y += libxl_mem.c
SRCS-y += libxl_sched.c
SRCS-y += libxl_tmem.c
SRCS-y += libxl_9pfs.c
SRCS-y += libxl_domain.c
SRCS-y += libxl_vdispl.c
SRCS-y += libxl_pvcalls.c
SRCS-y += libxl_vsnd.c
SRCS-y += libxl_vkb.c
SRCS-y += libxl_genid.c
SRCS-y += _libxl_types.c
SRCS-y += libxl_flask.c
SRCS-y += _libxl_types_internal.c
ifeq ($(CONFIG_LIBNL),y)
CFLAGS_LIBXL += $(LIBNL3_CFLAGS)
endif
CFLAGS_LIBXL += -Wshadow
ifeq ($(debug),y)
CFLAGS_LIBXL += -DCONFIG_DEBUG
endif
CFLAGS += $(PTHREAD_CFLAGS)
LDFLAGS += $(PTHREAD_LDFLAGS)
LIBXL_TESTS += timedereg
LIBXL_TESTS_PROGS = $(LIBXL_TESTS) fdderegrace
LIBXL_TESTS_INSIDE = $(LIBXL_TESTS) fdevent
# Each entry FOO in LIBXL_TESTS has two main .c files:
# libxl_test_FOO.c "inside libxl" code to support the test case
# test_FOO.c "outside libxl" code to exercise the test case
# Conventionally there will also be:
# libxl_test_FOO.h interface between the "inside" and "outside" parts
# The "inside libxl" file is compiled exactly like a piece of libxl, and the
# "outside libxl" file is compiled exactly like a piece of application
# code. They must share information via explicit libxl entrypoints.
# Unlike proper parts of libxl, it is permissible for libxl_test_FOO.c
# to use private global variables for its state. Note that all the
# "inside" parts are compiled into a single test library, so their
# symbol names must be unique.
#
# To run these tests, either use LD_PRELOAD to get libxenlight_test.so
# loaded, or rename it to libxenlight.so so it is the target of the
# appropriate symlinks.
LIBXL_TEST_OBJS += $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.opic)
TEST_PROG_OBJS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_common.o
TEST_PROGS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t)
AUTOINCS = _libxl_list.h _paths.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
AUTOSRCS = _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c
CLIENTS = testidl libxl-save-helper
SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
LIBHEADER := libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h
NO_HEADERS_CHK := y
include $(XEN_ROOT)/tools/libs/libs.mk
$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(CURDIR)
$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
LDUSELIBS-y += $(PTYFUNCS_LIBS)
LDUSELIBS-$(CONFIG_LIBNL) += $(LIBNL3_LIBS)
LDUSELIBS-$(CONFIG_Linux) += -luuid
LDUSELIBS-$(CONFIG_Linux) += -lrt
LDUSELIBS-$(CONFIG_ARM) += -lfdt
LDUSELIBS-y += $(PTHREAD_LIBS)
LDUSELIBS-y += -lyajl
LDUSELIBS += $(LDUSELIBS-y)
$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
$(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\"
$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore)
libxl_dom.o libxl_dom.opic: CFLAGS += -I$(XEN_ROOT)/tools # include libacpi/x86.h
libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS += -I$(XEN_ROOT)/tools
$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest)
testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
testidl.c: libxl_types.idl gentest.py include/libxl.h $(AUTOINCS)
$(PYTHON) gentest.py libxl_types.idl testidl.c.new
mv testidl.c.new testidl.c
build: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS)
$(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok
genpath-target = $(call buildmakevars2header,_paths.h)
$(eval $(genpath-target))
libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
$(PERL) $^
touch $@
_%.api-for-check: include/%.h $(AUTOINCS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
>$@.new
mv -f $@.new $@
_libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
$(PERL) $^ --prefix=libxl >$@.new
$(call move-if-changed,$@.new,$@)
_libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \
_libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \
libxl_save_msgs_gen.pl
$(PERL) -w $< $@ >$@.new
$(call move-if-changed,$@.new,$@)
include/libxl.h: _libxl_types.h _libxl_list.h
include/libxl_json.h: _libxl_types_json.h
libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h _paths.h
libxl_internal_json.h: _libxl_types_internal_json.h
xl.h: _paths.h
$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): include/libxl.h
$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
$(eval stem = $(notdir $*))
$(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl_type$(stem)_private.h \
__libxl_type$(stem)_json.h __libxl_type$(stem).c
$(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h)
$(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_private.h)
$(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json.h)
$(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c)
include/_%.h: _%.h
cp $< $@
libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS)
$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDUSELIBS) $(APPEND_LDFLAGS)
test_%: test_%.o test_common.o libxenlight_test.so
$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS)
libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
testidl: testidl.o libxenlight.so
$(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
install: installlocal $(LIBHEADERS)
.PHONY: installlocal
installlocal: libxl-save-helper
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
uninstall: uninstalllocal
.PHONY: uninstalllocal
uninstalllocal:
rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper
clean: cleanlocal
.PHONY: cleanlocal
cleanlocal:
$(RM) -f _*.h *.o $(CLIENTS)
$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
$(RM) -f testidl.c.new testidl.c *.api-ok
$(RM) -f $(TEST_PROGS)
$(RM) -rf __pycache__
$(RM) -f include/_*.h
$(RM) -f libxenlight.map
$(RM) -f $(AUTOSRCS) $(AUTOINCS)
$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 111 files, more files were not shown because too many files have changed in this diff. Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.