aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Replace pyxml/xmlproc-based XML validator with lxml based oneStephan Peijnik2010-10-111-48/+47
| | | | | | | | | | | | | Pyxml/xmlproc is being used in tools/xen/xm/xenapi_create.py but is unmaintained for several years now. xmlproc is used only for validating XML documents against a DTD file. This patch replaces the pyxml/xmlproc based XML validation with code based on lxml, which is actively maintained. Signed-off-by: Stephan Peijnik <spe@anexia.at> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* tools/tests: Test 64-bit x86 emulation in test_x86_emulate.Keir Fraser2010-10-114-393/+417
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xl: Fix build in python binding since API change in 22229:1385b15e168fGianni Tedesco2010-10-082-4/+5
| | | | | | Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: Implement PCI passthrough force removalGianni Tedesco2010-10-063-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two errors with removing PCI devices from HVM domains. The first error is that the handling of "pci-rem" device-model command is erroneously implemented in qemu and difficult (impossible?) to get right. For example, during domain shutdown there can be a race where the guest OS unloads it's drivers and perhaps even shuts down PCI subsystem before the pci-rem command has been received by qemu. This means that no OS is present to write to the port which causes the dm command to be acknowledged. We fix this by implementing a 'force removal' option to libxl_device_pci_remove which is always set to 1 during guest shutdown. It can be optionally enabled on the xl command line for other occasions. The second error is that if a guest OS doesn't respond to the SCI interrupt and therefore the pci-rem dm command, which can happen if the guest OS has no ACPI PCI hotplug support, then device removal bails with an error but only AFTER removing the device from xenstore. This means that xenstore gets in to an inconsistent state where an assigned device also appears to be assignable. This is fixed by moving xenstore device removal to occur only after the device has really been removed. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl: remove console 0 backend directory from xenstore on devices destroyIan Campbell2010-10-052-53/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first PV console device has an unusual frontend path for historical reasons (/local/domain/<domid>/console rather than /local/domain/<domid>/device/console/0). Therefore we need to check this additional frontend path as well as those under /local/domain/<domid>/device when tearing down all backends or else we miss the backend for the console. As part of this we need to ensure that the frontend directory has a valid link to the backend, currently this link does not exist. Fix this by adding libxl__device_frontend_path to return the correct frontend path, accounting for the special case, and use it from libxl__device_add_generic. Also add libxl__device_backend_path for consistency. This also allows console 0 setup to follow essentially the same code path as other consoles within libxl_device_console_add, reducing the special casing required there. This also fixes the link from backend to frontend which until now gave a dangling link to the normal device path instead of the exceptional one. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* Fix copy and paste bug in libxl_run_bootloaderChristoph Egger2010-10-051-1/+1
| | | | | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl: fix qemu-dm pathChristoph Egger2010-10-011-1/+1
| | | | | | | | | qemu-dm is installed under libxl_libexec_path (not under libxl_private_bindir_path). Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: allow parsing of both old and new cpuid syntaxAndre Przywara2010-10-011-9/+76
| | | | | | | | | | Allow parsing of both versions of the cpuid syntax, the old xm used one and the new one for xl. This works automatically, as the parser can tell a Python list apart from a string before processing the line. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl: implementing legacy xm cpuid parserAndre Przywara2010-10-012-0/+62
| | | | | | | | | | To support compatibility with the xm config files, add a parser for the old style cpuid= syntax. This uses a Python list, so it can be distinguished from the new syntax easily. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: implement parsing of cpuid parameter and translate to Xen interfaceAndre Przywara2010-10-013-0/+231
| | | | | | | | | | | | | | | | | | Parses a string enumerating cpuid flags and their behavior. The syntax is: cpuid = "host,<flagname>=[01xks],..." Supports: 0: clear this flag 1: set this flag x: don't care, use the default handling k: use the host value s: as k, but keep stable across migrations For multiple bit flags there have to be numbers passed (hex or dec), like: family=0x10,model=4 Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: use libxl_domain_info to get the uuid in printf_infoAndre Przywara2010-10-011-1/+11
| | | | | | | | | | | | If there is no UUID specified in the config file, we generate one during the _parsing_ process. Since xl list -l parses the config file again, the UUID will be generated again in this case and the reported version does probably not match the used one. Fix this by retrieving the UUID from dominfo (like xl list -v does). Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: Fix stack corruption caused by non-terminated call to libxl__xs_writevGianni Tedesco2010-09-231-1/+1
| | | | | | | Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Tested-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/python: do not link against blktap except on LinuxGianni Tedesco2010-09-231-3/+5
| | | | | | | | | Link to libblktapctl in python setup only for platforms which build it. This fixes a build breakage on NetBSD introduced in 330c4d9010da. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Tested-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Introduce a maximum limit for free_mem_slack (re (dom0) ballooning)Stefano Stabellini2010-09-231-2/+9
| | | | | | | | | | | | This fixes this message: libxl: error: libxl.c:2921:libxl_set_memory_target new target for dom0 is below the minimum threshold which can occur spuriously if dom0_mem is specified and xl autoballoning is left turned on. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Tested-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: parse maxmem parameter in VM config filesStefano Stabellini2010-09-221-0/+3
| | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: proper accounting for the videoramStefano Stabellini2010-09-222-3/+4
| | | | | | | | | | Remove the videoram from the memory target of the domains consistently, leave the total amount of memory in maxmem. [fixed up for conflicts with libxl__ naming policy changes -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: free memory before building a domainStefano Stabellini2010-09-224-0/+132
| | | | | | | | | | | Free the needed amount of memory before proceeding with the domain build. Use a filelock to prevent other xl instances from conflicting during this operation. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: Change default global config not to contain uncommented defaultIan Jackson2010-09-221-1/+1
| | | | | | | [mistakenly applied v4 of patch 7/12 rather than v4b -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Config.mk et al: introduce XEN_LOCK_DIRStefano Stabellini2010-09-222-0/+5
| | | | | | | | | | Introduce a OS dependent global variable XEN_LOCK_DIR that points at the system directory that contains lock files. [fixed up for conflict in Config.mk -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: add a global configuration fileStefano Stabellini2010-09-224-0/+55
| | | | | | | | | | Add a global configuration file: /etc/xen/xl.conf; the only option currently parsed is autoballoon that is 1 by default. [fixed up for conflicts with libxl__ naming policy changes -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: introduce the concept of dom0 minimum memoryStefano Stabellini2010-09-222-0/+7
| | | | | | | | | Introduce a minimum value for the memory assigned to dom0. [fixed up for conflicts with libxl__ naming policy changes -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add few more memory operationsStefano Stabellini2010-09-223-0/+142
| | | | | | | | | | | | | | | | | | libxl_domain_need_memory: calculate how much memory a domain needs in order to be built and start correctly. libxl_get_free_memory: calculate the total free memory in the system. libxl_wait_for_free_memory: wait for a certain amount of memory to become free in the system. libxl_wait_for_memory_target: wait for a domain to reach its memory target. [fixed up for conflicts with libxl__ naming policy changes -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add a "relative" parameter to libxl_set_memory_targetStefano Stabellini2010-09-223-17/+159
| | | | | | | | | | | | | Introduce a relative parameter to flag that target_memkb is a relative amount of memory. The first time we are reading/writing dom0 memory target, fill the informations in xenstore if they are missing. Introduce libxl_get_memory_target. [fixed up for conflicts with libxl__ naming policy changes -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: use transactions in libxl_set_memory_targetStefano Stabellini2010-09-221-33/+41
| | | | | | | [fixed up for conflicts with libxl__ naming policy changes] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: do not modify static-max after domain creationStefano Stabellini2010-09-221-3/+0
| | | | | | | | | | | static-max represents the maximum memory the domain can ever have, therefore it shouldn't be changed after domain creation. [adjusted to cope with code movement since patch series written -iwj] Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add current_memkb to libxl_dominfoStefano Stabellini2010-09-223-2/+4
| | | | | | | | | | | currently xcinfo2xlinfo reads tot_pages and uses that data to calculate max_memkb, while tot_pages is the memory currently used by the domain and max_pages is the theoretical maximum. This patch calculates max_memkb from max_pages and introduces current_memkb to store the current memory usage. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: fix off-by-one mistake in block-attach handlerJan Beulich2010-09-211-1/+1
| | | | | | Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: change xl_cfg_get_list to take a dont_warn parameterAndre Przywara2010-09-213-11/+14
| | | | | | | | | | | xl_cfg_get_list can cope with the option not being a list, but it always reports a warning in this case. Introduce a parameter to omit this warning if needed. Future code can then decide what to do with this information. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl, buildmakevars2file: Do not relink libxl each timeIan Jackson2010-09-211-3/+3
| | | | | | | | | | | | | Make Config.mk's definition of buildmakevars2file and tools/libxl/Makefile's rule for _libxl_paths.h generate their files to temporary files and only rename them into place if the intended file has changed. This gets rid of unnecessarily compilation and link steps. Add *.tmp to .hgignore. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Keir Fraser <keir.fraser@citrix.com>
* tools/hotplug: Linux udev rules adjustmentJan Beulich2010-09-211-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While earlier this year some work was done to eliminate libxc's creation of nodes under /dev (as in some cases it actually got things wrong), I just found that tapdisk2 does exactly the same. While I'm not currently aiming at removing this code, I want to at least suggest some adjustments to the provided rules file. First of all, the present rule KERNEL=="blktap[0-9]*", NAME="xen/%k" matches both blktap1's devices and blktap2's ring devices, resulting in whoever comes last replacing what was there before (e.g. a tap2:aio: attach will replace bltap1's /dev/blktap0 [i.e. the main control device] with the ring device of the new virtual disk). Therefore we should add a subsystem qualifier there. Second, at some udev versions default to using 0660 as the permissions on nodes it creates. The kernel (with devtmpfs) defaults to 0600, and hence I'd suggest to also make this explicit in the rules. Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: Boris Derzhavets <bderzhavets@yahoo.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools, build system: Make changing distro-specific layout aspects easier2010-09-207-19/+63
| | | | | | | | | | | Introduce CONFIG_LEAF_DIR, SUBSYS_DIR, INITD_DIR variables to cope better with variation between distributions. See docs/misc/distro_mapping.txt for details. Signed-off-by: Bruce Edge <bruce.edge@gmail.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: fix Makefiles for autogenerated code (use multi-target patterns)Jan Beulich2010-09-201-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Building in a tree with read-only source files failed because the flex/ bison generated files are left in place. All of the source files (instead of all of the object files) were depending on libxl.h (in particular forcing the needless re-generation of the flex/bison generated files). For _libxl_types.[ch] a single non-pattern rule was used. For non- pattern rules with multiple targets, other than for pattern ones, the body gets executed once for each target, causing problems when building with -j<n>, <n> >= 2. Convert this rule to a pattern one. The flex/bison generated headers pointlessly depended on the corresponding source files. Use multiple-target pattern rules instead. It would also have been nice if the minimal flex/bison versions needed to successfully build libxl were documented: neither flex 2.5.31 nor bison 2.1 (as found e.g. on SLE10) is sufficient. Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* python: xl: stub out libxl_cpuid_policy_list accessorsIan Campbell2010-09-171-0/+10
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: correct vcpu-pin and vcpu-list parameter checkingJuergen Gross2010-09-161-11/+12
| | | | | | | | | attached patch corrects parameter checking of vcpu-pin and vcpu-list sub-commands. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: introduce cpuid interface to domain buildAndre Przywara2010-09-166-0/+43
| | | | | | | | | | Add a cpuid parameter into libxl_domain_build_info and use it's content while setting up the domain. This is a only paving the way, the real functionality is implemented in the later patches. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Clear device-model info when destroying an HVM domain with stubdom.Jun Zhu2010-09-161-12/+16
| | | | | Signed-off-by: Jun Zhu <Jun.Zhu@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: fix compiler warning with fork_exec_bootloaderAndre Przywara2010-09-163-4/+6
| | | | | | | | | | | At least one of my compilers complains about the broken const qualifier in the fork_exec_bootloader() call (despite the cast). Fix this properly by propagating the const attribute down the call stack. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl, tools/python: Add libxl python bindingGianni Tedesco2010-09-164-3/+922
| | | | | | | | | | | | | | | | Introduce python binding for libxl. The binding is not yet complete but serveral methods are implemented and tested. Those which are implemented provide examples of the two or three basic patterns that most future methods should follow. Over 5,000 lines of boilerplate is automatically generated to wrap and export all relevant libxl structure definitions. There are a few places where such code cannot be fully auto-generated and special hooks are declared and stubbed where, for example, conversion between libxl_file_reference and a python file object is required. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: change IDL to export a saner interface for upcoming language bindingsGianni Tedesco2010-09-166-40/+93
| | | | | | | | | | | | | | | | | | | | | | | Firstly remove an anonymous union in libxl_device_pci structure which was making auto-generating language bindings more complicated than necessary and exporting random bits of low level ABI that libxl that would rather hide anyway. There is a corresponding (untested) change to the ocaml binding which maintains previous ml API. Secondly make the libxl_file_reference type a Builtin. This is a 'semantic correctness' issue in that libxl ABI/API won't change. But it makes it so that when the IDL is used to generate language bindings that a file_reference type is not exported. Also implement a Numeric type which all integers are derived from. Make sure a boolean signed/unsigned attribute is set accordingly. This is required to allow language bindings to correctly handle the sign bit in environments with arbitrarily long integers. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: fix memory management of migration_domname_rIan Jackson2010-09-141-4/+7
| | | | | | | | | During migration, the domain name from the config file is swapped out and replaced with a different name (with the "--incoming" suffix), which we return to the caller. The memory management arrangements here were broken. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/python: Replace python string exceptions with ValueError exceptionsMatthias Klose2010-09-144-4/+4
| | | | | | | | | | | | | | | | | There are at least some syntax errors when trying to use the xen utils with python2.6. The attached patch changes these string exception into ValueErrors: - tools/python/xen/util/bugtool.py (getBugTitle) - tools/python/xen/xend (class XendBase): not catched - tools/python/xen/xm/xenapi_create.py (sxp2xmlconvert_sxp_to_xml): the method already raises a ValueError for similiar condition. - tools/python/xen/xm/main.py (xm_network_attach): not catched. For all but maybe the first one, the replacement of the string exceptions into ValueErrors seems to be safe. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc, tmem: Fix build after fd2e5008c2e0Keir Fraser2010-09-132-4/+4
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* tmem (tools): move to new ABI version to handle long object-idsKeir Fraser2010-09-132-10/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a great deal of discussion and review with linux kernel developers, it appears there are "next-generation" filesystems (such as btrfs, xfs, Lustre) that will not be able to use tmem due to an ABI limitation... a field that represents a unique file identifier is 64-bits in the tmem ABI and may need to be as large as 192-bits. So to support these guest filesystems, the tmem ABI must be revised, from "v0" to "v1". I *think* it is still the case that tmem is experimental and is not used anywhere yet in production. The tmem ABI is designed to support multiple revisions, so the Xen tmem implementation could be updated to handle both v0 and v1. However this is a bit messy and would require data structures for both v0 and v1 to appear in public Xen header files. I am inclined to update the Xen tmem implementation to only support v1 and gracefully fail v0. This would result in only a performance loss (as if tmem were disabled) for newly launched tmem-v0-enabled guests, but live-migration between old tmem-v0 Xen and new tmem-v1 Xen machines would fail, and saved tmem-v0 guests will not be able to be restored on a tmem-v1 Xen machine. I would plan to update both pre-4.0.2 and unstable (future 4.1) to only support v1. I believe these restrictions are reasonable at this point in the tmem lifecycle, though they may not be reasonable in the near future; should the tmem ABI need to be revised from v1 to v2, I understand backwards compatibility will be required. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* tools/xenstore: libxenstore: fix threading bug which cause xend startup hangIan Jackson2010-09-101-10/+34
| | | | | | | | | | | | | | | | | | | | | | If a multithreaded caller creates a thread which calls xs_read_watch, before it has set any watches with xs_watch, the thread in xs_read_watch will enter read_message and sit reading the xenstored fd without the appropriate locks held. Other threads can then concurrently read the xenstored fd, which naturally does not work very well. Symptoms of this bug which I have been able to reproduce include failure of xend startup to finish, due to a deadlock; results could also include reading corrupted data from xenstore. In this patch we arrange for xs_read_watch to always rely on the reader thread created by xs_watch. If no watches have been set, then xs_read_watch will block until one has been. If the library is compiled non-threaded xs_read_watch unconditionally does the reading in the current thread. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* oxenstored: when reading / read automatically the root node.Vincent Hanquez2010-09-101-1/+6
| | | | Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* xl: Fix adding additional config cmdline parametersAndre Przywara2010-09-101-9/+5
| | | | | | | | | | When checking the size of the buffer we hold for additional config parameters passed on the command line we should take the size of the to-be-added string into account. While at it, rework the implementation to be cleaner and safer. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: fix adding configuration parameters on command lineAndre Przywara2010-09-101-8/+6
| | | | | | | | | | Since we read the text file as is from the disk, there is no trailing \0 at the end terminating the C string. Therefore we must not use strcat to this buffer. Also we need to allocate space for the trailing zero byte. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: don't leak a lot of memory in forked process in domain_createGianni Tedesco2010-09-101-1/+1
| | | | | | | | | A goto statement skips over freeing data structures for no good reason. It's not a real issue since the next step is to exit() but this cleans up output of valgrind so that other leaks and errors can be spotted. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: don't leak gc pointers to caller's structs; prevent double freeGianni Tedesco2010-09-101-2/+5
| | | | | | | | | | | | libxl_build_device_model uses a pointer in a caller supplied data structure to synthesize a vif-name if one is not supplied. This is bad juju because the caller may want to free this pointer but by the time it get's a chance the gc has already done so. Switch to using a local variable for this pointer and avoid a double-free in the domain create path. Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: fix double free of domain namesGianni Tedesco2010-09-101-1/+1
| | | | | | | Assigning malloc'd variables from one structure to another when both of them are free'd via destructors is a bad idea. Let's use a strdup. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>