Commit Graph
100 Commits
Author SHA1 Message Date
Wei Liu 3f0ae679f2 tools: remove blktap2 related code and documentation
Blktap2 is effectively dead code for a few years.

Notable changes in this patch:

0. Unhook blktap2 from build system
1. Now libxl no longer supports TAP disk backend, appropriate assertions
   are added and some code paths now return ERROR_FAIL
2. Tap is no longer a supported backend in doc
3. Remove relevant entries in MAINTAINERS

A patch to actually remove blktap2 directory will come later.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: George Dunlap <George.Dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-09-06 11:02:19 +01:00
Wei Liu b2f2ced591 tools/firmware: Rename bios.bin to seabios.bin
bios.bin as a name is far too generic.  Rename it to seabios.bin.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
[ wei: fix up conflict, rerun autogen.sh ]
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-09-05 11:53:16 +01:00
Wei Liu eb502cb30c libxl: update flex output files for DSA 3653-2
We updated flex output files in 4b314c89 ("libxl: update flex output
files") for DSA 3653-1 / CVE-2016-6354. But Debian security team
discovered the fix to flex was incomplete and issued DSA 3653-2. We need
to update our flex output files accordingly.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-09-05 11:53:16 +01:00
Wei Liu 158dd1bdca tools: delete gtraceview and gtracestat
There has not been any substantial update to them since 2011. My quick
check shows that they don't work.

Just delete them. It would be easy to resurrect them from git log should
people still need them.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-09-02 14:28:35 +01:00
Wei Liu db6c2264e6 xen: add a gcov Kconfig option
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-08-31 16:37:47 +01:00
Wei Liu dcf22aa0dc xen: fix gcov compilation
Currently enabling gcov in hypervisor won't build because although
26c9d03d ("gcov: Adding support for coverage information") claimed that
%.init.o files were excluded from applying compilation options, it was
in fact not true.

Fix that by filtering out the options correctly. Because the dependency
of stub.o in x86 EFI build can't be eliminated easily and we prefer a
generalised method going forward, we introduce nogcov-y to explicitly
mark objects that don't need to build with gcov support.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-31 16:37:37 +01:00
Wei Liu 0ebbfa4f69 arm64: use "b" to branch to start_xen
The cbz instruction has range limitation. When compiled with gcov
support the object is larger so cbz can't handle that anymore. The error
message is like:

aarch64-linux-gnu-ld    -EL  -T xen.lds -N prelink.o \
    /local/work/xen.git/xen/common/symbols-dummy.o -o /local/work/xen.git/xen/.xen-syms.0
prelink.o: In function `launch':
/local/work/xen.git/xen/arch/arm/arm64/head.S:602:(.text+0x408): relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `start_xen' defined in .init.text section in prelink.o

Use "b" instead.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
2016-08-31 16:37:23 +01:00
Wei Liu 8b53aa66e6 arm: acpi/boot.c is only used during initialisation
That file should contain code and data used during initialisation only.

Mark it as such in build system and correctly annotate enabled_cpus.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
2016-08-31 16:37:23 +01:00
Wei Liu 4b314c89be libxl: update flex output files
Libxl ships output files from flex (libxlu_*_l.{c,h}). We use the flex
shipped in Debian to generate those files. Debian just patched their
flex (DSA 3653-1) to fix CVE-2016-6354, which is a buffer overrun bug.

Note that libxl is _NOT_ vulnerable to that CVE. See below for Ian's
analysis to security@xen.

It would still be nice that we update our shipped flex output files to
avoid confusion.

===QUOTE===

The bug is that with input >16K[1] flex would usually fail to resize
the input buffer, and then overrun it.

I have read the code in libxlu_cfg_l.c to try to understand the
implications for libxl.

AFAICT
 - libxl always does config file reading _from the file_ itself, and
   provides flex with a string or buffer.
 - so we always call whatever_yy_scan_bytes, not any other flex setup
   function to set up a `buffer' (as flex calls it)
 - yy_scan_bytes calls yy_scan_buffer to set up the buffer
 - yy_scan_buffer sets b->yy_fill_buffer
 - The effect of this is that yy_get_next_buffer will always
   return early, rather than continuing on to the vulnerable code.

So I think libxl is not vulnerable, regardless of the contents of the
configuration file.

[1] the default buffer size, or whatever other buffer size is
configured (but we don't change it)

===ENDQUOTE===

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-30 14:14:53 +01:00
Wei Liu fb3cc17962 libxl: only return {OVMF,SEABIOS}_PATH if available
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-24 12:44:19 +01:00
Wei Liu ea27761b5d tools: only define {OVMF,SEABIOS}_PATH when they are enabled
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-24 12:43:49 +01:00
Wei Liu 94d3b9990b hvmloader: use bound checking in get_module_entry
Coverity complains:

overflow_before_widen: Potentially overflowing expression
info->nr_modules * 32U with type unsigned int (32 bits, unsigned) is
evaluated using 32-bit arithmetic, and then used in a context that
expects an expression of type uint64_t (64 bits, unsigned).

The overflow is unlikely to happen in reality because we only expect a
few modules.

Fix that by converting the check to use bound checking to placate
Coverity.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2016-08-22 14:20:19 +01:00
Wei Liu 80a59905fd hvmloader: correctly copy signature to info structures
The original code used sizeof(info->signature) as the size parameter for
memcpy, which was wrong.

Fix that by using structure assignment.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2016-08-22 14:20:09 +01:00
Wei Liu a55ad65d3a Config.mk: update mini-os commit
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-08-12 16:37:24 +01:00
Wei Liu 072e670997 libxc: use DPRINTF in xc_domain_dumpcore_via_callback
That line doesn't reveal much information to ordinary users.

Change that to debug output.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-11 15:40:38 +01:00
Wei Liu 8e370ef503 libxl: fix declaration of libxl_primary_console_exec_0x040700
Add missing "int".

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-08 16:12:29 +01:00
Wei Liu 0cd19069c8 xl: use xenconsole startup protocol
If user asks xl to automatically connect to console when creating a
guest, use the new startup protocol before trying to unpause domain so
that we don't lose any console output.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-08 11:44:32 +01:00
Wei Liu f2333d5f9f docs: document xenconsole startup protocol
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-08 11:42:34 +01:00
Wei Liu 731df78226 libxl: libxl_{primary_,}console_exec now take notify_fd argument
The new argument will be passed down to xenconsole process, which then
uses it to notify readiness.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-08 11:42:13 +01:00
Wei Liu 88502c075a libxl: factor out libxl__console_tty_path
No other user yet.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-08 11:41:40 +01:00
Wei Liu 373f99d2ea tools/console: introduce --start-notify-fd option for console client
The console client will write 0x00 to that fd before entering console
loop to indicate its readiness.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-08 11:41:27 +01:00
Wei Liu 9fc57406d5 tools/console: fix help string in client
There is no short '-t' option.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-08 11:39:05 +01:00
Wei Liu e125fb0e4f systemd: remove hard-coded pid file in xendriverdomain service
Per the discussion in [0], the hard-coded pid file can be removed
completely. Systemd has no trouble figuring out the pid of devd all by
itself.

[0]: https://lists.xen.org/archives/html/xen-devel/2016-07/msg01393.html

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-08-02 17:03:10 +01:00
Wei Liu 88d6145982 xsm: don't require configuring tools to build xen xsm blob
Starting from 08cffe66 ("xsm: add a default policy to .init.data") we
can attach a xsm policy blob to hypervisor. To build that policy blob
now hypervisor build system needs to enter tools directory.

The expectation for hypervisor and tools build systems is different. We
don't want xen build system to depend on configure but we want tools
build system to. That commit broke this expectation because it required
users to run configure before building hypervisor. This broke ARM build
because ARM developers normally build hypervisor and tools separately
(and possibly on different platforms). It can also break x86 if
developers don't run configure before building hypervisor with XSM on.

To fix it, move major part of tools/flask/policy/Makefile into
Makefile.common and create tools only Makefile to include that common
Makefile. Hypervisor Makefile will use Makefile.common to build xsm
policy.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Tested-by: Julien Grall <julien.grall@arm.com>
2016-08-01 09:06:07 +01:00
Wei Liu 368574c0b7 xenstore: add assertion in database dumping code
If memfile is NULL, the signal handler won't be installed, hence fopen
won't dereference NULL. Coverity is not smart enough to figure that out
unfortunately.

Add an assertion to prevent coverity from complaining.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:09:25 +01:00
Wei Liu 7d87d31d33 xenstore: send error earlier in do_mkdir
XenServer's coverity instance complains that a few lines below
create_node dereferences NULL if name == NULL. It however fails to
figure out that if node is NULL, errno won't be ENOENT, so do_mkdir
should have bailed before create_node.

That said, it would be good if we don't need to go through the hops.  We
can bail earlier if name is NULL.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:09:21 +01:00
Wei Liu df59218807 oxenstored: honour XEN_RUN_DIR
Move default the pid file under XEN_RUN_DIR. Note that it changes the
location from /var/run to /var/run/xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-07-20 16:08:28 +01:00
Wei Liu dedb221889 libxenstat: honour XEN_RUN_DIR
This is because libxl uses XEN_RUN_DIR to generate the socket path for
libxenstat while libxenstat itself uses hard-coded path, which is not
necessarily the same path as XEN_RUN_DIR.  The default configuration
happened to work because XEN_RUN_DIR defaulted to /var/run/xen, which
matched the hard-coded path.

We should make libxenstat use XEN_RUN_DIR so that it works with
non-default configuration.

Generate a _paths.h because it is required to make this change work.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:08:14 +01:00
Wei Liu 56f9010bfa hotplug/Linux: honour XEN_RUN_DIR
Store various PID files under XEN_RUN_DIR. Note that this change the
default location from /var/run to /var/run/xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:08:14 +01:00
Wei Liu e5be44cda8 hotplug/NetBSD: honour XEN_RUN_DIR
Store xldevd.pid under XEN_RUN_DIR. Note that this will change the
default location from /var/run to /var/run/xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:08:12 +01:00
Wei Liu 3c99c5e4c4 hotplug/FreeBSD: honour XEN_RUN_DIR
Store xldevd.pid under XEN_RUN_DIR. Note that the default location would
change from /var/run to /var/run/xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:07:28 +01:00
Wei Liu 6f35915ec0 tools/helper: honour XEN_RUN_DIR in init-xenstore-domain.c
Place the PID file under XEN_RUN_DIR. Note that this change the default
location from /var/run to /var/run/xen.

Generate a _paths.h as that is required to make this change work.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:07:24 +01:00
Wei Liu 51a0ae4fd5 xenconsoled: honour XEN_RUN_DIR
Place the PID file under XEN_RUN_DIR by default. Note this change the
default location from /var/run to /var/run/xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 16:07:10 +01:00
Wei Liu 3e71c27052 xl: rename variable pause to pause_after_migration
Gcc 4.4.4 complained that the "pause" variable introduced in 22b430e0
("xl: add option to leave domain paused after migration") shadowed
pause(2) declaration in unistd.h.

Rename "pause" to "pause_after_migration" to fix this issue.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-20 13:21:58 +01:00
Wei Liu 2f7c3c94e9 libxl: constify src parameter of libxl_nocpuid.c:libxl_cpuid_policy_list_copy
In 11316d31 ("libxl: constify copy and length calculation functions") I
forgot to take care of libxl_nocpuid.c which also contains an
implementation of libxl_cpuid_policy_list_copy. That broke ARM build.

Fix it by constifying the src parameter.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-13 14:24:02 +01:00
Wei Liu 56bac262e0 libxl: only issue cpu-add call to QEMU for not present CPU
Calculate the final bitmap for CPUs to add to avoid having annoying
error messages complaining those CPUs are already present. Example
message is like (wrapped):

libxl: error: libxl_qmp.c:287:qmp_handle_error_response: received an
error message from QMP server: Unable to add CPU: 0, it already exists

We can also properly handle error from QMP now.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-12 12:49:41 +01:00
Wei Liu 01f3193e2e libxl: update vcpus bitmap in retrieved guest config
... because the available vcpu bitmap can change during domain life time
due to cpu hotplug and unplug.

For QEMU upstream, we interrogate QEMU for the number of vcpus. For
others, we look directly into xenstore for information.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-12 12:49:41 +01:00
Wei Liu 324bd8f5dc libxl: introduce libxl__qmp_query_cpus
It interrogates QEMU for CPUs and update the bitmap accordingly.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-12 12:49:41 +01:00
Wei Liu b173750d2b libxl: libxl_domain_need_memory shouldn't modify b_info
This function is used to return the memory needed for a guest. It's not
in a position to modify the b_info passed in (note the _setdefault
function).

Constify the passed in b_info, use a copy to do the calculation. Mark
the change in API in libxl.h.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-12 12:49:41 +01:00
Wei Liu 11316d31d6 libxl: constify copy and length calculation functions
These functions are not supposed to modify the passed in parameters.
Reflect that in function declarations.

Mark the change in APIs in libxl.h

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-12 12:49:41 +01:00
Wei Liu db59dbc46e libxl/netbsd: check num_exec in hotplug function
This basically replicates the same logic in libxl_linux.c but with one
change -- only test num_exec == 0 in nic hotplug case because NetBSD let
QEMU call a script itself. Without this patch libxl will loop
indefinitely trying to execute hotplug script.

Reported-by: John Nemeth <jnemeth@cue.bc.ca>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2016-07-06 18:22:53 +01:00
Wei Liu 33c18b709a libxl: debug output for args and env when invoking hotplug script
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-07-06 18:21:37 +01:00
Wei Liu a6288d5bb8 xen: make available hvm_fep to non-debug build as well
Originally hvm_fep was guarded by NDEBUG, which means it was only
available to debug builds.

However there is value in having it in non-debug builds as well. Users
can use it to run tests in a setup that replicates a production
environment.

Make it clear with a sync_console style warning that this option can't
be used in production setup. Update command line documentation
accordingly. Finally mark Xen as tainted when this feature is used.

Add a kconfig option under x86 to configure hvm_fep.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-23 17:00:33 +01:00
Wei Liu 509019f42d xen/console: use warning infrastructure for sync console warning
Move the warning text to a static variable and marked that as initconst
data. Call warning_add in console_init_preirq. Finally remove all
unused bits.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-06-23 16:57:14 +01:00
Wei Liu ee3fd57acd xen: add warning infrastructure
Use an array to keep track of warning text, provide a function to add
warning text to track.  Print warnings (if any) in console_endboot.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-06-23 16:57:14 +01:00
Wei Liu 0630892faf libxl: fix an error path that uses uninitialised rc in libxl_set_memory_target
ecdc6fd8 ("libxl: Fix libxl_set_memory_target return value") failed to
initialised rc in one failure path. Fix it in this patch.

Also fixed an indentation issue while I was there.

CID: 1362695

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-20 14:47:02 +01:00
Wei Liu 9e5e193046 xen/kernel: document 'C' in print_tainted
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2016-06-20 14:25:12 +01:00
Wei Liu 67a5ab831d oxenstored: honour XEN_RUN_STORED in systemd C stub
Generate a _paths.h for that and add proper dependency.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 44e6ba4b33 oxenstored: honour XEN_RUN_STORED and XEN_CONFIG_DIR
Only contain changes to ocaml source code. C stub files will be handled
separately.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 0e3e738605 ocaml/libxs: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 33bcbdb330 ocaml/libxs: generate a paths.ml
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 5994480f20 hotplug/FreeBSD: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu 153db2f820 libxenstore: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu ba53cec7cd hotplug/Linux: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu 7d82f09765 build: introduce XEN_RUN_STORED
It defaults to /var/run/xenstored. It will be used later to remove some
hard-coded paths in tree. There should be no visible change to default
configuration.

Install and remove it in respective Makefile targets.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu d7f64ff4e0 docs: honour XEN_DUMP_DIR
Use configure to generate xl.cfg and xl manpage. Add the generated files
to gitignore.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu d337764d9b tools: bump some library version numbers to 4.8
It is a pretty safe thing to do and would avoid accidentally overwrite
the old libraries when doing development.

Bump all version numbers that are currently 4.7 to 4.8. That includes
libxc, libxlu, libxl and libvchan.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 18:32:10 +01:00
Wei Liu 9b394b7eff xl: remus/colo: only initialise ha variable when necessary
The original code is wrong because the common case is no HA enabled.  It
should have been set to NULL first.

Instead of setting ha to NULL, move it to the scope where it is used.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 16:22:15 +01:00
Wei Liu fcf3f57eee tools: remove hard-coded /var/lib/xen in Makefile
Now all conversations are done, remove the hard-coded paths.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 938b2b4033 libxl: honour XEN_LIB_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
;wq
2016-06-14 14:31:27 +01:00
Wei Liu 540cecf0cf hotplug/Linux: honour XEN_LIB_DIR
Use configure to generate sysconfig.xendomains file.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 102ddb11f2 tools: install and remove XEN_LIB_DIR in Makefile
The intention of using wild card in uninstall target is to remove both
xen and xenstored directories. Change that to two runes that explicitly
remove each of those directories.

Note that the runes that use hard-coded paths are kept for now to keep
the tree bisectable as I replace hard-coded paths component by
component.  Those runes will be removed eventually.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 15f1a11d66 build: introduce and export XEN_LIB_DIR
This variable defaults to /var/lib/xen. It will be used to substitute
various hard-coded paths in tools.

The new variable points to $localstatedir/lib/xen, which defaults to
/var/lib/xen, so there is no change in default configuration.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu a4fa83e568 oxenstored: honour XEN_LOG_DIR defined by configure
We generate a corresponding constant (in lower case) in paths.ml. Use
that in source code to get rid of hard-coded path.

Note that with this patch the default location for xenstored*.log is
changed from /var/log to /var/log/xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-14 14:31:27 +01:00
Wei Liu 6b007a6df1 oxenstored: generate a paths module
That file includes all paths generated by configure. It will be used to
get rid of hard-coded paths in code.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-14 14:31:27 +01:00
Wei Liu c84a1fa2e6 oxenstored: honour XEN_{LOG,RUN}_DIR in oxenstored.conf
Generate oxenstored.conf with configure. This involves modifying
tools/configure.ac and rerun autogen.sh.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 10055f661e libxl: log file name in failure in libxl__create_qemu_logfile
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 3148bebbf0 libxl: rename a field in libxl__domain_create_state
The libxl__stub_dm_spawn_state field in libxl__domain_create_state was
named dmss. That was inconsistent with how things were named (usually
acronym) and there was already libxl__dm_spawn_state named dmss in other
places.

Change dmss to sdss and fix up all sites that reference this field.  No
functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 5e6e8546cf libxl: linux hotplug: clean up get_hotplug_env
That get_hotplug_env function is called for both block and nic. Move
some nic specific code out of common code to appropriate place.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:26 +01:00
Wei Liu 1cf3fa32da libxl: add emacs block to libxl_linux.c
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:26 +01:00
Wei Liu 3bf5fdf8d8 libxl: honour XEN_LOG_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:52:37 +01:00
Wei Liu 32b7c63889 hotplug/NetBSD: honour XEN_{LOG,RUN}_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2016-06-10 10:52:20 +01:00
Wei Liu a666e1ce86 hotplug/Linux: honour XEN_LOG_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2016-06-10 10:52:16 +01:00
Wei Liu 7c64c92a4f hotplug/FreeBSD: honour XEN_{LOG,RUN}_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2016-06-10 10:51:51 +01:00
Wei Liu de2807b957 libxc: honour XEN_LOG_DIR in xc_dom_core.c
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:51:38 +01:00
Wei Liu 6c5f6f8a62 xenbackendd: honour XEN_{RUN,LOG}_DIR
Also added a gitignore entry for xenbackendd binary while I was there.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:51:31 +01:00
Wei Liu 15574254d2 xenconsoled: honour XEN_LOG_DIR and remove hard-coded path
Make a _paths.h for xenconsoled as well and use that to generate a
default path for log file directory.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:51:11 +01:00
Wei Liu 8a80688a23 tools: install XEN_{LOG,RUN}_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:50:27 +01:00
Wei Liu baca90434b Config.mk: add XEN_LOG_DIR to BUILD_MAKE_VARS
... so that it can be turned into shell environment variable and
exported to header files.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-06-10 10:49:42 +01:00
Wei Liu e2532e9207 Run autogen.sh
In 936a7a54 ("Open Xen 4.8-unstable), output of autogen.sh was not
included. The configure scripts still referred to 4.7.

Run autogen.sh and commit the result.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-09 16:31:56 +01:00
Wei Liu 74a7ec196f Revert "libxl: No emulated disk driver for xvdX disk"
This reverts c0c099d157.

That commit causes regression on the semantics of our diskspec.
See [0] for more information.

[0] http://lists.xen.org/archives/html/xen-devel/2016-05/msg02876.html

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-08 16:53:45 +01:00
Wei Liu 5ff371e9d8 Revert "x86/mce: handle reserved domain ID in XEN_MC_msrinject"
This reverts commit 55dc7f6126.

The get_maintainer.pl script showed Jan as the maintainer so I pushed
this patch. But in fact according to MAINTAINERS file, he's not.  Revert
this patch and wait until a maintainer acks it.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-05-27 17:18:47 +01:00
Wei Liu b0d409d9c4 libxl: set XEN_QEMU_CONSOLE_LIMIT for QEMU
XSA-180 provides a patch to QEMU to bodge QEMU logging issue. We
explicitly set the limit in libxl for 4.7.

Introduce a function for setting the environment variable and call it in
the right places.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-26 17:22:12 +01:00
Wei Liu 8478c9409a docs: update xl manpage about {block,network}-attach command
State that only attaching PV interface is supported.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-25 16:14:18 +01:00
Wei Liu 80703daf3e xl: use xstrdup in cpurange_parse
This ensures buf is always valid when it is passed to strtok_r.

CID: 1291936

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-25 14:42:35 +01:00
Wei Liu 116d8bab9b tools: bump library version numbers
The following libraries are checked:
1. libxc, version number bumped
2. libxl, version number bumped
3. libxlu, no development in 4.7 cycle, but depends on libxl, version
   number bumped
4. libs/*, new in 4.7 cycle, version numbers not bumped
5. libxenstore, no development in 4.7 cycle, version number not bumped
6. libxenstat, no development in 4.7 cycle, version number not bumped
7. libvchan, depends on  xengnttab library, API changed, version number
   bumped

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-24 16:26:37 +01:00
Wei Liu 983aae0b59 Config.mk: non-debug build by default
Set debug ?= n in preparation for late RCs and eventual release.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-05-23 17:17:57 +01:00
Wei Liu 32e9d0f065 libxl: nic type defaults to vif in hotplug for hvm guest
We don't support plugging in emulated nic to a HVM guest.

The "update_json" flag is only set when doing hotplug, so use that as an
indicator in libxl__device_nic_add. The new hotplug flag to _setdefault
function should be false in all other locations.

This then requires saving nic type in JSON file, because we don't want
the receiving end to recalculate the nic type.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-23 14:46:34 +01:00
Wei Liu ccf4a5e6db Revert "Config.mk: update ovmf changeset"
This reverts commit 1542efcea8. It fails
consistently on our Debian HVM test when the VM has more than 4G of
memory.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-05-23 11:13:07 +01:00
Wei Liu a396c2549e libxl: consolidate casting to xc psr type to a function
In commit 31268fea (libxl: fix passing the type argument to xc_psr_*),
casting to xc psr type was done at each call site.

This patch consolidates casting into a function to avoid casting at each
conversion point. Each call site remains more type safe.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-19 12:49:59 +01:00
Wei Liu 1542efcea8 Config.mk: update ovmf changeset
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-05-18 11:48:25 +01:00
Wei Liu fcab4cec98 Config.mk: update mini-os changeset
There is one commit pulled in:
   lib/sys.c: enclose file_types in define guards

This is required to fix stubdom build on Arch Linux.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-05-15 16:20:02 +01:00
Wei Liu 75529048f4 blktap2: initialise buf in qcow2raw.c:main
Gcc complains:

qcow2raw.c: In function ‘main’:
qcow2raw.c:387:17: error: ‘buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    treq.buf     = buf;
                 ^

But buf is a valid buffer allocated by posix_memalign at that point.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-06 15:50:33 +01:00
Wei Liu 7e2a1f9402 blktap2: initialise buf to NULL in img2qcow.c:main
Gcc complains:

qcow2raw.c: In function ‘main’:
qcow2raw.c:387:17: error: ‘buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    treq.buf     = buf;
                 ^

But at the point of that assignment, buf is a valid buffer allocated by
posix_memalign and filled in by read.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-06 15:50:28 +01:00
Wei Liu 01120b223a blktap2: initialise buf in vhd_util_check_footer
Gcc complains:

vhd-util-check.c: In function ‘vhd_util_check_footer’:
vhd-util-check.c:413:2: error: ‘buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  memcpy(&backup, buf, sizeof(backup));

In fact buf is initialised a few lines above.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-06 15:50:23 +01:00
Wei Liu 0b5e769ae3 rombios/tcgbios: initialise logdataptr in HashLogEvent32
Gcc complains:

tcgbios.c: In function ‘HashLogEvent32’:
tcgbios.c:1131:10: error: ‘logdataptr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    entry = tcpa_extend_acpi_log(logdataptr);

It fails to figure out when logdataptr is used it is always initialised
in a if block a few line above.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-06 15:50:20 +01:00
Wei Liu 1d97ced2a0 rombios/tcgbios: initialise entry in HashLogEvent32
Gcc complains:

tcgbios.c:1142:22: error: ‘entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    hleo->eventnumber = entry;

It fails to figure out if entry is used it is always initialised in
previous if block.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-06 15:50:15 +01:00
Wei Liu bdb2a56104 rombios/tcgbios: initialise size in tcpa_extend_acpi_log
Gcc complains:

tcgbios.c:362:3: error: ‘size’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   memcpy((char *)lasa_last, (char *)entry_ptr, size);

It fails to figure out if size is used in memcpy it is always initialised.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-06 15:50:06 +01:00
Wei Liu 68a003ef43 Config.mk: update mini-os revision
This is only one commit:
    build: change MINI-OS_ROOT to MINIOS_ROOT

This change is required to fix stubdom build on Ubuntu 16.04.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2016-05-04 11:57:31 +01:00
Wei Liu 7f62212d99 tools: xen-xsplice.c: fix length parameter of memset in list_func
The length expression should be the same one used in malloc.

CID: 1358947

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
2016-05-02 10:21:35 +01:00