aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl
Commit message (Collapse)AuthorAgeFilesLines
* libxl: remove qemu default devices for upstream qemuFabio Fantoni2013-10-141-3/+7
| | | | | | | | | | | | Remove default devices created by qemu. Qemu will create only devices defined by xen, since the devices not defined by xen are not usable. Remove deleting of empty floppy no more needed with nodefault. (Removed a whitespace error. -iwj) Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl,xl: add max_event_channels option to xl configuration fileDavid Vrabel2013-10-145-0/+19
| | | | | | | | | | | | | | | | | | | Add the 'max_event_channels' option to the xl configuration file to limit the number of event channels that domain may use. Plumb this option through to libxl via a new libxl_build_info field and call xc_domain_set_max_evtchn() in the post build stage of domain creation. A new LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS #define indicates that this new field is available. The default value of 1023 limits the domain to using the minimum amount of global mapping pages and at most 5 xenheap pages. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* libxl: make libxl__poller_put tolerate p==NULLIan Jackson2013-10-112-4/+4
| | | | | | | | | | | | This is less fragile, and more in keeping with the usual style of initialising everything to 0 and freeing things unconditionally. Correspondingly, remove the tests at the call sites. Apropos of c1f3f174. No overall functional change. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix out-of-memory error handling in libxl_list_cpupoolMatthew Daley2013-10-101-0/+1
| | | | | | | | | | | | ...otherwise it will return freed memory. All the current users of this function check already for a NULL return, so use that. Coverity-ID: 1056194 This is CVE-2013-4371 / XSA-70 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix vif rate parsingIan Jackson2013-10-102-6/+17
| | | | | | | | | | | | | | | strtok can return NULL here. We don't need to use strtok anyway, so just use a simple strchr method. Coverity-ID: 1055642 This is CVE-2013-4369 / XSA-68 Signed-off-by: Matthew Daley <mattjd@gmail.com> Fix type. Add test case Signed-off-by: Ian Campbell <Ian.campbell@citrix.com>
* libxl: introduce libxl_node_to_cpumapDario Faggioli2013-10-102-0/+25
| | | | | | | | As an helper for the special case (of libxl_nodemap_to_cpumap) when one wants the cpumap for just one node. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: fix a typo in main_vcpulist()Dario Faggioli2013-10-101-1/+1
| | | | | | | which was preventing `xl vcpu-list -h' to work. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* tools/migrate: Fix regression when migrating from older version of XenAndrew Cooper2013-10-107-7/+52
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 00a4b65f8534c9e6521eab2e6ce796ae36037774 Sep 7 2010 "libxc: provide notification of final checkpoint to restore end" broke migration from any version of Xen using tools from prior to that commit Older tools have no idea about an XC_SAVE_ID_LAST_CHECKPOINT, causing newer tools xc_domain_restore() to start reading the qemu save record, as ctx->last_checkpoint is 0. The failure looks like: xc: error: Max batch size exceeded (1970103633). Giving up. where 1970103633 = 0x756d6551 = *(uint32_t*)"Qemu" With this fix in place, the behaviour for normal migrations is reverted to how it was before the regression; the migration is considered non-checkpointed right from the start. A XC_SAVE_ID_LAST_CHECKPOINT chunk seen in the migration stream is a nop. For checkpointed migrations the behaviour is unchanged. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <Ian.Campbell@citrix.com> CC: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> (Remus bits)
* libxl: correctly handle libxl_get_cpu_topology failure in libxl_{cpu, ↵Matthew Daley2013-10-031-2/+2
| | | | | | | | | | | | | node}map_to_{node, cpu}map Initialize nr_cpus to 0 so that if it is unchanged by a failing libxl_get_cpu_topology, libxl_cputopology_list_free still works OK afterward. Coverity-ID: 1055294 Coverity-ID: 1055295 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
* libxl: only put poller if already gotten in libxl_event_waitMatthew Daley2013-10-031-1/+2
| | | | | | Coverity-ID: 1055292 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xl: fork before execing vncviewerIan Campbell2013-10-032-2/+33
| | | | | | | | | Otherwise we don't daemonize to monitor the domain. Heavily cargo-culted from autoconnect-console and only compile tested. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Olaf Hering <olaf@aepfle.de>
* libxl: handle null lists in libxl_string_list_lengthMatthew Daley2013-10-031-2/+5
| | | | | | | | | | | | | After commit b0be2b12 ("libxl: fix libxl_string_list_length and its only caller") libxl_string_list_length no longer handles null (empty) lists. Fix so they are handled, returning length 0. While at it, remove the unneccessary undereferenced null pointer check and tidy the layout of the function. Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix file open failure check in libxl__file_reference_mapMatthew Daley2013-09-251-1/+1
| | | | | | Coverity-ID: 1055567 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix typo in libxl__hotplug_nic error checkingMatthew Daley2013-09-251-1/+1
| | | | | | Coverity-ID: 1055945 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: only free console reader if it was allocated in main_dmesgMatthew Daley2013-09-251-1/+2
| | | | | | Coverity-ID: 1055304 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix out-of-memory check in parse_global_configMatthew Daley2013-09-251-2/+2
| | | | | | Coverity-ID: 1055174 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix leak of rune in main_remusMatthew Daley2013-09-251-0/+3
| | | | | | Coverity-ID: 1087194 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix leak of config_data in main_cpupoolcreateMatthew Daley2013-09-251-0/+1
| | | | | | Coverity-ID: 1087193 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix leak of corename in handle_domain_deathMatthew Daley2013-09-251-0/+1
| | | | | | Coverity-ID: 1087192 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix dispose without init of disk in cd_insertMatthew Daley2013-09-251-4/+2
| | | | | | Coverity-ID: 1056078 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix libxl_string_list_length and its only callerMatthew Daley2013-09-252-2/+2
| | | | | | | | | | | | | | | | The wrong amount of indirections were being taken in libxl_string_list_length, and its only caller was miscounting the amount of initial non-list arguments, seemingly since the initial commit (599c784). This has been seen and reported in the wild (##xen): < Trixboxer> Hi, any idea why would I get < Trixboxer> xl: libxl_bootloader.c:42: bootloader_arg: Assertion `bl->nargs < bl->argsspace' failed. < Trixboxer> 4.2.2-23.el6 Coverity-ID: 1054954 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Use LOG_ERRNO rather than ERRNOVAL in libxl_pci.cGeorge Dunlap2013-09-161-10/+10
| | | | | | | | The xc_* functions (now) return -1 on error and set errno. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> CC: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Revert "libxl, hotplug/Linux: default to phy backend for raw format file"Ian Campbell2013-09-161-3/+3
| | | | | This reverts commit 11a63a1660453269ddd1893c15d0a98133b33ca7. The change causes issues with live migration.
* libxl: Spice vdagent support for upstream qemuFabio Fantoni2013-09-135-0/+30
| | | | | | | | | | | | | | | | | | Usage: - spicevdagent=1|0 (default=0) Enables spice vdagent. The Spice vdagent is an optional component for enhancing user experience and performing guest-oriented management tasks. Its features includes: client mouse mode (no need to grab mouse by client, no mouse lag), automatic adjustment of screen resolution, copy and paste (text and image) between client and domU. It also requires vdagent service installed on domU o.s. to work. - spice_clipboard_sharing=1|0 (default=0) Enables Spice clipboard sharing (copy/paste). It requires spicevdagent enabled. Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: correctly handle readlink() errorsMatthew Daley2013-09-131-1/+1
| | | | | | | | readlink() returns a ssize_t with a negative value on failure. Coverity-ID: 1055566 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: fix use-after-free in discard_events iterationMatthew Daley2013-09-131-2/+2
| | | | | | | | | We need to use the foreach variant which gets the next pointer before the loop body is executed. Coverity-ID: 1056193 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: fix libxl__device_disk_from_xs_be to parse backend domidRoger Pau Monne2013-09-131-0/+7
| | | | | | | | | | | | | | libxl__device_disk_from_xs_be was ignoring the backend domid, setting it to 0 by default. Fix this by parsing the backend disk path in order to fetch the backend domid. This fixes the issue reported when trying to block-detach disks that have it's backend on a driver domain. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reported-by: G.R. <firemeteor@users.sourceforge.net> Cc: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xl: fix `xl cpupool-list' behavior in case no pool name is providedDario Faggioli2013-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | since it errors out, asking for at least one argument, and does not display any useful output, which is wrong (we want the list and the info about all the existing cpupools). IOW, the output is as follows: ~# xl cpupool-list -c 'xl cpupool-list' requires at least 1 argument. ... While it should be as follows: ~# xl cpupool-list -c Name CPU list Pool-0 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* libxl, hotplug/Linux: default to phy backend for raw format fileWei Liu2013-09-131-3/+3
| | | | | | | | | | | | | | | | | Modify libxl to allow raw format file to use phy backend. For the hotplug script part, learn from NetBSD's block hotplug script -- test the path and determine the actual type of file (block device or regular file) then use the actual type to determine which branch to run. With these changes, plus the current ordering of backend preference (phy > qdisk > tap), we will use phy backend for raw format file by default. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: idl: complete some enums in the IDL with their defaultsRob Hoes2013-09-101-3/+8
| | | | | | | | | | | | There are several enums in the IDL that are initialised to 0, while the value 0 is not part of the enum itself. This creates problems for language bindings generated from the IDL, such as the OCaml ones. Added an explicit (0, "UNKNOWN") enum value where appropriate, or used init_val to default to a sensible value. Signed-off-by: Rob Hoes <rob.hoes@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: idl: add domain_type field to libxl_dominfo structRob Hoes2013-09-102-0/+3
| | | | | | | This allows a toolstack to find out whether a VM has booted as PV or HVM. Signed-off-by: Rob Hoes <rob.hoes@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWNRob Hoes2013-09-102-3/+4
| | | | | | | | | | libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit annoying when generating language bindings since it needs all sorts of special casing. Just introduce an explicit value instead. Signed-off-by: Ian Campbell <ian.cambell@citrix.com> Signed-off-by: Rob Hoes <rob.hoes@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: prefer qdisk over blktap when choosing disk backendWei Liu2013-09-031-2/+2
| | | | | | | | | There are some disk formats commonly supported by both qdisk and blktap. As qdisk is better supported and blktap is unmaintained, we choose qdisk over blktap whenever possible. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: allow user to specify a system qemu-xen binaryIan Campbell2013-08-211-1/+10
| | | | | | | | If this option is given don't bother building qemu-xen ourselves. Likely to be handy for distros who have an existing qemu package which they want to reuse. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Add vendor_device parameter for HVM guestsPaul Durrant2013-08-054-0/+36
| | | | | | | | | | | | The parameter determines which, if any, xen-pvdevice is specified on the QEMU command line. The default value is 'none' which means no argument will be passed. A value of 'xenserver' specifies a xen-pvdevice with device-id 0xc000 (the initial value in the xenserver namespace - see docs/misc/pci-device-reservations.txt). Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- s/BUILD_INFO/BUILDINFO for consistency in LIBXL_HAVE define ]
* libxl: Fix function libxl__domain_resume_device_modelrwxybh2013-08-021-0/+1
| | | | | | | Add a break line in function libxl__domain_resume_device_model Signed-off-by: Bingheng Yan <rwxybh@126.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Add vif.default.backend to xl.confGeorge Dunlap2013-07-223-0/+11
| | | | | | | | | This will allow a user to default to a network driver domain system-wide. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Enable by default claim mode.Konrad Rzeszutek Wilk2013-07-221-1/+1
| | | | | | | | | | During the Xen 4.3 release we discussed that this feature could be turned on by default - as it benefits all of the guests - not just tmem related. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Allow network driver domains when run_hotplug_scritps is setGeorge Dunlap2013-07-171-7/+0
| | | | | | | | | | | | | | As of commit 05bfd984dfe7014f1f5ea1133608b9bab589c120, hotplug scripts are not run if backend_domid != LIBXL_TOOSTACK_DOMID; so there is no reason to restrict this for network driver domains any more. This is a candidate for backporting to 4.3. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> CC: Ian Campbell <ian.campbell@citrix.com> CC: Ian Jackson <ian.jackson@citrix.com> CC: Jan Beulich <jbeulich@suse.com>
* xl: support for leaving domain paused after saveIan Murray2013-07-172-7/+16
| | | | | | | | | | | | | | New feature to allow xl save to leave a domain paused after its memory has been saved. This is to allow disk snapshots of domU to be taken that exactly correspond to the memory state at save time. Once the snapshot(s) have been taken or whatever, the domain can be unpaused in the usual manner. Usage: xl save -p <domid> <filespec> Signed-off-by: Ian Murray <murrayie@yahoo.co.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Add 'xen_version' to `xl info`Andrew Cooper2013-07-121-0/+2
| | | | | | | | | | | | Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}. This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number). Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: do not call exit() in libxl_device_vtpm_listMarek Marczykowski2013-07-041-5/+6
| | | | | | | | Signal error with NULL return value, do not terminate the whole process. Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: suppress device assignment to HVM guest when there is no IOMMUIan Jackson2013-07-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | This in effect copies similar logic from xend: While there's no way to check whether a device is assigned to a particular guest, XEN_DOMCTL_test_assign_device at least allows checking whether an IOMMU is there and whether a device has been assign to _some_ guest. For the time being, this should be enough to cover for the missing error checking/recovery in other parts of libxl's device assignment paths. There remains a (functionality-, but not security-related) race in that the iommu should be set up earlier, but this is too risky a change for this stage of the 4.3 release. This is a security issue, XSA-61. Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Use QMP cpu-add to hotplug CPU with qemu-xen.Anthony PERARD2013-06-261-6/+46
| | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Add "cpu-add" QMP command.Anthony PERARD2013-06-262-0/+23
| | | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> [ ijc -- rename index parameter to avoid Wshadow due to index(3) in strings.h ]
* libxl: Fix assignment of devid value returned from libxl__device_nextidJim Fehlig2013-06-261-4/+4
| | | | | | | | | | | | | | | | | | | Commit 5420f265 has some misplaced parenthesis that caused devid to be assigned 1 or 0 based on checking return value of libxl__device_nextid < 0, e.g. devid = libxl__device_nextid(...) < 0 This works when only one instance of a given device type exists, but subsequent devices of the same type will also have a devid = 1 if libxl__device_nextid succeeds. Fix by checking the value assigned to devid, e.g. (devid = libxl__device_nextid(...)) < 0 Signed-off-by: Jim Fehlig <jfehlig@suse.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Restrict permissions on PV console device xenstore nodesIan Jackson2013-06-255-36/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Matthew Daley has observed that the PV console protocol places sensitive host state into a guest writeable xenstore locations, this includes: - The pty used to communicate between the console backend daemon and its client, allowing the guest administrator to read and write arbitrary host files. - The output file, allowing the guest administrator to write arbitrary host files or to target arbitrary qemu chardevs which include sockets, udp, ptr, pipes etc (see -chardev in qemu(1) for a more complete list). - The maximum buffer size, allowing the guest administrator to consume more resources than the host administrator has configured. - The backend to use (qemu vs xenconsoled), potentially allowing the guest administrator to confuse host software. So we arrange to make the sensitive keys in the xenstore frontend directory read only for the guest. This is safe since the xenstore permissions model, unlike POSIX directory permissions, does not allow the guest to remove and recreate a node if it has write access to the containing directory. There are a few associated wrinkles: - The primary PV console is "special". It's xenstore node is not under the usual /devices/ subtree and it does not use the customary xenstore state machine protocol. Unfortunately its directory is used for other things, including the vnc-port node, which we do not want the guest to be able to write to. Rather than trying to track down all the possible secondary uses of this directory just make it r/o to the guest. All newly created subdirectories inherit these permissions and so are now safe by default. - The other serial consoles do use the customary xenstore state machine and therefore need write access to at least the "protocol" and "state" nodes, however they may also want to use arbitrary "feature-foo" nodes (although I'm not aware of any) and therefore we cannot simply lock down the entire frontend directory. Instead we add support to libxl__device_generic_add for frontend keys which are explicitly read only and use that to lock down the sensitive keys. - Minios' console frontend wants to write the "type" node, which it has no business doing since this is a host/toolstack level decision. This fails now that the node has become read only to the PV guest. Since the toolstack already writes this node just remove the attempt to set it. This is a security issue, XSA-57. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* libxl,hvmloader: Don't relocate memory for MMIO holeGeorge Dunlap2013-06-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, qemu-xen can't handle memory being relocated by hvmloader. This may happen if a device with a large enough memory region is passed through to the guest. At the moment, if this happens, then at some point in the future qemu will crash and the domain will hang. (qemu-traditional is fine.) It's too late in the release to do a proper fix, so we try to do damage control. hvmloader already has mechanisms to relocate memory to 64-bit space if it can't make a big enough MMIO hole. By default this is 2GiB; if we just refuse to make the hole bigger if it will overlap with guest memory, then the relocation will happen by default. v5: - Update comment to not refer to "this series". v4: - Wrap long line in libxl_dm.c - Fix comment v3: - Fix polarity of comparison - Move diagnostic messages to another patch - Tested with xen platform pci device hacked to have different BAR sizes {256MiB, 1GiB} x {qemu-xen, qemu-traditional} x various memory configurations - Add comment explaining why we default to "allow" - Remove cast to bool v2: - style fixes - fix and expand comment on the MMIO hole loop - use "%d" rather than "%s" -> (...)?"1":"0" - use bool instead of uint8_t - Move 64-bit bar relocate detection to another patch - Add more diagnostic messages Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> CC: Ian Campbell <ian.campbell@citrix.com> CC: Stefano Stabellini <stefano.stabellini@citrix.com> CC: Hanweidong <hanweidong@huawei.com> CC: Keir Fraser <keir@xen.org> CC: Keir Fraser <keir@xen.org>
* libxl: add LIBXL_HAVE_<foo> for outstanding_pages and outstanding_memkbDario Faggioli2013-06-121-0/+18
| | | | | | | | | | | | Commits d0782481 ("xl: export 'outstanding_pages' value from xcinfo") and bec8f17e ("xen: Remove the XENMEM_get_oustanding_pages and provide the data via xc_phys_info") added these two fields in libxl_physinfo and in libxl_dominfo, respectively, but did not include the needed LIBXL_HAVE_<foo> runes. Adding them. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
* tools/libxl: fix array subscript has type 'char'Christoph Egger2013-05-311-1/+1
| | | | Signed-off-by: Christoph Egger <chegger@amazon.de>