aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* libxl: add option to choose who executes hotplug scriptsRoger Pau Monne2012-07-269-1/+76
| | | | | | | | | | | | | | | | | Add and option to xl.conf file to decide if hotplug scripts are executed from the toolstack (xl) or from udev as it used to be in the past. This option is only introduced in this patch, but it has no effect since the code to call hotplug scripts from libxl is introduced in a latter patch. This choice will be saved in "libxl/disable_udev", as specified in the DISABLE_UDEV_PATH constant. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: convert libxl_device_nic_add to an async operationRoger Pau Monne2012-07-268-22/+114
| | | | | | | | | | | | | | | | | | | | This patch converts libxl_device_nic_add to an ao operation that waits for device backend to reach state XenbusStateInitWait and then marks the operation as completed. This is not really useful now, but will be used by latter patches that will launch hotplug scripts after we reached the desired xenbus state. Calls to libxl_device_nic_add have also been moved to occur after the device model has been launched, so when hotplug scripts are called from this functions the interfaces already exists. As usual, libxl_device_nic_add callers have been modified, and the internal function libxl__device_disk_add has been used if the call was inside an already running ao. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: convert libxl_device_disk_add to an async opRoger Pau Monne2012-07-268-72/+306
| | | | | | | | | | | | | | | | | | This patch converts libxl_device_disk_add to an ao operation that waits for device backend to reach state XenbusStateInitWait and then marks the operation as completed. This is not really useful now, but will be used by later patches that will launch hotplug scripts after we reached the desired xenbus state. As usual, libxl_device_disk_add callers have been modified, and the internal function libxl__device_disk_add has been used if the call was inside an already running ao. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> [ ijc -- drop hunk modifying libxl_cdrom_insert which is not needed after 25670:3666e9712eaf "libxl: make libxl_cdrom_insert async" ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: convert libxl__device_disk_local_attach to an async opRoger Pau Monne2012-07-263-51/+192
| | | | | | | | | | | | | | This will be needed in future patches, when libxl__device_disk_add becomes async also. Create a new status structure that defines the local attach of a disk device and use it in libxl__device_disk_local_attach. This is done in this patch to split the changes introduced when libxl__device_disk_add becomes async. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: refactor disk addition to take a helperRoger Pau Monne2012-07-262-124/+148
| | | | | | | | | | | | | Change libxl__device_disk_add to no longer take a xs transaction and instead pass a helper for the local attach case that's used to get the free vdev. This function contains some non-functional changes due to an indentation change. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix removal of secondary consolesRoger Pau Monne2012-07-261-1/+11
| | | | | | | | | | | | | | | | | | | | | | Secondary consoles are processed by libxl with the rest of the devices by calling libxl__initiate_device_remove that waits for the device to reach state 6 before procceeding with the removal. When libxl is destroying the console devices, Qemu is already dead or dying, and xenconsoled completely ignores the state backend entry for console devices, since it performs the cleanup based on the result of reads/writes to the tty. Since we don't want to execute hotplug scripts for consoles, leave the behaviour as it was previously, and just nuke the backend/frontend xenstore entries by calling libxl__device_destroy. Report: http://markmail.org/message/yqgppcsdip6tnmh6 Reported-by: Ian Campbell <ian.campbell@eu.citrix.com> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: make libxl_cdrom_insert async.Ian Campbell2012-07-265-19/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This functionality is a bit of a mess and several configurations are not properly supported. The protocol for changing is basically to change the params node in the disk xenstore backend. There is no interlock or error reporting in this protocol. Completely removing the device and recreating it is not necessary nor expected. For reference the equivalent xend code is tools/python/xen/xend/server/blkif.py::BlkifController::reconfigureDevice(). Device model stub domains are not supported. There appears to be no way correctly to do a media change on the emulated device while also changing the stub domains PV backend to point to the new backend. Reworking this is a significant task deferred until 4.3. xend (via the equivalent "xm block-configure" functionality) also does not support media change for stub domains (confirmed by code inspection and experiment). Unlike xend this version errors out instead of silently not achieving anything in this case. There is no support for qemu-xen (upstream) media change. I expect this is supported on the qemu side and required QMP plumbing on the libxl side. Again this is deferred until 4.3. On the plus side the current implementation is trivially "asynchronous". Adds a libxl__xs_writev_atonce helper to write a key-value list to xenstore in one go. Tested with Windows 7. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: have NUMA placement deal with cpupoolsDario Faggioli2012-07-263-38/+95
| | | | | | | | | | | | | | | | | In such a way that only the cpus belonging to the cpupool of the domain being placed are considered for the placement itself. This happens by filtering out all the nodes in which the cpupool has not any cpu from the placement candidates. After that ---as cpu pooling not necessarily happens at NUMA nodes boundaries--- we also make sure only the actual cpus that are part of the pool are considered when counting how much processors a placement candidate provides. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: enable automatic placement of guests on NUMA nodesDario Faggioli2012-07-267-1/+666
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a domain does not have a VCPU affinity, try to pin it automatically to some PCPUs. This is done taking into account the NUMA characteristics of the host. In fact, we look for a combination of host's NUMA nodes with enough free memory and number of PCPUs for the new domain, and pin it to the VCPUs of those nodes. Deciding which placement is the best happens by means of some heuristics. For instance, smaller candidates are better, both from a domain perspective (less memory spreading among nodes) and from the entire system perspective (smaller memory fragmentation). In case of candidates of equal sizes (i.e., with the same number of nodes), the amount of free memory and the number of domains' vCPUs already pinned to the candidates' nodes are both considered. Very often, candidates with greater amount of memory are the one we wants, as this is good for keeping memory fragmentation under control. However, we do not want to overcommit some node too much, just because it has a lot of memory, and that's why the number of vCPUs must be accounted for. This all happens internally to libxl, and no API for driving the mechanism is provided for now. This matches what xend already does. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Tested-by: Andre Przywara <andre.przywara@amd.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: libxl__xs_path_cleanup don't print error if ENOENTRoger Pau Monne2012-07-261-2/+4
| | | | | | Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: update xensource.com to xen.orgAndrew Cooper2012-07-266-16/+16
| | | | | | | | | | | | This patch was constructed by grepping for xensource.com over the entire repository and eyeballing which ones were sensible to update. In addition, the xen-tools mailing list has been deprecated, so update xentop to refer to xen-devel instead. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: support xend empty cdrom device syntaxIan Jackson2012-07-264-8/+17
| | | | | | | | | | | | | | | xend accepts `,hdc:cdrom,r' as an empty CDROM drive. However this is not consistent with the existing xl syntax in docs/misc/xl-disk-configuration.txt which requires `,,hdc:cdrom,r' (the additional positional paramter is the format). We fix this by spotting the case specially: when the target is empty and the format contains a colon, reinterpret the format as <vdev>:<devtype>. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: disk parsing preparation for empty cdrom devicesIan Jackson2012-07-263-63/+87
| | | | | | | | | | | | | | | | | | | | | Prepare the ground for parsing the xend empty cdrom syntax, by separating out some non-functional changes as this pre-patch: * Clarify the disk syntax documentation wording to refer to deprecated syntaxes too. * Make DPC in libxlu_disk_l.l useable in the helper functions as well as in lexer rules, by providing two definitions, each in force in the appropriate parts of the file. * Break the <vdev>[:<devtype>] parsing out into a helper function, `vdev_and_devtype'. No functional change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: support empty CDROM devicesIan Campbell2012-07-267-35/+59
| | | | | | | | | | | | | | | | | | | | | | | | | The important change here is to xlu_disk_parse to correctly set format == EMPTY for CDROM devices which are empty. Test cases are added which check for correctness here. xend accepts ',hdc:cdrom,r'[0] as an empty CDROM drive however this is not consistent with the xl syntax in docs/misc/xl-disk-configuration.txt which requires ',,hdc:cdrom,r' (the additional positional paramter is the format). I'm not sure if/how this can be fixed. Note that xend does not accept ',,hdc:cdrom,r' There are several incidental cleanups included the the cdrom-{insert,eject} commands: - add a dry-run mode - use the non-deprecated disk specification syntax - check for and report errors from libxl_cdrom_insert [0] http://wiki.xen.org/wiki/CD_Rom_Support_in_Xen 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> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: set nic type of stub to PV instead of copying from the parentRoger Pau Monne2012-07-261-0/+1
| | | | | | | | | Set the type of the nics used in sutbdoms to PV unconditianlly, or the call to setdefaults later is going to fail. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: main_blockdetach don't call destroy if remove succeedsRoger Pau Monne2012-07-261-5/+6
| | | | | | | | | xl was calling libxl_device_disk_destroy after a successful call to libxl_device_disk_remove, which leads to an error. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: use libxl__xs_path_cleanup on device_destroyRoger Pau Monne2012-07-261-4/+14
| | | | | | | | | | Since the hotplug script that was in charge of cleaning the backend is no longer launched, we need to clean the backend by ourselves, so use libxl__xs_path_cleanup instead of xs_rm. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: rename _IOEMU nic type to VIF_IOEMURoger Pau Monne2012-07-264-10/+10
| | | | | | | | | This change will avoid the confusion caused by the fact that IOEMU means both PV and TAP network interfaces. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: rename vifs to nicsRoger Pau Monne2012-07-266-60/+60
| | | | | | | | | | | | | This change renames functions and struct values that used to contain vifs in their names to nics, that provides a more clear name to define network interfaces without referring to the backend that is behind them. This is not a functional change. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: libxl__device_model_version_running should return an intIan Campbell2012-07-252-4/+2
| | | | | | | | | | | On error it returns -1 and therefore it needs to return int and not libxl_device_model_enum. Otherwise gcc 4.6.2 complains: libxl.c: In function ‘libxl_domain_suspend’: libxl.c:778:9: error: case value ‘4294967295’ not in enumerated type ‘libxl_device_model_version’ [-Werror=switch] Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: kill the need for checking and linking to libmDario Faggioli2012-07-254-52/+1
| | | | | | | | | | | | Which was introduced in 7b0dc7f3ddfe. This is because the NUMA placement heuristic does not need FP arith anymore. As usual when changing configure.ac, remember to rerun autoconf after applying this change. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: libxl_domain_sched_params_set case for ARINC 653 schedulerAndrew Kane2012-07-251-0/+11
| | | | | | | | | | Implements sched_arinc653_domain_set to match the existing API. Currently, there is no domain-specific configuration when using the ARINC 653 scheduler, so we simply return success. Signed-off-by: Andrew Kane <Andrew.Kane@dornerworks.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* python: disable libxl bindingsIan Campbell2012-07-251-1/+2
| | | | | | | | | | | | | They are rather incomplete and have no users or maintainer. Many of the functions which do exsit raise a NotImplemented exception. Disable them so that users of the 4.2 release aren't confused into trying to use them. This only does the minimal to disable them and makes it easy to locally reenable if anyone wants to hack these into shape in the future. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* build: include Tools.mk first in tools/Rules.mkRoger Pau Monne2012-07-251-1/+1
| | | | | | | | | Tools.mk should be included first, or PREFIX is not honoured in the other conf/ files that define the paths of several tools. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix comment regarding bootloader disk lifetimeIan Jackson2012-07-251-3/+5
| | | | | | Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix transaction leak in logdirty error pathIan Jackson2012-07-252-0/+37
| | | | | | | | | | | | | libxl__domain_suspend_common_switch_qemu_logdirty would leak t if there was an error. Fix this. Also, document the intended usage for libxl__xs_transaction_* in the doc comment in libxl_internal.h. Reported-by: Ian Campbell <Ian.Campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <Ian.Campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* hotplug: network-bridge: fix for interfaces with no gatewayIan Campbell2012-07-251-1/+3
| | | | | | | | | | | | | | | | This comes from an old Debian bug report http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588477 which refers to http://lists.xen.org/archives/html/xen-users/2010-06/msg00420.html. Although we no longer have a trap in _claim_lock as described (this was removed in 25590:bb250383a4f5 "hotplug/Linux: use flock based locking") and the use of network-* scripts is discouraged (in favour of using distro provided mechanisms) the general principal that relying on the semantics of /bin/sh's && is unwise seems sound. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* hotplug: fix ip_of for systems using a peer-to-peer linkIan Campbell2012-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This is from an old Debian bug at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437127 I'm slightly inferring what the configuration which trigger this issue is, the bug report says: This code however fails if no slash is present in the address, which is the case in my configuration: $ ip addr show dev eth0 2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:16:17:90:b4:35 brd ff:ff:ff:ff:ff:ff inet 88.198.12.XXX peer 88.198.12.XXX/32 brd 88.255.255.255 scope global eth0 I hope either Marc or Stefan can correct me if I have surmised wrongly what this configuration represents. This function is used in the vif-route configuration. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: refuse to try and migrate an HVM guest using qemu-xenIan Campbell2012-07-251-0/+17
| | | | | | | | | libxl/qemu-upstream currently do not collude together to enable log-dirty mode and therefore migrations are unsafe. Refuse to even try for now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix bug the number of running vcpu inconsistent with config fileZhang, Yang Z2012-07-241-0/+1
| | | | | | | | | | | | The following patch will fix the bug 1825. http://bugzilla.xen.org/bugzilla/show_bug.cgi?id=1825 When using memcpy to update vcpu_online, the high bits of vcpu_online may unmodified if the size of avail_vcpus less than vcpu_online. So we need to clear it before the memory copying. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Acked-by: Ian Campbell <ian.campbelL@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix vif.ifname when used with stub device model.Ian Campbell2012-07-241-2/+19
| | | | | | | | | | | | | | | | | Currently the same libxl_device_nic is used to create both the HVM domain and its stub domain's NICs. This means that if a vifname is provided both the HVM domains PV NIC and the stub domains PV NIC will get the same name and the DM's NIC will fail to be attached. Instead launder the libxl_device_nic to add the TAP_DEVICE_SUFFIX ("-emu"). This is a bit of a misnomer, since the device is actually PV, but it is used to "back" the emulated device in the stub domain and this naming scheme is consistent with the non-stub case and is known to work e.g. with our hotplug scripts. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* autoconf: only check for dev86 and iasl checks on x86Roger Pau Monne2012-07-242-14/+112
| | | | | | | | | | | | | | | | The previous patch (25331:dfe39bd65137) only touched the definition of the variables used to refer to the paths to the tools but didn't remove the actual checks. Run autogen after applying this patch. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- added a comment about "build" vs "host" terminology and a note about the previous attempt to the changelog, reintroduce AC_CANONICAL_HOST which was remove by 25303:078c7d4cde1d after this patch was posted but is required for $host_cpu ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* autoconf: revert 25178:181478052ea2Ian Campbell2012-07-242-15/+4
| | | | | | | | This change only removed the variables used to supply the path to the tool but didn't remove the checks. Will be fixed properly in a subsequent patch. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* hotplug: vif: fail if a duplicate vifname is used.Ian Campbell2012-07-231-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on a patch from Hans van Kranenburg in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658305. Quoting that bug report: When configurating a duplicate custom vifname for interfaces in the Xen dom0 that are added to a bridge (which is obviously a configuration error), the hotplug scripts fail silently to rename the new vifX.0 to the custom vifname, if it's already existing. The result of this, is that the domU will start normally, but no network traffic between domU and the dom0 bridge is possible, because the vifX.0 never gets added to the bridge. Worse... when doing xm shutdown on the newly created domU, while investigating the issue, the interface of another running domU gets shut down, and remains hanging around in a DOWN state, because it cannot be removed (the other unrelated domU is still running, but succesfully made unavailable on the network!). When starting the new domU again, the interface of the other domU will be added to the bridge again, and while looking at the output of brctl show, tcpdump and ping, which make no sense, because everything will seem to be right, nagios will notify you of another host being down. :| Note that libxl doesn't actually check the hotplug status yet, this changes with Rogers hotplug script changes. xend correctly picks the failure up. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: don't leave fds openRoger Pau Monne2012-07-231-0/+3
| | | | | | | | | | | On NetBSD a block device can only be opened once, so make sure pygrub closes it every time, if this is not done libfsimage is not able to open the disk later. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xenstore: don't print an error when gntdev cannot be openedRoger Pau Monne2012-07-231-1/+1
| | | | | | | | | NetBSD doesn't have a gntdev, but we should not print an error when falling back to the previous implementation. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: rename stubdomain when renaming domain.Ian Campbell2012-07-233-1/+27
| | | | | | | | | | | | | | Otherwise after a localhost migrate of an HVM domain with a stubdomain we end up with domains called "FOO" and "FOO--incoming-dm". This because we initially create the domains as "FOO--incoming" and then rename to "FOO" inorder to maintain the uniqueness of domain names on a host. In this state a second attempt to migrate will fail upon attempting to create a new domain named "FOO--incoming-dm" Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: move bootloader data strucutres and prototypesRoger Pau Monne2012-07-231-161/+161
| | | | | | | | | | | | Move bootloader and related data after all the device stuff, since libxl__bootloader_state will depend on libxl__ao_device (to perform the local attach of a device). This is pure code motion. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: convert libxl_domain_destroy to an async opRoger Pau Monne2012-07-238-84/+488
| | | | | | | | | | | | | | | | | | | | | This change introduces some new structures, and breaks the mutual dependency that libxl_domain_destroy and libxl__destroy_device_model had. This is done by checking if the domid passed to libxl_domain_destroy has a stubdom, and then having the bulk of the destroy machinery in a separate function (libxl__destroy_domid) that doesn't check for stubdom presence, since we check for it in the upper level function. The reason behind this change is the need to use structures for ao operations, and it was impossible to have two different self-referencing structs. All uses of libxl_domain_destroy have been changed, and either replaced by the new libxl_domain_destroy ao function or by the internal libxl__domain_destroy that can be used inside an already running ao. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: move device model creation prototypesRoger Pau Monne2012-07-231-38/+37
| | | | | | | | | | | Move prototypes regarding device model creation, since they will depend on domain destruction in future patches. This patch is pure code motion. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: change ao_device_remove to ao_deviceRoger Pau Monne2012-07-236-196/+390
| | | | | | | | | | | | Introduce a new structure to track state of device backends, that will be used in following patches on this series. This structure if used for both device creation and device destruction and removes libxl__ao_device_remove. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: check backend state before setting it to "closing"Roger Pau Monne2012-07-231-23/+36
| | | | | | | | | Check backend state before unconditionally setting it to "closing" (5), since it might already be in "closed" (6). Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: restore: bounds check for start_info.{store_mfn,console.domU.mfn}Ian Campbell2012-07-231-0/+12
| | | | | | | | | | These fields are canonicalised by the guest on suspend and therefore must be valid pfns during restore. Reported-by: Jonathan Ludlam <Jonathan.Ludlam@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: remove stray timer mode debug printIan Campbell2012-07-231-1/+0
| | | | | | | Reported-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: do not blunder on if bootloader failsIan Jackson2012-07-231-1/+4
| | | | | | | | | | | If the bootloader failed, we would call the creation failure callback but _also_ blunder on trying to recreate the domain, due to a missing "return". Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Reported-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: explicitly check for libmath in autoconfDario Faggioli2012-07-064-1/+52
| | | | | | | | | | | | | | | | As well as explicitly add -lm to libxl's Makefile. This is because next patch uses floating point arithmetic, and it is better to state it clearly that we need libmath (just in case we find a libc that wants that to be explicitly enforced). Notice that autoconf should be rerun after applying this change. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- s/libmath/libm/ in error message ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: introduce some node map helpersDario Faggioli2012-07-062-0/+67
| | | | | | | | | | | To allow for allocating a node specific libxl_bitmap (as it is for cpu number and maps). Helper unctions to convert a node map it its coresponding cpu map and vice versa are also implemented. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: expand the libxl_bitmap API a bitDario Faggioli2012-07-062-0/+34
| | | | | | | | By adding copying and *_is_full/*_is_empty facilities. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: rename libxl_cpumap to libxl_bitmapDario Faggioli2012-07-0613-160/+167
| | | | | | | | | | | | | | | | | | | | | | | | And leave to the caller the burden of knowing and remembering what kind of bitmap each instance of libxl_bitmap is. This is basically just some s/libxl_cpumap/libxl_bitmap/ (and some other related interface name substitution, e.g., libxl_for_each_cpu) in a bunch of files, with no real functional change involved. A specific allocation helper is introduced, besides libxl_bitmap_alloc(). It is called libxl_cpu_bitmap_alloc() and is meant at substituting the old libxl_cpumap_alloc(). It is just something easier to use in cases where one wants to allocate a libxl_bitmap that is going to serve as a cpu map. This is because we want to be able to deal with both cpu and NUMA node maps, but we don't want to duplicate all the various helpers and wrappers. While at it, add the usual initialization function, common to all libxl data structures. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.eu.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: add more NUMA information to `xl info -n'Dario Faggioli2012-07-061-3/+33
| | | | | | | | | So that the user knows how much memory there is on each node and how far they are from each others. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>