aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* tools: memshrtool: tool to test and exercise the sharing subsystemAndres Lagar-Cavilla2012-01-272-0/+191
| | | | | | | | | | | | This is demo code meant to showcase how to perform sharing operations. It is useful for testing. [ Added appropriate lines to .hgignore and .gitignore -iwj ] Signed-off-by: Adin Scannell <adin@scannell.ca> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl_qmp: fix qmp_next to cope with multiple lines read in a single bufferStefano Stabellini2012-01-271-3/+4
| | | | | | | | qmp_next doesn't handle multiple lines read together in a single buffer correctly at the moment. This patch fixes it. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: fix mutex initializationRoger Pau Monne2012-01-273-5/+33
| | | | | | | | | The macro PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not defined on NetBSD, so define mutex attributes manually. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: fix upstream qemu binary name to what we actually installIan Campbell2012-01-271-1/+1
| | | | | | | Binary is always qemu-system-i386 even for a 64 bit build. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Convert to asynchronous: device removalIan Jackson2012-01-276-139/+92
| | | | | | | | | | | | | Convert libxl_FOO_device_remove, and the function which does the bulk of the work, libxl__device_remove, to the new async ops scheme. Adjust all callers. Also remove libxl__wait_for_device_state which is now obsolete. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Introduce libxl__ev_devstateIan Jackson2012-01-272-0/+116
| | | | | | | | | | Provide a new-style asynchronous facility for waiting for device states on xenbus. This will replace libxl__wait_for_device_state, after the callers have been updated in later patches. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: New convenience macro CONTAINER_OFIan Jackson2012-01-271-0/+29
| | | | | | | | | | | | | Provide a convenient and type-safe wrapper which does the correct dance to subtract offsetof. This is very similar to the "container_of" macro in the Linux kernel, but it has an additional feature that instead of the type argument you may also pass an expression of that type; this makes initialising a variable with CONTAINER_OF easier. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Asynchronous/long-running operation infrastructureIan Jackson2012-01-274-0/+352
| | | | | | | | | | | | | Provide a new set of machinery for writing public libxl functions which may take a long time. The application gets to decide whether they want the function to be synchronous, or whether they'd prefer to get a callback, or an event, when the operation is complete. User(s) of this machinery will be introduced in later patch(es). Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Permit multithreaded event waitingIan Jackson2012-01-273-46/+218
| | | | | | | | | | | | | | | | | | | | | Previously, the context would be locked whenever we were waiting in libxl's own call to poll (waiting for operating system events). This would mean that multiple simultaneous calls to libxl_event_wait in different threads with different parameters would not work properly. If we simply unlock the context, it would be possible for another thread to discover the occurrence of the event we were waiting for, without us even waking up, and we would remain in poll. So we need a way to wake up other threads: a pipe, one for each thread in poll. We also need to move some variables from globals in the ctx to be per-polling-thread. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: introduce libxl_fd_set_nonblock, rationalise _cloexecIan Jackson2012-01-274-10/+36
| | | | | | | | | | | | | | | | | | | | We want a function for setting fds to nonblocking, so introduce one. This is a very similar requirement to that for libxl_fd_set_cloexec, so make it common with that. While we're at it, fix a few deficiences that make this latter function less desirable than it could be: * Change the return from 0/-1 (like a syscall) to a libxl error code * Take a boolean parameter for turning the flag on and off * Log on error (and so, take a ctx for this purpose) Change callers of libxl_fd_set_cloexec to notice errors. (Although, such errors are highly unlikely.) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: New event generation APIIan Jackson2012-01-278-276/+927
| | | | | | | | | | | | | | | | | | | | | | | | Replace the existing API for retrieving high-level events (events about domains, etc.) from libxl with a new one. This changes the definition and semantics of the `libxl_event' structure, and replaces the calls for obtaining information about domain death and disk eject events. This is an incompatible change, sorry. The alternative was to try to provide both the previous horrid API and the new one, and would also involve never using the name `libxl_event' for the new interface. The new "libxl_event" structure is blacklisted in the ocaml bindings for two reasons: - It has a field name "type" (which is a keyword in ocaml); the ocaml idl generator should massage this field name on output, to "type_" perhaps. - The ocaml idl generator does not support KeyedUnion. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* ocaml, libxl: support "private" fieldsIan Jackson2012-01-271-0/+8
| | | | | | | | | | | | | The changeset 24378:b4365e2c2595 libxl: idl: support new "private" type attribute is not complete. Actually using this feature does not work because the ocaml idl generator does not know about it. So add that support. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: New API for providing OS events to libxlIan Jackson2012-01-276-3/+1267
| | | | | | | | | | | | | | | | | | We provide a new set of functions and related structures libxl_osevent_* which are to be used by event-driven applications to receive information from libxl about which fds libxl is interested in, and what timeouts libxl is waiting for, and to pass back to libxl information about which fds are readable/writeable etc., and which timeouts have occurred. Ie, low-level events. In this patch, this new machinery is still all unused. Callers will appear in the next patch in the series, which introduces a new API for applications to receive high-level events about actual domains etc. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xl: fix a couple of memory leaksIan Jackson2012-01-272-1/+3
| | | | | | | | | | | * dolog leaked the log message (!) * main() leaked the config_data (perhaps a false positive from valgrind, but it's nicer to tidy it up). Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* tools: xencommons init script: Fix setting XENSTORED_ROOTDIRJim Fehlig2012-01-261-1/+1
| | | | | | | | | Due to a logic bug, XENSTORED_ROOTDIR was not being set to default value when zero length. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: fix parse_backend_path and device_backend_path to be mutualRoger Pau Monne2012-01-261-4/+3
| | | | | | | | | | | Currently if libxl__parse_backend_path is used and then you try to get the original path again with libxl__device_backend_path the result is wrong. This patch fixes the issue, so transformation from path to libxl__device and back is reciprocal. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Fix build.Tim Deegan2012-01-261-1/+1
| | | | | | | Bring xc_mem_paging.c in line with other users of munlock in libxc. Otherwise it trips over -Werror=unused-value Signed-off-by: Tim Deegan <tim@xen.org>
* Tools: Add a sharing command to xl for information about shared pagesAndres Lagar-Cavilla2012-01-265-0/+76
| | | | | | | | | | | Also add the global sharing statistics to the libxl physinfo. This is a slight departure from libxc, but there's no reason libxl physinfo can't include extra bits of useful and relevant information. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Tools: Expose to libxc the total number of shared frames and space savedAndres Lagar-Cavilla2012-01-262-0/+27
| | | | | | Signed-off-by: Adin Scannell <adin@scannell.ca> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Tim Deegan <tim@xen.org>
* Update memshr API and toolsAndres Lagar-Cavilla2012-01-268-38/+139
| | | | | | | | | | | | | | | | | | | | | | | This patch is the folded version of API updates, along with the associated tool changes to ensure that the build is always consistent. API updates: - The source domain in the sharing calls is no longer assumed to be dom0. - Previously, the mem sharing code would return an opaque handle to index shared pages (and nominees) in its global hash table. By removing the hash table, the handle becomes a version, to avoid sharing a stale version of a page. Thus, libxc wrappers and tools need to be updated to recall the share functions with the information needed to fetch the page (which they readily have). Tool updates: The only (in-tree, that we know of) consumer of the mem sharing API is the memshr tool. This is updated to use the new API. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* tools/libxc: fix error handling in xc_mem_paging_loadOlaf Hering2012-01-261-5/+10
| | | | | | | | | | | | | | xc_mem_paging_load() does not pass errors in errno and the actual errno from xc_mem_event_control() is overwritten by munlock(). xenpaging_populate_page() needs to check errno, but with the switch to xc_mem_paging_load() it could not receive ENOMEM anymore. Update xc_mem_paging_load() to return -1 and preserve errno during munlock(). Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Keir Fraser <keir@xen.org>
* libxl: rename is_assigned to is_pcidev_in_arrayDoug Magee2012-01-241-4/+4
| | | | | | | | | | | All this function does is check to see if a device is in an array of pcidevs passed by the caller. The function name can be misleading if ever used to check against a list of devices other than those assigned to a domain. Signed-off-by: Doug Magee <djmagee@mageenet.net> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: Add missing trigger for the xl trigger cmd.Jean Guyader2012-01-241-1/+1
| | | | | | | | Add s3resume trigger in the usage of the xl trigger cmd. Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: remove _libxl_json_internal.h from libxl_json.hIan Campbell2012-01-242-2/+3
| | | | | | | | | | libxl_json.h is intended as a user-includable header for applications which would like to use libyajl directly with libxl types. It should not expose libxl internals. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: use new qemu at the location where xen-unstable installs it2012-01-241-1/+1
| | | | | | | From: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* Clone and build Seabios by default2012-01-243-2/+93
| | | | | | | | From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* Clone and build upstream Qemu by default2012-01-241-0/+44
| | | | | | | From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* move the call to xen-setup after libxc and xenstore are built2012-01-241-4/+5
| | | | | | | | | | | From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Move the call to xen-setup, the wrapper script to configure qemu-xen-traditional, right before building qemu-xen-traditional and after libxc and xenstore are already built. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* Rename ioemu-dir as qemu-xen-traditional-dir2012-01-241-13/+13
| | | | | | | From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* Introduce git-checkout.sh2012-01-241-16/+4
| | | | | | | | | | From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Introduce a script to perform git checkout on an external git tree; use git-checkout.sh in ioemu-dir-find. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libelf-loader: introduce elf_load_imageStefano Stabellini2012-01-232-3/+10
| | | | | | | | | | | | | | Implement a new function, called elf_load_image, to perform the actually copy of the elf image and clearing the padding. The function is implemented as memcpy and memset when the library is built as part of the tools, but it is implemented as raw_copy_to_guest and raw_clear_guest when built as part of Xen, so that it can be safely called with an HVM style dom0. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* tools/libvchan: Beef up the CPU barriers in libvchan.Keir Fraser2012-01-211-9/+9
| | | | | | Although they were sufficient for x86, they weren't safe more generally. Signed-off-by: Keir Fraser <keir@xen.org>
* libxc: Update rmb/wmb for x86.Keir Fraser2012-01-211-4/+6
| | | | | | Only the compiler needs to see the barriers; not the CPU. Signed-off-by: Keir Fraser <keir@xen.org>
* libxl: libxl_qmp.c should use libxl's own list macros, since theyKeir Fraser2012-01-211-9/+10
| | | | | | | exist. Also, older Linux versions do not have SIMPLEQ macros in sys/queue.h. Signed-off-by: Keir Fraser <keir@xen.org>
* libxl: VM generation ID: Add missing gate for HVM domain.Paul Durrant2012-01-171-1/+3
| | | | | | | | This will fix localhost migrate failures found by the automatic tests. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: drop vfs path -- fsback/front were deleted some time agoIan Campbell2012-01-161-2/+0
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ocaml: Correct ocaml type name for Aggregate types.Ian Campbell2012-01-101-0/+2
| | | | | | | | No change to the generated code because this path isn't used yet. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: Fix leaks on context init failureIan Jackson2012-01-131-8/+12
| | | | | | | | | | | | Several of the error exits from libxl_ctx_alloc leaked the context struct itself and sometimes other resources too. Fix this by using the standard "rc = ERROR_FOO; goto out" error handling style throughout. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Provide more formal libxl__ctx_lock and _unlockIan Jackson2012-01-131-10/+13
| | | | | | | | | | | | | | Previously the only official interface for the ctx lock was the CTX_LOCK and CTX_UNLOCK convenience macros, which assume and use "ctx" from the surrounding scope. Instead, provide libxl__ctx_lock and _unlock functions which can be used by these convenience macros, and other callers who have nonstandard requirements. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: move a lot more includes into libxl_internal.hIan Jackson2012-01-1327-138/+53
| | | | | | | | | | | | | | | | | Move a lot of #include <stdfoo.h> from individual files into libxl_internal.h. This helps avoid portability mistakes where necessary system headers are omitted from individual files, and is also of course a convenience when developing. Also add #include "libxl_osdeps.h" /* must come before any other headers */ to the top of most libxl*.c files, so that anyone who adds any headers before libxl_internal.h will put the in the right place. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xenstore: New function xs_path_is_subpathIan Jackson2012-01-132-0/+24
| | | | | | | | | This utility function compares two paths, textually and reports whether one is a subpath (a child path) of the other. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: make LIBXL_INIT_GC a statement, not an initialiserIan Jackson2012-01-132-3/+8
| | | | | | | | | | | | | | | | | | | | | Previously LIBXL_INIT_GC was an initialiser, which you were expected to use like this: libxl__gc gc = LIBXL_INIT_GC(ctx); But we are going to want to put things in the gc which are to be initialised using other macros. That means that LIBXL_INIT_GC has to become a statement too. So instead, we make it so that it's used like this: libxl_gc gc; LIBXL_INIT_GC(gc,ctx); In fact there are only a couple of callers now, including GC_INIT which uses this trick: libxl_gc gc[1]; LIBXL_INIT_GC(gc[0],ctx); Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: fix build with make prior to 3.81Jan Beulich2012-01-121-1/+3
| | | | | | | | | Up to 3.80, make only supported simple 'else' constructs, which got violated by 24432:e0effa7c04f5. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xenpaging: convert mem_event_t to struct mem_eventOlaf Hering2012-01-092-5/+5
| | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xenpaging: convert xenpaging_t to struct xenpagingOlaf Hering2012-01-095-23/+23
| | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xenpaging: convert xenpaging_victim_t to struct victimOlaf Hering2012-01-094-11/+9
| | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xenpm: assorted adjustmentsJan Beulich2012-01-101-42/+31
| | | | | | | | | | | | | | | | | - use consistent error values (stop mixing of [positive] errno values with literal -E... ones) - properly format output - don't use leading zeros in decimal output - move printing of average frequency into P-state conditional (rather than a C-state one) - don't print some C-state related info when CPU idle management is disabled in the hypervisor - use calloc() for array allocations that also got cleared via memset() so far Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add feature flag to xenstore for XS_RESET_WATCHESOlaf Hering2012-01-052-0/+2
| | | | | | | | | | Tell guest about availibilty of xenstoreds XS_RESET_WATCHES function. Guests can not issue this command unconditionally because some buggy toolstacks (such as EC2) do not ignore unknown commands properly. Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* flask/policy: add missing manage_domain rulesDaniel De Graaf2012-01-102-0/+9
| | | | | | | | The updated example policy did not include rules to allow managing the created domains (pause, unpause, destroy); allow these actions. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* docs: Update xsm-flask documentationDaniel De Graaf2012-01-101-1/+1
| | | | | Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Ian Jackson <ian.jackson.citrix.com>