aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* libxc: fix memory leak in load_p2m_frame_list error handlingMatthew Daley2013-09-251-0/+1
| | | | | | Coverity-ID: 1055885 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* gdbsx: clear sockaddr before using itMatthew Daley2013-09-211-0/+1
| | | | | | | | ...so that sin_zero is actually zero. Coverity-ID: 1056070 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* x86_emulate: fix flag setting for 8-bit signed multiplicationJan Beulich2013-09-201-0/+2
| | | | | | | | | | | | | | | We really need to check for a signed overflow of 8 bits, while the previous check compared the sign-extended 8-bit result with the zero-extended 16-bit one (which was wrong for all negative results). Once at it - also adjust the 16-bit comparison for symmetry - improve the 8-bit multiplication (no need to zero-extend to 32-bits the sign-extended to 16 bits original 8-bit value) - fold both signed multiplication variants Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86_emulate: MOVSXD must read source operand just onceJan Beulich2013-09-201-4/+62
| | | | | | | | | | | | ... for the case of accessing MMIO. Also streamline the ARPL emulation a little, and add tests for both instructions (the MOVSXD one requires a few other adjustments, as we now need to run in a mode where the emulator's mode_64bit() returns true). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: fix dependencies of emulator testJan Beulich2013-09-201-6/+5
| | | | | | | | | | | | Rather than mentioning the (linked) directory, mention the files thus making sure things get rebuild as needed when the core emulator files change. Also enable debug info generation unconditionally, as this is testing stuff only anyway. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* tools: print xm deprecation warning to stderrIan Campbell2013-09-191-2/+2
| | | | | | To avoid confusing anything which is parsing the output. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* tools: disable xend build by defaultIan Campbell2013-09-174-4/+57
| | | | | | | | | | Add big warnings to configure, xend initscript and xm. The big xm warning is displayed once (per boot, or per tmpreaper clean), afterwards a single line warning is displayed. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/hotplug: set mtu from bridge for tap interfaceCharles Arnold2013-09-172-5/+12
| | | | | | | | | | | | | With changeset 22885 support was added for setting the MTU in the vif-bridge script for when a vif interface was set to 'online'. The was not done for the 'add' operation. The 'add' operation was added to the script for when tap devices were specified (c/s 21944). With the setting of the MTU for the 'online' case was there a reason for omitting the 'add'? This patch sets the MTU for both 'online' and 'add' in the vif-bridge script. Signed-off-by: Charles Arnold <carnold@suse.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-162-12/+10
| | | | | This reverts commit 11a63a1660453269ddd1893c15d0a98133b33ca7. The change causes issues with live migration.
* xen-mfndump: Use inttypes.h to format uint64_t types.Ian Campbell2013-09-141-2/+3
| | | | | | | | | | | | Fixes 32-bit build: cc1: warnings being treated as errors xen-mfndump.c: In function 'dump_ptes_func': xen-mfndump.c:236: error: format '%lx' expects type 'long unsigned int', but argument 3 has type 'uint64_t' xen-mfndump.c: In function 'lookup_pte_func': xen-mfndump.c:305: error: format '%lx' expects type 'long unsigned int', but argument 5 has type 'uint64_t' Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* 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>
* xenstored: fix possible, but unlikely, stack overflowMatthew Daley2013-09-131-1/+1
| | | | | | | | | ...when reading xenbus port from xenfs. Coverity-ID: 1055741 Signed-off-by: Matthew Daley <mattjd@gmail.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* kdd: fix free of array-typed valueMatthew Daley2013-09-131-1/+0
| | | | | | | | | | g->id is an array and is allocated as part of g itself; it's not a separate allocation. Coverity-ID: 1054980 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Tim Deegan <tim@xen.org> Reviewed-by: Andrew Cooper <andrew.cooper3@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>
* xenstat: Fix buffer over-run with new_domains being negative.Konrad Rzeszutek Wilk2013-09-131-5/+9
| | | | | | | | | | | | | Coverity identified this as: CID 1055740 Out-of-bounds read - "In xenstat_get_node: Out-of-bounds read from a buffer (CWE-125)" And sure enough, if xc_domain_getinfolist returns us -1, we will try to use it later on in the for (i = 0; i < new_domains; ..) loop. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
* tools/misc: introduce xen-mfndump.Dario Faggioli2013-09-132-2/+430
| | | | | | | | | | | | | | | | | | | | | | A little development and debugging tool, useful when looking for information about MFN to PFN mappings, MFN/PFN mappings in a guest's PTEs, etc. This is what it can do as of now: $ /usr/sbin/xen-mfndump Usage: xen-mfndump <command> [args] Commands: help show this help dump-m2p show M2P dump-p2m <domid> show P2M of <domid> dump-ptes <domid> <mfn> show the PTEs in <mfn> lookup-pte <domid> <mfn> find the PTE mapping <mfn> memcmp-mfns <domid1> <mfn1> <domid2> <mfn2> (str)compare content of <mfn1> & <mfn2> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: introduce xc_map_domain_meminfo (and xc_unmap_domain_meminfo)Dario Faggioli2013-09-134-155/+183
| | | | | | | | | | | | | And use it in xc_exchange_page(). This is basically because the following change need something really similar to the set of steps that are here abstracted in these two functions. Despite of the change in the interface and in the signature of some functions, this is pure code motion. No functional changes involved. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: allow for ctxt to be NULL in xc_vcpu_setcontextDario Faggioli2013-09-131-6/+0
| | | | | | | | | Since, as can be seen in xen/common/domctl.c, that is legitimate (it results in Xen calling vcpu_reset() on the vcpu). Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: use xc_vcpu_getinfo() instead of calling do_domctl()Dario Faggioli2013-09-133-18/+14
| | | | | | | | | The wrapper is there already, so better use it in place of all the stuff required to issue a call to do_domctl() for XEN_DOMCTL_getdomaininfo. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: use xc_vcpu_setcontext() instead of calling do_domctl()Dario Faggioli2013-09-132-15/+5
| | | | | | | | | | The wrapper is there already, so better use it in place of all the stuff required to issue a call to do_domctl() for XEN_DOMCTL_setvcpucontext. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: introduce xc_domain_get_guest_width()Dario Faggioli2013-09-1310-78/+48
| | | | | | | | | | | | | | As a wrapper to XEN_DOMCTL_get_address_size, and use it wherever the call was being issued directly via do_domctl(), saving quite some line of code. Actually, the function returns the guest width in bytes, rather than directly what XEN_DOMCTL_get_address_size provides (which is a number of bits), since that is what it is useful almost everywhere. Signed-off-by: Dario Faggioli <dario.faggioli@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-132-10/+12
| | | | | | | | | | | | | | | | | 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>
* libxc/x86: fix page table creation for huge guestsJan Beulich2013-09-121-8/+16
| | | | | | | | | | | The switch-over logic from one page directory to the next was wrong; it needs to be deferred until we actually reach the last page within a given region, instead of being done when the last entry of a page directory gets started with. Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: ocaml: fix code intended to output comments before definitionsRob Hoes2013-09-101-2/+4
| | | | | | | | | I'm not sure how useful these comments actually are but erred on the side of fixing rather than removing. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Rob Hoes <rob.hoes@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>
* libxc/pm: Fix NULL pointer checks.Andrew Cooper2013-09-101-7/+7
| | | | | | | | | | | | | | | | Discovered by Coverity, CIDs 1054968 1054969 1054970 1054971 1054972 1054973 10549704 This was broken by c/s 5cc436c1d2b3b0 which did a blanket change of 'int xc_handle' -> 'xc_interface *xch'. The types got updated, but error conditions were left as-were. (I suspect some sed was involved originally) Also while playing around in this area, fix up some of the bracketing style to match the Xen coding style. 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>
* configure: Regenerate with autoconf 2.69Ian Campbell2013-09-092-302/+336
| | | | | | | | | | | This is the version from Debian Wheezy which is what both Ian Jackson and myself run on our workstations. As committers it is useful to minimise regeneration noise. This is purely a run of autogen.sh. I have not tried to build the result. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Ian Jackson <ian.jackson@citrix.com>
* tools: allow user to specify a system seabios binaryFabio Fantoni2013-09-094-1/+36
| | | | | | | | | If this option is given don't bother building seabios ourselves. Likely to be handy for distros who have an existing seabios package which they want to reuse. Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* tools: build debug qemu-xen in debug tools buildsMatthew Daley2013-09-091-0/+7
| | | | | | | | When building tools in debug mode (debug=y), pass --enable-debug when configuring qemu-xen to enable some debug support (namely, to prevent symbols from being stripped). Signed-off-by: Matthew Daley <mattjd@gmail.com>
* hotplug/Linux: add sysconfig tags to xencommonsOlaf Hering2013-09-091-0/+16
| | | | | | | | | YaST2 sysconfig can logically group the various sysconfig settings if the files are tagged. Add the missing (YaST specific) tags to xencommons. See for a description http://old-en.opensuse.org/Packaging/SUSE_Package_Conventions/Sysconfig Signed-off-by: Olaf Hering <olaf@aepfle.de>
* hvmloader: fix SeaBIOS interfaceJan Beulich2013-09-054-7/+7
| | | | | | | | | | | | | | | The SeaBIOS ROM image may validly exceed 128k in size, it's only our interface code that so far assumed that it wouldn't. Remove that restriction by setting the base address depending on image size. Add a check to HVM loader so that too big images won't result in silent guest failure anymore. Uncomment the intended build-time size check for rombios, moving it into a function so that it would actually compile. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libvhd: use UTC for VHD timestampWei Liu2013-09-031-24/+9
| | | | | | | | | | | | | | | | | | | | | | | [ported from xapi-project/blktap a79ac2c05f9 ("XOP-289: use UTC for VHD timestamps")] Currently, the local timezone is factored into VHD timestamps due to the use of mktime(). This breaks "vhd-util check" for VHDs created in one timezone and then moved westward, which results in "primary footer invalid: creation time in future" errors. Signed-off-by: Andrei Lifchits <andrei.lifchits@citrix.com> Andrei no longer works for Citrix but Germano Percossi (ex-colleague of Andrei) contacted Andrei and confirmed that 1) this work was written on Citrix time, 2) it is OK to have Andrei's SoB. Remove unused variable "tm". Signed-off-by: Germano Percossi <germano.percossi@citrix.com> Signed-off-by: Wei Liu <wei.liu2@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>
* xend: fix file descriptor leak in pci utilitiesXi Xiong2013-09-031-0/+6
| | | | | | | | | | A file descriptor leak was detected after creating multiple domUs with pass-through PCI devices. This patch fixes the issue. Signed-off-by: Xi Xiong <xixiong@amazon.com> Reviewed-by: Matt Wilson <msw@amazon.com> [msw: adjusted commit message] Signed-off-by: Matt Wilson <msw@amazon.com>
* xend: handle extended PCI configuration space when saving stateSteven Noonan2013-09-031-1/+2
| | | | | | | | | | | | | | Newer PCI standards (e.g., PCI-X 2.0 and PCIe) introduce extended configuration space which is larger than 256 bytes. This patch uses stat() to determine the amount of space used to correctly save all of the PCI configuration space. Resets handled by the xen-pciback driver don't have this problem, as that code correctly handles saving extended configuration space. Signed-off-by: Steven Noonan <snoonan@amazon.com> Reviewed-by: Matt Wilson <msw@amazon.com> [msw: adjusted commit message] Signed-off-by: Matt Wilson <msw@amazon.com>
* hvmloader/smbios: Correctly count the number of tables writtenAndrew Cooper2013-08-301-1/+2
| | | | | | | | | | | | Fixes regression indirectly introduced by c/s 4d23036e709627 That changeset added some smbios tables which were option based on the toolstack providing appropriate xenstore keys. The do_struct() macro would unconditionally increment nr_structs, even if a table was not actually written. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: AVX instruction emulation fixesJan Beulich2013-08-281-6/+138
| | | | | | | | | | | | | | | | | | | - we used the C4/C5 (first prefix) byte instead of the apparent ModR/M one as the second prefix byte - early decoding normalized vex.reg, thus corrupting it for the main consumer (copy_REX_VEX()), resulting in #UD on the two-operand instructions we emulate Also add respective test cases to the testing utility plus - fix get_fpu() (the fall-through order was inverted) - add cpu_has_avx2, even if it's currently unused (as in the new test cases I decided to refrain from using AVX2 instructions in order to be able to actually run all the tests on the hardware I have) - slightly tweak cpu_has_avx to more consistently express the outputs we don't care about (sinking them all into the same variable) Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* tools: drop VT-i exampleJan Beulich2013-08-272-181/+0
| | | | | | ... as being another IA64 leftover. Signed-off-by: Jan Beulich <jbeulich@suse.com>
* pygrub: add Debian extlinux.conf pathIan Campbell2013-08-271-0/+1
| | | | | | | | | This is Debian bug #697407. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697407 Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: allow user to specify a system qemu-xen binaryIan Campbell2013-08-215-2/+76
| | | | | | | | 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>