Refactor xl code
cover Refactor xl code
xl_cmdimpl.c has become prohibitively large (almost 10k lines in one single file). Try to split it up into multiple files according to the functionality of the code.
I will run a full osstest flight before merging. Send the first version out as quick as possible to gather feedback because I know other people are also touching this area of code.
Further improvements are certainly desired, for example we should probably give functions better names, but this series is already very long, so let's save that for another day.
Wei Liu (29):
xl: remove accidentally committed hunk from Makefile
xl: update copyright information
xl: remove inclusion of libxl_osdeps.h
xl: use <> variant to include Xen tools library headers
xl: generate _paths.h
xl: remove trailing spaces in xl_cmdimpl.c
xl: lift a bunch of macros to xl_utils.h
xl: move some helper functions to xl_utils.c
xl: split out tmem related code to xl_tmem.c
xl: split out xl_parse.[ch]
xl: split out cpupool related code
xl: split out flask related code
xl: split out vtpm related code
xl: split out block related code
xl: split out network related code
xl: split out usb related code
xl: split out scheduler related code
xl: split out pci related code
xl: split out vcpu related code
xl: split out cd related code
xl: split out memory related code
xl: split out psr related code
xl: split out functions to print out information
xl: split out vnc and console related code
xl: split out miscellaneous functions
xl: split out vm lifecycle control functions
xl: split out save/restore related code
xl: split out migration related code
xl: merge xl_cmdimpl.c into xl.c
.gitignore | 1 + tools/xl/Makefile | 19 +- tools/xl/xl.c | 70 +- tools/xl/xl.h | 77 +- tools/xl/xl_block.c | 129 + tools/xl/xl_cd.c | 114 + tools/xl/xl_cmdimpl.c | 9642 --------------------------------------------- tools/xl/xl_cmdtable.c | 4 +- tools/xl/xl_console.c | 130 + tools/xl/xl_cpupool.c | 624 +++ tools/xl/xl_flask.c | 153 + tools/xl/xl_info.c | 925 +++++ tools/xl/xl_mem.c | 167 + tools/xl/xl_migrate.c | 754 ++++ tools/xl/xl_misc.c | 355 ++ tools/xl/xl_nic.c | 172 + tools/xl/xl_parse.c | 2052 ++++++++++ tools/xl/xl_parse.h | 65 + tools/xl/xl_pci.c | 278 ++ tools/xl/xl_psr.c | 567 +++ tools/xl/xl_saverestore.c | 273 ++ tools/xl/xl_sched.c | 888 +++++ tools/xl/xl_sxp.c | 10 +- tools/xl/xl_tmem.c | 251 ++ tools/xl/xl_usb.c | 222 ++ tools/xl/xl_utils.c | 328 ++ tools/xl/xl_utils.h | 157 + tools/xl/xl_vcpu.c | 337 ++ tools/xl/xl_vmcontrol.c | 1225 ++++++ tools/xl/xl_vtpm.c | 153 + 30 files changed, 10474 insertions(+), 9668 deletions(-) create mode 100644 tools/xl/xl_block.c create mode 100644 tools/xl/xl_cd.c delete mode 100644 tools/xl/xl_cmdimpl.c create mode 100644 tools/xl/xl_console.c create mode 100644 tools/xl/xl_cpupool.c create mode 100644 tools/xl/xl_flask.c create mode 100644 tools/xl/xl_info.c create mode 100644 tools/xl/xl_mem.c create mode 100644 tools/xl/xl_migrate.c create mode 100644 tools/xl/xl_misc.c create mode 100644 tools/xl/xl_nic.c create mode 100644 tools/xl/xl_parse.c create mode 100644 tools/xl/xl_parse.h create mode 100644 tools/xl/xl_pci.c create mode 100644 tools/xl/xl_psr.c create mode 100644 tools/xl/xl_saverestore.c create mode 100644 tools/xl/xl_sched.c create mode 100644 tools/xl/xl_tmem.c create mode 100644 tools/xl/xl_usb.c create mode 100644 tools/xl/xl_utils.c create mode 100644 tools/xl/xl_utils.h create mode 100644 tools/xl/xl_vcpu.c create mode 100644 tools/xl/xl_vmcontrol.c create mode 100644 tools/xl/xl_vtpm.c
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 1/29 xl: remove accidentally committed hunk from Makefile
It was never intended to be committed. Lucky the high level Makefile was correct so it didn't cause us problem when building xl.
--- tools/xl/Makefile | 6 ------ 1 file changed, 6 deletions(-)
tools/xl/Makefile +0 -6
@@ -20,12 +20,6 @@ $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL) $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it. -# libxenlight should be built before building xl -.PHONY: libxl -libxl: - $(MAKE) -C $(XEN_ROOT)/tools/libxl -$(XL_OBJS): libxl - .PHONY: all all: xl
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 01/29] xl: remove accidentally committed hunk from Makefile
Wei Liu writes ("[PATCH 01/29] xl: remove accidentally committed hunk from Makefile"):
Quoted 2 lines
It was never intended to be committed. Lucky the high level
Makefilewas correct so it didn't cause us problem when building xl.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 2/29 xl: update copyright information
In reply to Wei Liu--- tools/xl/xl.c | 4 +--- tools/xl/xl.h | 2 +- tools/xl/xl_cmdimpl.c | 4 +--- tools/xl/xl_cmdtable.c | 2 +- tools/xl/xl_sxp.c | 4 +--- 5 files changed, 5 insertions(+), 11 deletions(-)
tools/xl/xl.c +1 -3
@@ -1,7 +1,5 @@/* -* Copyright (C) 2009 Citrix Ltd. -* Author Stefano Stabellini <[email protected]> -* Author Vincent Hanquez <[email protected]> +* Copyright 2009-2017 Citrix Ltd and other contributors * * 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
tools/xl/xl.h +1 -1
@@ -1,5 +1,5 @@/* -* Author Yang Hongyang <[email protected]> +* Copyright 2009-2017 Citrix Ltd and other contributors * * 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
tools/xl/xl_cmdimpl.c +1 -3
@@ -1,7 +1,5 @@/* -* Copyright (C) 2009 Citrix Ltd. -* Author Stefano Stabellini <[email protected]> -* Author Vincent Hanquez <[email protected]> +* Copyright 2009-2017 Citrix Ltd and other contributors * * 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
tools/xl/xl_cmdtable.c +1 -1
@@ -1,5 +1,5 @@/* -* Author Yang Hongyang <[email protected]> +* Copyright 2009-2017 Citrix Ltd and other contributors * * 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
tools/xl/xl_sxp.c +1 -3
@@ -1,7 +1,5 @@/* -* Copyright (C) 2009 Citrix Ltd. -* Author Stefano Stabellini <[email protected]> -* Author Vincent Hanquez <[email protected]> +* Copyright 2009-2017 Citrix Ltd and other contributors * * 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
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 02/29] xl: update copyright information
Wei Liu writes ("[PATCH 02/29] xl: update copyright information"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 3/29 xl: remove inclusion of libxl_osdeps.h
In reply to Wei LiuThere is no reason for a client to include a private header from libxl. Remove the inclusion and define _GNU_SOURCE for {v,}asprintf in xl_cmdimpl.c.
--- tools/xl/xl.c | 2 -- tools/xl/xl_cmdimpl.c | 2 +- tools/xl/xl_sxp.c | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-)
tools/xl/xl.c +0 -2
@@ -12,8 +12,6 @@* GNU Lesser General Public License for more details. */ -#include "libxl_osdeps.h" -#include <stdio.h> #include <stdlib.h> #include <string.h>
tools/xl/xl_cmdimpl.c +1 -1
@@ -12,7 +12,7 @@* GNU Lesser General Public License for more details. */ -#include "libxl_osdeps.h" +#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h>
tools/xl/xl_sxp.c +0 -2
@@ -16,8 +16,6 @@* Legacy SXP output handling */ -#include "libxl_osdeps.h" -#include <stdlib.h> #include <inttypes.h>
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 03/29] xl: remove inclusion of libxl_osdeps.h
Wei Liu writes ("[PATCH 03/29] xl: remove inclusion of libxl_osdeps.h"):
Quoted 3 lines
There is no reason for a client to include a private header from libxl. Remove the inclusion and define
_GNU_SOURCEfor {v,}asprintf inxl_cmdimpl.c.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 4/29 xl: use <> variant to include Xen tools library headers
In reply to Wei LiuThey should be treated like any other libraries installed on the build host. Compiler options are set correctly to point to their locations.
--- tools/xl/xl.c | 6 +++--- tools/xl/xl.h | 2 +- tools/xl/xl_cmdimpl.c | 8 ++++---- tools/xl/xl_cmdtable.c | 2 +- tools/xl/xl_sxp.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-)
tools/xl/xl.c +3 -3
@@ -24,9 +24,9 @@#include <inttypes.h> #include <regex.h> -#include "libxl.h" -#include "libxl_utils.h" -#include "libxlutil.h" +#include <libxl.h> +#include <libxl_utils.h> +#include <libxlutil.h> #include "xl.h" xentoollog_logger_stdiostream *logger;
tools/xl/xl.h +1 -1
@@ -18,7 +18,7 @@#include <assert.h> #include "_paths.h" -#include "xentoollog.h" +#include <xentoollog.h> struct cmd_spec {char *cmd_name;
tools/xl/xl_cmdimpl.c +4 -4
@@ -34,10 +34,10 @@#include <limits.h> #include <xen/hvm/e820.h> -#include "libxl.h" -#include "libxl_utils.h" -#include "libxl_json.h" -#include "libxlutil.h" +#include <libxl.h> +#include <libxl_utils.h> +#include <libxl_json.h> +#include <libxlutil.h> #include "xl.h" /* For calls which return an errno on failure */
tools/xl/xl_cmdtable.c +1 -1
@@ -14,7 +14,7 @@#include <string.h> -#include "libxl.h" +#include <libxl.h> #include "xl.h" struct cmd_spec cmd_table[] = {
tools/xl/xl_sxp.c +2 -2
@@ -19,8 +19,8 @@#include <stdlib.h> #include <inttypes.h> -#include "libxl.h" -#include "libxl_utils.h" +#include <libxl.h> +#include <libxl_utils.h> #include "xl.h" /* In general you should not add new output to this function since it
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 04/29] xl: use <> variant to include Xen tools library headers
Wei Liu writes ("[PATCH 04/29] xl: use <> variant to include Xen tools library headers"):
Quoted 2 lines
They should be treated like any other libraries installed on the build host. Compiler options are set correctly to point to their locations.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 5/29 xl: generate _paths.h
In reply to Wei LiuIt is included by xl.h. Previously it was using _paths.h from some other place. We'd better generate one for xl as well.
--- .gitignore | 1 + tools/xl/Makefile | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-)
.gitignore +1 -0
@@ -380,6 +380,7 @@ tools/firmware/etherboot/ipxe/ tools/python/xen/lowlevel/xl/_pyxl_types.c tools/python/xen/lowlevel/xl/_pyxl_types.h tools/xenstore/xenstore-watch +tools/xl/_paths.h tools/xl/xl docs/txt/misc/*.txt
tools/xl/Makefile +6 -1
@@ -20,6 +20,11 @@ $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL) $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it. +genpath-target = $(call buildmakevars2header,_paths.h) +$(eval $(genpath-target)) + +$(XL_OBJS): _paths.h + .PHONY: all all: xl
@@ -35,7 +40,7 @@ install: all .PHONY: clean clean: - $(RM) -f *.o xl $(DEPS) + $(RM) -f *.o xl _paths.h $(DEPS) distclean: clean
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 05/29] xl: generate _paths.h
Wei Liu writes ("[PATCH 05/29] xl: generate _paths.h"):
Quoted 2 lines
It is included by
xl.h. Previously it was using_paths.hfrom some other place. We'd better generate one for xl as well.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 6/29 xl: remove trailing spaces in xl_cmdimpl.c
In reply to Wei Liu--- tools/xl/xl_cmdimpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/xl/xl_cmdimpl.c +2 -2
@@ -6732,7 +6732,7 @@ static int sched_vcpu_output(libxl_scheduler sched,return 0 ; } -/* +/* * <nothing> : List all domain params and sched params from all pools * -d [domid] : List domain params for domain * -d [domid] [params] : Set domain params for domain
@@ -8374,7 +8374,7 @@ int main_cpupoolcreate(int argc, char **argv) }/* We made it! */ rc =EXIT_SUCCESS ; - + out_cfg:xlu_cfg_destroy (config); out:
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 06/29] xl: remove trailing spaces in xl_cmdimpl.c
Wei Liu writes ("[PATCH 06/29] xl: remove trailing spaces in xl_cmdimpl.c"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 7/29 xl: lift a bunch of macros to xl_utils.h
In reply to Wei LiuWe're going to split xl_cmdimpl.c into multiple files. Lift the commonly used macros to xl_utils.h.
--- tools/xl/xl_cmdimpl.c | 104 +--------------------------------------- tools/xl/xl_utils.h | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 103 deletions(-) create mode 100644 tools/xl/xl_utils.h
tools/xl/xl_cmdimpl.c +1 -103
@@ -39,42 +39,7 @@#include <libxl_json.h> #include <libxlutil.h> #include "xl.h" - -/* For calls which return an errno on failure */ -#define CHK_ERRNOVAL ( call ) ({ \ - int chk_errnoval = (call); \ - if (chk_errnoval < 0) \ - abort(); \ - else if (chk_errnoval > 0) { \ - fprintf(stderr,"xl: fatal error: %s:%d: %s: %s\n", \ - __FILE__,__LINE__, strerror(chk_errnoval), #call); \ - exit(EXIT_FAILURE); \ - } \ - }) - -/* For calls which return -1 and set errno on failure */ -#define CHK_SYSCALL ( call ) ({ \ - if ((call) == -1) { \ - fprintf(stderr,"xl: fatal error: %s:%d: %s: %s\n", \ - __FILE__,__LINE__, strerror(errno), #call); \ - exit(EXIT_FAILURE); \ - } \ - }) - -#define MUST ( call ) ({ \ - int must_rc = (call); \ - if (must_rc < 0) { \ - fprintf(stderr,"xl: fatal error: %s:%d, rc=%d: %s\n", \ - __FILE__,__LINE__, must_rc, #call); \ - exit(EXIT_FAILURE); \ - } \ - }) - -#define STR_HAS_PREFIX ( a, b ) \ - ( strncmp(a, b, strlen(b)) == 0 ) -#define STR_SKIP_PREFIX ( a, b ) \ - ( STR_HAS_PREFIX(a, b) ? ((a) += strlen(b), 1) : 0 ) - +#include "xl_utils.h" int logfile =2 ;
@@ -83,7 +48,6 @@ libxl_ctx *ctx;xlchild children[child_max]; -#define INVALID_DOMID ~0static const char *common_domname;static int fd_lock =-1 ;
@@ -349,8 +313,6 @@ static char *xstrdup(const char *x) #define ARRAY_EXTEND_INIT_NODEVID(array,count,initfn) \ ARRAY_EXTEND_INIT__CORE((array),(count),(initfn), /* nothing */ ) -#define LOG(_f, _a...) dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a) -static void dolog (const char *file,int line,const char *func,char *fmt, ...) __attribute__((format (printf,4 ,5 )));
@@ -3332,10 +3294,6 @@ static int64_t parse_mem_size_kb(const char *mem)return kbytes; } -/* Must be last in list */ -#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}, \ - {0, 0, 0, 0} -/* * Callers should use SWITCH_FOREACH_OPT in preference to calling this * directly.
@@ -3378,66 +3336,6 @@ static int def_getopt(int argc, char * const argv[],return -1 ; } -/* -* Wraps def_getopt into a convenient loop+switch to process all -* arguments. This macro is intended to be called from main_XXX(). -* -* SWITCH_FOREACH_OPT(int *opt, "OPTS", -* const struct option *longopts, -* const char *commandname, -* int num_opts_req) { ... -* -* opt: pointer to an int variable, holds the current option -* during processing. -* OPTS: short options, as per getopt_long(3)'s optstring argument. -* do not include "h"; will be provided automatically -* longopts: long options, as per getopt_long(3)'s longopts argument. -* May be null. -* commandname: name of this command, for usage string. -* num_required_opts: number of non-option command line parameters -* which are required. -* -* In addition the calling context is expected to contain variables -* "argc" and "argv" in the conventional C-style: -* main(int argc, char **argv) -* manner. -* -* Callers should treat SWITCH_FOREACH_OPT as they would a switch -* statement over the value of `opt`. Each option given in `opts` (or -* `lopts`) should be handled by a case statement as if it were inside -* a switch statement. -* -* In addition to the options provided in opts the macro will handle -* the "help" option and enforce a minimum number of non-option -* command line pearameters as follows: -* -- if the user passes a -h or --help option. help will be printed, -* and the macro will cause the process to exit with code 0. -* -- if the user does not provided `num_required_opts` non-option -* arguments, the macro will cause the process to exit with code 2. -* -* Example: -* -* int main_foo(int argc, char **argv) { -* int opt; -* -* SWITCH_FOREACH_OPT(opt, "blah", NULL, "foo", 0) { -* case 'b': -* ... handle b option... -* break; -* case 'l': -* ... handle l option ... -* break; -* case etc etc... -* } -* ... do something useful with the options ... -* } -*/ -#define SWITCH_FOREACH_OPT (opt, opts, longopts, \ - commandname, num_required_opts) \ - while (((opt) = def_getopt(argc, argv, "h" opts, (longopts), \ - (commandname), (num_required_opts))) != -1) \ - switch (opt) -static int set_memory_max (uint32_t domid,const char *mem) {int64_t memorykb;
tools/xl/xl_utils.h new file +129 -0
129 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 07/29] xl: lift a bunch of macros to xl_utils.h
Wei Liu writes ("[PATCH 07/29] xl: lift a bunch of macros to xl_utils.h"):
Quoted 2 lines
We're going to split
xl_cmdimpl.cinto multiple files. Lift the commonly used macros toxl_utils.h.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 8/29 xl: move some helper functions to xl_utils.c
In reply to Wei LiuMove some commonly used functions to a new file. Prepend "x" to function names to stick to consistent naming scheme.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 343 +++++++++----------------------------------------- tools/xl/xl_utils.c | 258 +++++++++++++++++++++++++++++++++++++ tools/xl/xl_utils.h | 33 ++++- 4 files changed, 351 insertions(+), 285 deletions(-) create mode 100644 tools/xl/xl_utils.c
tools/xl/Makefile +1 -1
@@ -15,7 +15,7 @@ LDFLAGS += $(PTHREAD_LDFLAGS) CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow -XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o +XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL) $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
tools/xl/xl_cmdimpl.c +62 -281
745 lines not on this page · raw message
tools/xl/xl_utils.c new file +258 -0
258 lines not on this page · raw message
tools/xl/xl_utils.h +30 -3
@@ -15,6 +15,8 @@#ifndef XL_UTILS_H #define XL_UTILS_H +#include <getopt.h> +/* For calls which return an errno on failure */ #define CHK_ERRNOVAL ( call ) ({ \ int chk_errnoval = (call); \
@@ -55,7 +57,7 @@ #define LOG(_f, _a...) dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a)/* -* Wraps def_getopt into a convenient loop+switch to process all +* Wraps xdef_getopt into a convenient loop+switch to process all * arguments. This macro is intended to be called from main_XXX(). * * SWITCH_FOREACH_OPT(int *opt, "OPTS",
@@ -110,14 +112,39 @@*/ #define SWITCH_FOREACH_OPT (opt, opts, longopts, \ commandname, num_required_opts) \ - while (((opt) = def_getopt(argc, argv, "h" opts, (longopts), \ - (commandname), (num_required_opts))) != -1) \ + while (((opt) = xdef_getopt(argc, argv, "h" opts, (longopts), \ + (commandname), (num_required_opts))) != -1) \ switch (opt)/* Must be last in list */ #define COMMON_LONG_OPTS {"help", 0, 0, 'h'}, \ {0, 0, 0, 0} +int xdef_getopt (int argc,char *const argv[], +const char *optstring, +const struct option *longopts, +const char * helpstr,int reqargs); + +void dolog (const char *file,int line,const char *func,char *fmt, ...) + __attribute__((format (printf,4 ,5 ))); + +void xvasprintf (char **strp,const char *fmt,va_list ap) + __attribute__((format (printf,2 ,0 ))); + +void xasprintf (char **strp,const char *fmt, ...) + __attribute__((format (printf,2 ,3 ))); + +void *xmalloc (size_t sz); +void *xcalloc (size_t n,size_t sz); +void *xrealloc (void *ptr,size_t sz); +char *xstrdup (const char *x); +void xstring_realloc_append (char **accumulate,const char *more); + +void xflush_stream (FILE *fh); +uint32_t xfind_domain (const char *p) __attribute__((warn_unused_result)); + +void print_bitmap (uint8_t *map,int maplen,FILE *stream); +#endif /* XL_UTILS_H */ /*
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 08/29] xl: move some helper functions to xl_utils.c
Wei Liu writes ("[PATCH 08/29] xl: move some helper functions to xl_utils.c"):
Quoted 2 lines
Move some commonly used functions to a new file. Prepend "x" to function names to stick to consistent naming scheme.
The xfoo' naming scheme is a reference to xmalloc' et al, which conventionally crash the program on failure.
I don't think you need to add this to every function in xl. It is applicable only when there is an existing function which returns an error code, which is wrapped by one which never fails.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/1 xl: move some helper functions to xl_utils.c
Move some commonly used functions to a new file.
find_domain requires access to global variable common_domname. Make that non-static.
No functional change.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 221 +----------------------------------------- tools/xl/xl_utils.c | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++ tools/xl/xl_utils.h | 27 ++++++ 4 files changed, 287 insertions(+), 221 deletions(-) create mode 100644 tools/xl/xl_utils.c
tools/xl/Makefile +1 -1
@@ -15,7 +15,7 @@ LDFLAGS += $(PTHREAD_LDFLAGS) CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow -XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o +XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL) $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
tools/xl/xl_cmdimpl.c +1 -220
275 lines not on this page · raw message
tools/xl/xl_utils.c new file +258 -0
258 lines not on this page · raw message
tools/xl/xl_utils.h +27 -0
@@ -15,6 +15,8 @@#ifndef XL_UTILS_H #define XL_UTILS_H +#include <getopt.h> +/* For calls which return an errno on failure */ #define CHK_ERRNOVAL ( call ) ({ \ int chk_errnoval = (call); \
@@ -118,6 +120,31 @@#define COMMON_LONG_OPTS {"help", 0, 0, 'h'}, \ {0, 0, 0, 0} +int def_getopt (int argc,char *const argv[], +const char *optstring, +const struct option *longopts, +const char * helpstr,int reqargs); + +void dolog (const char *file,int line,const char *func,char *fmt, ...) + __attribute__((format (printf,4 ,5 ))); + +void xvasprintf (char **strp,const char *fmt,va_list ap) + __attribute__((format (printf,2 ,0 ))); + +void xasprintf (char **strp,const char *fmt, ...) + __attribute__((format (printf,2 ,3 ))); + +void *xmalloc (size_t sz); +void *xcalloc (size_t n,size_t sz); +void *xrealloc (void *ptr,size_t sz); +char *xstrdup (const char *x); +void string_realloc_append (char **accumulate,const char *more); + +void flush_stream (FILE *fh); +uint32_t find_domain (const char *p) __attribute__((warn_unused_result)); + +void print_bitmap (uint8_t *map,int maplen,FILE *stream); +#endif /* XL_UTILS_H */ /*
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH] xl: move some helper functions to xl_utils.c
Wei Liu writes ("[PATCH] xl: move some helper functions to xl_utils.c"):
Quoted 1 line
Move some commonly used functions to a new file.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 9/29 xl: split out tmem related code to xl_tmem.c
In reply to Wei Liu--- tools/xl/Makefile | 2 + tools/xl/xl_cmdimpl.c | 229 --------------------------------------------- tools/xl/xl_tmem.c | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 253 insertions(+), 229 deletions(-) create mode 100644 tools/xl/xl_tmem.c
tools/xl/Makefile +2 -0
@@ -16,6 +16,8 @@ CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o +XL_OBJS += xl_tmem.o + $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL) $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it.
tools/xl/xl_cmdimpl.c +0 -229
235 lines not on this page · raw message
tools/xl/xl_tmem.c new file +251 -0
251 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 09/29] xl: split out tmem related code to xl_tmem.c
Wei Liu writes ("[PATCH 09/29] xl: split out tmem related code to xl_tmem.c"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 10/29 xl: split out xl_parse.[ch]
In reply to Wei LiuMove all parsing code into xl_parse.c. Export the ones needed in xl_parse.h.
Some notable changes other than code movement:
1. rename cpurange_parse to parse_cpurange;
2. provide a function to return shutdown action name.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 2353 ++++--------------------------------------------- tools/xl/xl_parse.c | 2052 ++++++++++++++++++++++++++++++++++++++++++ tools/xl/xl_parse.h | 65 ++ 4 files changed, 2288 insertions(+), 2184 deletions(-) create mode 100644 tools/xl/xl_parse.c create mode 100644 tools/xl/xl_parse.h
tools/xl/Makefile +1 -1
@@ -16,7 +16,7 @@ CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o -XL_OBJS += xl_tmem.o +XL_OBJS += xl_tmem.o xl_parse.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +170 -2183
2,460 lines not on this page · raw message
tools/xl/xl_parse.c new file +2052 -0
532 lines not on this page · raw message
tools/xl/xl_parse.h new file +65 -0
65 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Part of the diff is not shown here. View the raw message.
Re: [PATCH 10/29] xl: split out xl_parse.[ch]
Wei Liu writes ("[PATCH 10/29] xl: split out xl_parse.[ch]"):
Quoted 3 lines
Some notable changes other than code movement:
1. renamecpurange_parsetoparse_cpurange;
2. provide a function to return shutdown action name.
Can you split that out so that I can review it separately from the code motion ?
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/3 xl: rename cpurange_parse to parse_cpurange
We want to consistently prefix functions to parse input with "parse_".
No functional change.
--- tools/xl/xl_cmdimpl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
tools/xl/xl_cmdimpl.c +8 -8
@@ -697,7 +697,7 @@ static int update_cpumap_range(const char *str, libxl_bitmap *cpumap)* single cpus or as eintire NUMA nodes) and turns it into the * corresponding libxl_bitmap (in cpumap). */ -static int cpurange_parse (const char *cpu,libxl_bitmap *cpumap) +static int parse_cpurange (const char *cpu,libxl_bitmap *cpumap) {char *ptr, *saveptr =NULL , *buf =xstrdup (cpu);int rc =0 ;
@@ -808,7 +808,7 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,exit (EXIT_FAILURE ); } -if (cpurange_parse (buf, &vcpu_affinity_array[j])) +if (parse_cpurange (buf, &vcpu_affinity_array[j]))exit (EXIT_FAILURE ); j++;
@@ -825,7 +825,7 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,exit (EXIT_FAILURE ); } -if (cpurange_parse (buf, &vcpu_affinity_array[0 ])) +if (parse_cpurange (buf, &vcpu_affinity_array[0 ]))exit (EXIT_FAILURE );for (i =1 ; i < b_info->max_vcpus; i++) {
@@ -5522,7 +5522,7 @@ int main_vcpupin(int argc, char **argv)*/ if (!strcmp (hard_str,"-" )) hard =NULL ; -else if (cpurange_parse (hard_str, hard)) +else if (parse_cpurange (hard_str, hard)) goto out;/* * Soft affinity is handled similarly. Only difference: we also want
@@ -5530,7 +5530,7 @@ int main_vcpupin(int argc, char **argv)*/ if (argc <= optind+3 || !strcmp (soft_str,"-" )) soft =NULL ; -else if (cpurange_parse (soft_str, soft)) +else if (parse_cpurange (soft_str, soft)) goto out;if (dryrun_only) {
@@ -7793,7 +7793,7 @@ int main_cpupoolcreate(int argc, char **argv) n_cpus++; } }else if (!xlu_cfg_get_string (config,"cpus" , &buf,0 )) { -if (cpurange_parse (buf, &cpumap)) +if (parse_cpurange (buf, &cpumap)) goto out_cfg; n_cpus =0 ;
@@ -7974,7 +7974,7 @@ int main_cpupoolcpuadd(int argc, char **argv) } pool = argv[optind++]; -if (cpurange_parse (argv[optind], &cpumap)) +if (parse_cpurange (argv[optind], &cpumap)) goto out; if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
@@ -8012,7 +8012,7 @@ int main_cpupoolcpuremove(int argc, char **argv) } pool = argv[optind++]; -if (cpurange_parse (argv[optind], &cpumap)) +if (parse_cpurange (argv[optind], &cpumap)) goto out; if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 2/3 xl: introduce a function to get shutdown action name
The array to map libxl_shutdown_action_to_shutdown to string is going to be moved to a dedicated file.
Provide a function to do the translation so that we don't need to make the array globally visible.
--- tools/xl/xl_cmdimpl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/xl/xl_cmdimpl.c +6 -1
@@ -101,6 +101,11 @@ static const char *action_on_shutdown_names[] = { [LIBXL_ACTION_ON_SHUTDOWN_SOFT_RESET] = "soft-reset", }; +static const char *get_action_on_shutdown_name (libxl_action_on_shutdown a) +{ +return action_on_shutdown_names[a]; +} +/* Optional data, in order: * 4 bytes uint32_t config file size * n bytes config file in Unix text file format
@@ -2442,7 +2447,7 @@ static domain_restart_type handle_domain_death(uint32_t *r_domid,LOG ("Action for shutdown reason code %d is %s" , event->u.domain_shutdown.shutdown_reason, - action_on_shutdown_names[action]); +get_action_on_shutdown_name (action));if (action ==LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_DESTROY || action ==LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_RESTART ) {char *corefile;
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 2/3] xl: introduce a function to get shutdown action name
Wei Liu writes ("[PATCH 2/3] xl: introduce a function to get shutdown action name"):
Quoted 2 lines
The array to map
libxl_shutdown_action_to_shutdownto string is going to be moved to a dedicated file.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 3/3 xl: split out xl_parse.[ch]
In reply to Wei LiuMove all parsing code into xl_parse.c. Export the ones needed in xl_parse.h.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 2346 ++++--------------------------------------------- tools/xl/xl_parse.c | 2052 ++++++++++++++++++++++++++++++++++++++++++ tools/xl/xl_parse.h | 65 ++ 4 files changed, 2282 insertions(+), 2183 deletions(-) create mode 100644 tools/xl/xl_parse.c create mode 100644 tools/xl/xl_parse.h
tools/xl/Makefile +1 -1
@@ -16,7 +16,7 @@ CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o -XL_OBJS += xl_tmem.o +XL_OBJS += xl_tmem.o xl_parse.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +164 -2182
2,417 lines not on this page · raw message
tools/xl/xl_parse.c new file +2052 -0
575 lines not on this page · raw message
tools/xl/xl_parse.h new file +65 -0
65 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Part of the diff is not shown here. View the raw message.
Re: [PATCH 3/3] xl: split out xl_parse.[ch]
Wei Liu writes ("[PATCH 3/3] xl: split out xl_parse.[ch]"):
Quoted 2 lines
Move all parsing code into
xl_parse.c. Export the ones needed inxl_parse.h.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 1/3] xl: rename cpurange_parse to parse_cpurange
In reply to Wei LiuWei Liu writes ("[PATCH 1/3] xl: rename cpurange_parse to parse_cpurange"):
Quoted 1 line
We want to consistently prefix functions to parse input with "
parse_".
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 11/29 xl: split out cpupool related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 592 ----------------------------------------------- tools/xl/xl_cpupool.c | 624 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 625 insertions(+), 593 deletions(-) create mode 100644 tools/xl/xl_cpupool.c
tools/xl/Makefile +1 -1
@@ -16,7 +16,7 @@ CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o -XL_OBJS += xl_tmem.o xl_parse.o +XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -592
598 lines not on this page · raw message
tools/xl/xl_cpupool.c new file +624 -0
624 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 11/29] xl: split out cpupool related code
Wei Liu writes ("[PATCH 11/29] xl: split out cpupool related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 12/29 xl: split out flask related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 119 --------------------------------------- tools/xl/xl_flask.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 120 deletions(-) create mode 100644 tools/xl/xl_flask.c
tools/xl/Makefile +1 -1
@@ -16,7 +16,7 @@ CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o -XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o +XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -119
125 lines not on this page · raw message
tools/xl/xl_flask.c new file +153 -0
153 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 12/29] xl: split out flask related code
Wei Liu writes ("[PATCH 12/29] xl: split out flask related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 13/29 xl: split out vtpm related code
In reply to Wei Liu--- tools/xl/Makefile | 1 + tools/xl/xl_cmdimpl.c | 122 ---------------------------------------- tools/xl/xl_vtpm.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 122 deletions(-) create mode 100644 tools/xl/xl_vtpm.c
tools/xl/Makefile +1 -0
@@ -17,6 +17,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o +XL_OBJS += xl_vtpm.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -122
128 lines not on this page · raw message
tools/xl/xl_vtpm.c new file +153 -0
153 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 13/29] xl: split out vtpm related code
Wei Liu writes ("[PATCH 13/29] xl: split out vtpm related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 14/29 xl: split out block related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_block.c | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++ tools/xl/xl_cmdimpl.c | 99 -------------------------------------- 3 files changed, 130 insertions(+), 100 deletions(-) create mode 100644 tools/xl/xl_block.c
tools/xl/Makefile +1 -1
@@ -17,7 +17,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o -XL_OBJS += xl_vtpm.o +XL_OBJS += xl_vtpm.o xl_block.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_block.c new file +129 -0
129 lines not on this page · raw message
tools/xl/xl_cmdimpl.c +0 -99
105 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 14/29] xl: split out block related code
Wei Liu writes ("[PATCH 14/29] xl: split out block related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 15/29 xl: split out network related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 140 ---------------------------------------- tools/xl/xl_nic.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 173 insertions(+), 141 deletions(-) create mode 100644 tools/xl/xl_nic.c
tools/xl/Makefile +1 -1
@@ -17,7 +17,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o -XL_OBJS += xl_vtpm.o xl_block.o +XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -140
152 lines not on this page · raw message
tools/xl/xl_nic.c new file +172 -0
172 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 15/29] xl: split out network related code
Wei Liu writes ("[PATCH 15/29] xl: split out network related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 16/29 xl: split out usb related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 190 ------------------------------------------ tools/xl/xl_usb.c | 222 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 223 insertions(+), 191 deletions(-) create mode 100644 tools/xl/xl_usb.c
tools/xl/Makefile +1 -1
@@ -17,7 +17,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o -XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o +XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -190
196 lines not on this page · raw message
tools/xl/xl_usb.c new file +222 -0
222 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 16/29] xl: split out usb related code
Wei Liu writes ("[PATCH 16/29] xl: split out usb related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 17/29 xl: split out scheduler related code
In reply to Wei Liu--- tools/xl/Makefile | 1 + tools/xl/xl_cmdimpl.c | 856 ------------------------------------------------ tools/xl/xl_sched.c | 888 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 889 insertions(+), 856 deletions(-) create mode 100644 tools/xl/xl_sched.c
tools/xl/Makefile +1 -0
@@ -18,6 +18,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o +XL_OBJS += xl_sched.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -856
862 lines not on this page · raw message
tools/xl/xl_sched.c new file +888 -0
888 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 17/29] xl: split out scheduler related code
Wei Liu writes ("[PATCH 17/29] xl: split out scheduler related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
BTW, for all of these code motion patches: it would be nice if the comment said `code motion only, apart from the obvious Makefile change' or something.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 18/29 xl: split out pci related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 247 -------------------------------------------- tools/xl/xl_pci.c | 278 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 279 insertions(+), 248 deletions(-) create mode 100644 tools/xl/xl_pci.c
tools/xl/Makefile +1 -1
@@ -18,7 +18,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o -XL_OBJS += xl_sched.o +XL_OBJS += xl_sched.o xl_pci.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -247
253 lines not on this page · raw message
tools/xl/xl_pci.c new file +278 -0
278 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 18/29] xl: split out pci related code
Wei Liu writes ("[PATCH 18/29] xl: split out pci related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 19/29 xl: split out vcpu related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 306 --------------------------------------------- tools/xl/xl_vcpu.c | 337 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 338 insertions(+), 307 deletions(-) create mode 100644 tools/xl/xl_vcpu.c
tools/xl/Makefile +1 -1
@@ -18,7 +18,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o -XL_OBJS += xl_sched.o xl_pci.o +XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -306
312 lines not on this page · raw message
tools/xl/xl_vcpu.c new file +337 -0
337 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 19/29] xl: split out vcpu related code
Wei Liu writes ("[PATCH 19/29] xl: split out vcpu related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 20/29 xl: split out cd related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cd.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++ tools/xl/xl_cmdimpl.c | 80 ----------------------------------- 3 files changed, 115 insertions(+), 81 deletions(-) create mode 100644 tools/xl/xl_cd.c
tools/xl/Makefile +1 -1
@@ -18,7 +18,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o -XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o +XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cd.c new file +114 -0
114 lines not on this page · raw message
tools/xl/xl_cmdimpl.c +0 -80
86 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 20/29] xl: split out cd related code
Wei Liu writes ("[PATCH 20/29] xl: split out cd related code"):
Quoted 4 lines
Signed-off-by Wei Liu <[email protected]>--- tools/xl/Makefile | 2 +- tools/xl/xl_cd.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++
Would you mind calling this libxl_cdrom.c' rather than _cd' ? The latter makes me think of chdir...
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 20/29] xl: split out cd related code
Quoted 8 lines · Ian Jackson
Wei Liu writes ("[PATCH 20/29] xl: split out cd related code"):
Quoted 4 lines
Signed-off-by Wei Liu <[email protected]>--- tools/xl/Makefile | 2 +- tools/xl/xl_cd.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++Would you mind calling this
libxl_cdrom.c' rather than_cd' ? The latter makes me think of chdir...
Can I have your ack if I rename it to libxl_cdrom.c?
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 20/29] xl: split out cd related code
Wei Liu writes ("Re: [PATCH 20/29] xl: split out cd related code"):
Quoted 11 lines · Ian Jackson
Quoted 8 lines
Wei Liu writes ("[PATCH 20/29] xl: split out cd related code"):
Quoted 4 lines
Signed-off-by Wei Liu <[email protected]>--- tools/xl/Makefile | 2 +- tools/xl/xl_cd.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++Would you mind calling this
libxl_cdrom.c' rather than_cd' ? The latter makes me think of chdir...Can I have your ack if I rename it to
libxl_cdrom.c?
Yes, indeed, that was the only reason I didn't ack it.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 20/29] xl: split out cd related code
Quoted 8 lines · Ian Jackson
Wei Liu writes ("Re: [PATCH 20/29] xl: split out cd related code"):
Quoted 7 lines · Ian Jackson
Quoted 6 lines
Wei Liu writes ("[PATCH 20/29] xl: split out cd related code"):
Quoted 4 lines
Signed-off-by Wei Liu <[email protected]>--- tools/xl/Makefile | 2 +- tools/xl/xl_cd.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Would you mind calling this
libxl_cdrom.c' rather than_cd' ? The latter makes me think of chdir...Can I have your ack if I rename it to
libxl_cdrom.c?Yes, indeed, that was the only reason I didn't ack it.
Thanks. I want to avoid reposting as much as possible because this series is really long and tedious.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 20/29] xl: split out cd related code
Wei Liu writes ("Re: [PATCH 20/29] xl: split out cd related code"):
Quoted 5 lines · Ian Jackson
Quoted 1 line
Yes, indeed, that was the only reason I didn't ack it.
Thanks. I want to avoid reposting as much as possible because this series is really long and tedious.
Indeed!
There were about three other patches that I had small comments on. If you want to repost just those, that would be fine by me.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 20/29] xl: split out cd related code
Quoted 4 lines · Ian Jackson
Wei Liu writes ("Re: [PATCH 20/29] xl: split out cd related code"):
Quoted 3 lines · Ian Jackson
Quoted 1 line
Yes, indeed, that was the only reason I didn't ack it.
Quoted 8 lines
Quoted 2 lines
Thanks. I want to avoid reposting as much as possible because this series is really long and tedious.
Indeed!
There were about three other patches that I had small comments on. If you want to repost just those, that would be fine by me.
Sure.
Quoted 1 line
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 21/29 xl: split out memory related code
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 136 ---------------------------------------- tools/xl/xl_mem.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 137 deletions(-) create mode 100644 tools/xl/xl_mem.c
tools/xl/Makefile +1 -1
@@ -18,7 +18,7 @@ CFLAGS_XL += -Wshadow XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o -XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o +XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -136
148 lines not on this page · raw message
tools/xl/xl_mem.c new file +167 -0
167 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 21/29] xl: split out memory related code
Wei Liu writes ("[PATCH 21/29] xl: split out memory related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 22/29 xl: split out psr related code
In reply to Wei Liu--- tools/xl/Makefile | 1 + tools/xl/xl_cmdimpl.c | 533 ----------------------------------------------- tools/xl/xl_psr.c | 567 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 568 insertions(+), 533 deletions(-) create mode 100644 tools/xl/xl_psr.c
tools/xl/Makefile +1 -0
@@ -19,6 +19,7 @@ XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o +XL_OBJS += xl_psr.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -533
539 lines not on this page · raw message
tools/xl/xl_psr.c new file +567 -0
567 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 22/29] xl: split out psr related code
Wei Liu writes ("[PATCH 22/29] xl: split out psr related code"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 23/29 xl: split out functions to print out information
In reply to Wei Liu--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 883 +---------------------------------------------- tools/xl/xl_info.c | 925 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 929 insertions(+), 881 deletions(-) create mode 100644 tools/xl/xl_info.c
tools/xl/Makefile +1 -1
@@ -19,7 +19,7 @@ XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o -XL_OBJS += xl_psr.o +XL_OBJS += xl_psr.o xl_info.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +3 -880
925 lines not on this page · raw message
tools/xl/xl_info.c new file +925 -0
925 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 23/29] xl: split out functions to print out information
Wei Liu writes ("[PATCH 23/29] xl: split out functions to print out information"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 24/29 xl: split out vnc and console related code
In reply to Wei LiuThe new file also contains code for channel, which is just a console in disguise.
Replace the call to vncviewer() with libxl_vncviewer_exec() directly in main_vncviewer.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 98 ------------------------------------- tools/xl/xl_console.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 99 deletions(-) create mode 100644 tools/xl/xl_console.c
tools/xl/Makefile +1 -1
@@ -19,7 +19,7 @@ XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o -XL_OBJS += xl_psr.o xl_info.o +XL_OBJS += xl_psr.o xl_info.o xl_console.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -98
110 lines not on this page · raw message
tools/xl/xl_console.c new file +130 -0
130 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 24/29] xl: split out vnc and console related code
Wei Liu writes ("[PATCH 24/29] xl: split out vnc and console related code"):
Quoted 5 lines
The new file also contains code for channel, which is just a console in disguise.
Replace the call to
vncviewer()withlibxl_vncviewer_exec()directly inmain_vncviewer.
Again, please separate out the non-code-motion change.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/2 xl: call libxl_vncviewer_exec in main_vncviewer
We will need to move main_vncviewer to a different file where it has no access to the helper vncviewer.
Call libxl_vncviewer_exec directly.
--- tools/xl/xl_cmdimpl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tools/xl/xl_cmdimpl.c +4 -3
@@ -1120,9 +1120,10 @@ int main_vncviewer(int argc, char **argv) domid =find_domain (argv[optind]); -if (vncviewer (domid, autopass)) -return EXIT_FAILURE ; -return EXIT_SUCCESS ; +libxl_vncviewer_exec (ctx, domid, autopass); +fprintf (stderr,"Unable to execute vncviewer\n" ); + +return EXIT_FAILURE ; }static void pause_domain (uint32_t domid)
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 2/2 xl: split out vnc and console related code
The new file also contains code for channel, which is just a console in disguise.
Replace the call to vncviewer() with libxl_vncviewer_exec() directly in main_vncviewer.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 99 -------------------------------------- tools/xl/xl_console.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 100 deletions(-) create mode 100644 tools/xl/xl_console.c
tools/xl/Makefile +1 -1
@@ -19,7 +19,7 @@ XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cdrom.o xl_mem.o -XL_OBJS += xl_psr.o xl_info.o +XL_OBJS += xl_psr.o xl_info.o xl_console.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -99
111 lines not on this page · raw message
tools/xl/xl_console.c new file +130 -0
130 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 2/2] xl: split out vnc and console related code
Wei Liu writes ("[PATCH 2/2] xl: split out vnc and console related code"):
Quoted 2 lines
The new file also contains code for channel, which is just a console in disguise.
Good. Except that...
Quoted 2 lines
Replace the call to
vncviewer()withlibxl_vncviewer_exec()directly inmain_vncviewer.
... you forgot to remove this from the commit message.
With that change,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 1/2] xl: call libxl_vncviewer_exec in main_vncviewer
In reply to Wei LiuWei Liu writes ("[PATCH 1/2] xl: call libxl_vncviewer_exec in main_vncviewer"):
Quoted 2 lines
We will need to move
main_vncviewerto a different file where it has no access to the helper vncviewer.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 25/29 xl: split out miscellaneous functions
In reply to Wei LiuA collections of functions that don't warrant their own files.
Moving main_devd there requires lifting do_daemonize to xl_utils.c.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 390 -------------------------------------------------- tools/xl/xl_misc.c | 355 +++++++++++++++++++++++++++++++++++++++++++++ tools/xl/xl_utils.c | 70 +++++++++ tools/xl/xl_utils.h | 1 + 5 files changed, 427 insertions(+), 391 deletions(-) create mode 100644 tools/xl/xl_misc.c
tools/xl/Makefile +1 -1
@@ -19,7 +19,7 @@ XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o -XL_OBJS += xl_psr.o xl_info.o xl_console.o +XL_OBJS += xl_psr.o xl_info.o xl_console.o xl_misc.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -390
420 lines not on this page · raw message
tools/xl/xl_misc.c new file +355 -0
355 lines not on this page · raw message
tools/xl/xl_utils.c +70 -0
84 lines not on this page · raw message
tools/xl/xl_utils.h +1 -0
@@ -145,6 +145,7 @@ uint32_t xfind_domain(const char *p) __attribute__((warn_unused_result));void print_bitmap (uint8_t *map,int maplen,FILE *stream); +int do_daemonize (char *name,const char *pidfile);#endif /* XL_UTILS_H */ /*
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 25/29] xl: split out miscellaneous functions
Wei Liu writes ("[PATCH 25/29] xl: split out miscellaneous functions"):
Quoted 3 lines
A collections of functions that don't warrant their own files.
Moving
main_devdthere requires liftingdo_daemonizetoxl_utils.c.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 26/29 xl: split out vm lifecycle control functions
In reply to Wei LiuIncluding create, reboot, shutdown, pause, unpause and destroy.
Lift a bunch of core data structures and function declarations to xl.h because they are needed in both xl_cmdimpl.c and xl_vmcontrol.c.
--- tools/xl/Makefile | 1 + tools/xl/xl.h | 67 +++ tools/xl/xl_cmdimpl.c | 1243 ----------------------------------------------- tools/xl/xl_vmcontrol.c | 1225 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1293 insertions(+), 1243 deletions(-) create mode 100644 tools/xl/xl_vmcontrol.c
tools/xl/Makefile +1 -0
@@ -20,6 +20,7 @@ XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o XL_OBJS += xl_psr.o xl_info.o xl_console.o xl_misc.o +XL_OBJS += xl_vmcontrol.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl.h +67 -0
73 lines not on this page · raw message
tools/xl/xl_cmdimpl.c +0 -1243
1,267 lines not on this page · raw message
tools/xl/xl_vmcontrol.c new file +1225 -0
1,225 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 26/29] xl: split out vm lifecycle control functions
Wei Liu writes ("[PATCH 26/29] xl: split out vm lifecycle control functions"):
Quoted 4 lines
Including create, reboot, shutdown, pause, unpause and destroy.
Lift a bunch of core data structures and function declarations to
xl.hbecause they are needed in bothxl_cmdimpl.candxl_vmcontrol.c.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 27/29 xl: split out save/restore related code
In reply to Wei LiuAdd some function declarations to xl.h because they are now needed in multiple files.
--- tools/xl/Makefile | 2 +- tools/xl/xl.h | 6 + tools/xl/xl_cmdimpl.c | 227 -------------------------------------- tools/xl/xl_saverestore.c | 273 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 280 insertions(+), 228 deletions(-) create mode 100644 tools/xl/xl_saverestore.c
tools/xl/Makefile +1 -1
@@ -20,7 +20,7 @@ XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o XL_OBJS += xl_psr.o xl_info.o xl_console.o xl_misc.o -XL_OBJS += xl_vmcontrol.o +XL_OBJS += xl_vmcontrol.o xl_saverestore.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl.h +6 -0
@@ -96,6 +96,12 @@ struct save_file_header {#define SAVEFILE_BYTEORDER_VALUE ((uint32_t)0x01020304UL) +void save_domain_core_begin (uint32_t domid, +const char *override_config_file, +uint8_t **config_data_r, +int *config_len_r); +void save_domain_core_writeconfig (int fd,const char *source, +const uint8_t *config_data,int config_len);/* * The xl process should always return either EXIT_SUCCESS or
tools/xl/xl_cmdimpl.c +0 -227
245 lines not on this page · raw message
tools/xl/xl_saverestore.c new file +273 -0
273 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 27/29] xl: split out save/restore related code
Wei Liu writes ("[PATCH 27/29] xl: split out save/restore related code"):
Quoted 2 lines
Add some function declarations to
xl.hbecause they are now needed in multiple files.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 28/29 xl: split out migration related code
In reply to Wei LiuInclude COLO / Remus code because they are built on top of the existing migration protocol.
--- tools/xl/Makefile | 2 +- tools/xl/xl_cmdimpl.c | 715 ----------------------------------------------- tools/xl/xl_migrate.c | 754 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 755 insertions(+), 716 deletions(-) create mode 100644 tools/xl/xl_migrate.c
tools/xl/Makefile +1 -1
@@ -20,7 +20,7 @@ XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o XL_OBJS += xl_psr.o xl_info.o xl_console.o xl_misc.o -XL_OBJS += xl_vmcontrol.o xl_saverestore.o +XL_OBJS += xl_vmcontrol.o xl_saverestore.o xl_migrate.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl_cmdimpl.c +0 -715
721 lines not on this page · raw message
tools/xl/xl_migrate.c new file +754 -0
754 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 28/29] xl: split out migration related code
Wei Liu writes ("[PATCH 28/29] xl: split out migration related code"):
Quoted 2 lines
Include COLO / Remus code because they are built on top of the existing migration protocol.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 29/29 xl: merge xl_cmdimpl.c into xl.c
In reply to Wei LiuAfter splitting out all the meaty bits, xl_cmdimpl.c doesn't contain much. Merge the rest into xl.c and delete the file.
--- tools/xl/Makefile | 2 +- tools/xl/xl.c | 58 +++++++++++++++++++++++++++ tools/xl/xl_cmdimpl.c | 107 -------------------------------------------------- 3 files changed, 59 insertions(+), 108 deletions(-) delete mode 100644 tools/xl/xl_cmdimpl.c
tools/xl/Makefile +1 -1
@@ -15,7 +15,7 @@ LDFLAGS += $(PTHREAD_LDFLAGS) CFLAGS_XL += $(CFLAGS_libxenlight) CFLAGS_XL += -Wshadow -XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o xl_utils.o +XL_OBJS = xl.o xl_cmdtable.o xl_sxp.o xl_utils.o XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cd.o xl_mem.o
tools/xl/xl.c +58 -0
70 lines not on this page · raw message
tools/xl/xl_cmdimpl.c deleted +0 -107
107 lines not on this page · raw message
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 29/29] xl: merge xl_cmdimpl.c into xl.c
Wei Liu writes ("[PATCH 29/29] xl: merge xl_cmdimpl.c into xl.c"):
Quoted 2 lines
After splitting out all the meaty bits,
xl_cmdimpl.cdoesn't contain much. Merge the rest intoxl.cand delete the file.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel