aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xenguest.h
Commit message (Collapse)AuthorAgeFilesLines
* tools/migrate: Fix regression when migrating from older version of XenAndrew Cooper2013-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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)
* libxc: introduce xc_map_domain_meminfo (and xc_unmap_domain_meminfo)Dario Faggioli2013-09-131-0/+17
| | | | | | | | | | | | | 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>
* xc: use XENMEM_claim_pages hypercall during guest creation.Dan Magenheimer2013-04-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | We add an extra parameter to the structures passed to the PV routine (arch_setup_meminit) and HVM routine (setup_guest) that determines whether the claim hypercall is to be done. The contents of the 'claim_enabled' is defined as an 'int' in case the hypercall expands in the future with extra flags (for example for per-NUMA allocation). For right now the proper values are: 0 to disable it or 1 to enable it. If the hypervisor does not support this function, the xc_domain_claim_pages and xc_domain_get_outstanding_pages will silently return 0 (and set errno to zero). Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v2: Updated per Ian's recommendations] [v3: Added support for out-of-sync hypervisor] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* doc: Improve xc_domain_restore inline documentationFrediano Ziglio2013-02-221-0/+2
| | | | | | Was not clear that xc_domain_restore did not resume the machine. Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
* tools/xc: turn XCFLAGS_* into shiftsOlaf Hering2013-02-151-5/+6
| | | | | | | | | to make it clear that these are bits and to make it easier to use in xend code. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* HVM firmware passthrough control tools supportRoss Philipson2013-01-101-1/+13
| | | | | | | | | | | | Xen control tools support for loading the firmware passthrough blocks during domain construction. SMBIOS and ACPI blocks are passed in using the new xc_hvm_build_args structure. Each block is read and loaded into the new domain address space behind the HVMLOADER image. The base address for the two blocks is returned as an out parameter to the caller via the args structure. Signed-off-by: Ross Philipson <ross.philipson@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* libxc: xc_domain_restore, make toolstack_restore const-correctIan Jackson2012-06-281-1/+1
| | | | | | | Update the one provider of this callback, in libxl. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Remus - suspend/postflush/commit callbacksShriram Rajagopalan2012-05-181-2/+21
| | | | | | | | | | | | | | | | | | | | | * Add libxl callback functions for Remus checkpoint suspend, postflush (aka resume) and checkpoint commit callbacks. * suspend callback is a stub that just bounces off libxl__domain_suspend_common_callback - which suspends the domain and saves the devices model state to a file. * resume callback currently just resumes the domain (and the device model). * commit callback just writes out the saved device model state to the network and sleeps for the checkpoint interval. * Introduce a new public API, libxl_domain_remus_start (currently a stub) that sets up the network and disk buffer and initiates continuous checkpointing. * Future patches will augment these callbacks/functions with more functionalities like issuing network buffer plug/unplug commands, disk checkpoint commands, etc. Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: introduce XC_SAVE_ID_TOOLSTACKStefano Stabellini2012-05-111-1/+22
| | | | | | | | Introduce a new save_id to save/restore toolstack specific extra information. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxc: add MMIO hole size parameter to xc_hvm_build()David Vrabel2012-03-011-0/+1
| | | | | | | | | | | | | | | | | Add a parameter for the MMIO hole size when building a HVM domain. This is useful for specifying a larger than normal MMIO hole to ensure that no PCIe device's MMIO region overlaps with RAM in a guest's physical address space. This is needed on certain systems with PCIe switches with a broken ACS capability. On these systems, if a device downstream of the switch attempts a DMA to a guest physical address that overlaps with the MMIO region of another downstream device, then the switch routes the transfer directly to the device and the read or write never hits RAM. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: pass arguments to xc_hvm_build() in a structureDavid Vrabel2012-03-011-10/+17
| | | | | | | | | | | | | | | To allow new parameters to be added to the xc_hvm_build*() family of functions, pass them in a structure. Make the other variants fill in the structure and call xc_hvm_build() (except for xc_hvm_build_mem() which had no users and is removed). The units of the mem_size and mem_target arguments are in bytes (not MiB like the old functions). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* lib{xc,xl}: Seed grant tables with xenstore and console grantsAlex Zeffertt2012-02-091-1/+2
| | | | | | | | | | | | | | | | | | This patch claims one reserved grant entry for the console and another for the xenstore. It modifies the builder to fill in the grant table entries for the console and the xenstore. Previous versions of this patch have been sent to xen-devel. See http://lists.xensource.com/archives/html/xen-devel/2008-07/msg00610.html http://lists.xensource.com/archives/html/xen-devel/2009-03/msg01491.html Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com> Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* tools: VM generation ID save/restore and migrate.Paul Durrant2011-12-161-2/+7
| | | | | | | | | | | | | | | Add code to track the address of the VM generation ID buffer across a save/restore or migrate, and increment it as necessary. The address of the buffer is written into xenstore by hvmloader at boot time. It must be read from xenstore by the caller of xc_domain_save() and then written back again by the caller of xc_domain_restore(). Note that the changes to xc_save.c and xc_restore.c are merely sufficient for them to build. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools/libxc: Remus Checkpoint CompressionShriram Rajagopalan2011-12-011-0/+1
| | | | | | | | | | | | | | | | | Instead of sending dirty pages of guest memory as-is, use a simple compression algorithm that sends a RLE-encoded XOR of the page against its last sent copy. A small LRU cache is used to hold recently dirtied pages. Pagetable pages are sent as-is, as they are canonicalized at sender side and uncanonicalized at receiver. [ Fixed up a conflict in sg_save_restore.h. I had to increase the ID values used from -11 and -12 to -12 and -13 because -11 had been taken by ..._HVM_VIRIDIAN in the meantime. -iwj ] Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Brendan Cully <brendan@cs.ubc.ca> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Change the name of the qemu save file at restore timeStefano Stabellini2011-01-211-0/+8
| | | | | | | | | Change the name of the qemu save file to qemu-resume at restore time so that it doesn't collide with the name of the next save file. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: convert evtchn interfaces to use an opaque handle typeIan Campbell2010-12-231-3/+3
| | | | | | | | | | | | This makes the interface consistent with the changes made to the main interface in 21483:779c0ef9682c. Also fix some references to "struct xc_interface" which should have been simply "xc_interface" in tools/xenpaging, and update QEMU_TAG to pull in the corresponding qemu change. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: cleanup domain save switch_qemu_logdirty callbackIan Campbell2010-10-211-3/+5
| | | | | | | | | | | | | | | | | Move the function into struct save_callbacks with the others and add the void *closure to the callback arguments. Add and propagate an error return code from the callback. Use this in libxl to pass the save context to libxl__domain_suspend_common_switch_qemu_logdirty allowing us to reuse the parent's xenstore handle, gc context etc. Also add an apparently missing libxl__free_all to libxl__domain_suspend_common. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* # HG changeset patchIan Campbell2010-08-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | # User Ian Campbell <ian.campbell@citrix.com> # Date 1282671421 -3600 # Node ID d1dd29a470ef1b9d2c77478a123326036dfe90bb # Parent d7a4adad9c328decbd384d87b23001aea8951b86 tools/libxc, tools/libelf: Relicense under LGPL v2.1 Relicense these two libraries under LGPL v2.1 only except where individual files already included the "or later" provision. Copyright holders have been contacted by Stephen Spector and have all agreed this change. Removed tools/libxc/ia64/aclinux.h since it appeared to be unused. There is a separate, more up to date, copy in xen/include/acpi/platform/aclinux.h which does appear to be used. Clarify the license of MiniOS privcmd.h under the same terms as other tools/include/xen-sys headers. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stephen Spector <stephen.spector@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-23/+24
| | | | | | | | | | | | | | | | | | | | This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Change the global suspend event channel lock file to a per-domain lock fileKeir Fraser2010-05-041-1/+1
| | | | | | | | This allows multiple guests to be migrated or protected by Remus simultaneously. Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Brendan Cully <brendan@cs.ubc.ca>
* xend: Memory pool for pv guest on systems with >128G memoryKeir Fraser2009-12-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | The main idea of this patch is: 1) The admin sets aside some memory below 128G for 32-bit paravirtual domain creation (via dom0_mem=-<value> in kernel comand line). 2) The admin also explicitly states to the tools (i..e xend) how much memory is supposed to be left untouched by 64-bit domains 3) If a 32-bit pv DomU gets created, no ballooning ought to be necessary (since if it is, no guarantee can be made about the address range of the memory ballooned out), and memory gets allocated from the reserved range. 4) Upon 64-bit (or 32-bit HVM or HVM) DomU creation, the tools determine the amount of memory to be ballooned out of Dom0 by adding the amount needed for the new guest and the amount still in the reserved pool (and then of course subtracting the total amount of memory the hypervisor has available for guest use). Signed-off-by: james song (wei) <jsong@novell.com>
* Remus: Add callbacks for suspend, postcopy and preresume in xc_domain_save.Keir Fraser2009-11-091-2/+15
| | | | | | This makes it possible to perform repeated checkpoints. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* Fix some issues for HVM log dirty:Keir Fraser2009-09-071-2/+1
| | | | | | | | | * Add necessary logging dirty in qemu to avoid guest error with intensive disk access when live migration * Take place of shared memory between qemu and migration tools by new added hypercall, which is clean and simple Signed-Off-By: Zhai, Edwin <edwin.zhai@intel.com>
* libxenguest: Revert domain builder interface changes for 'superpages'Keir Fraser2009-07-201-8/+3
| | | | | | | parameter, and place the flag in a pad byte of 'struct xc_dom_image' instead. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxc: Exchange a page for PV guestKeir Fraser2009-06-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch support exchange a page for a suspended PV guest from user space. The basic idea to offline a page is: 1) mark a page offline pending 2) If the page is owned by a HVM domain, user have to live migrate it. In future, with stub-domain support, we can also exchange the page without migration. 3) If the page is owned by a PV domain, we will try to exchange the offline pending page to a new one and free the old page. This patch achieves item 3. The method to exchange the offline pending page for PV domain is: 1) Suspend the guest. 2) If the page is being granted out, return with offline pending. 3) Get a copy for the content 4) Scan all page table page to see if any reference to the offending page, if yes, make the entry to be non-present to reduce the reference count. 5) After update all page tables, user space tools will try to exchange the old page. If the new mfn has no reference anymore (i.e. count_info & count_mask =3D 1), the exchange will allocate a new page, update the m2p and return success, otherwise it will return fail. 6) If step 5 is success, user space tools will update the content of the new page change the p2m table, and change all entries scaned in step 4 to point to new entry. if step failed, it will try to undo step 4 to revert page table. 7) Resume the guest. Please refer to thread in http://www.mailinglistarchive.com/xen-devel@lists.xensource.com/msg63084.html for more information. Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* libxc: export xc_map_m2p() so that it can be called outside.Keir Fraser2009-06-011-0/+13
| | | | Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* Export page offline hypercalls to user space tools.Keir Fraser2009-06-011-0/+9
| | | | Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* Add support for superpages (hugepages) in PV domainKeir Fraser2009-05-261-4/+10
| | | | | | | | | | | | | | | | | | This patch adds the option "superpages" to the domain configuration file. If it is set, the domain is populated using 2M pages. This code does not support fallback to small pages. If the domain can not be created with 2M pages, the create will fail. The patch also includes support for saving and restoring domains with the superpage flag set. However, if a domain has freed small pages within its physical page array and then extended the array, the restore will fill in those freed pages. It will then attempt to allocate more than its memory limit and will fail. This is significant because apparently Linux does this during boot, thus a freshly booted Linux image can not be saved and restored successfully. Signed-off-by: Dave McCracken <dcm@mccr.org>
* Move the suspend event channel function to libxc, it will use theKeir Fraser2009-03-181-0/+6
| | | | | | /var/lib/xen/suspend_evtchn_lock.d to protect the access. Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
* PoD memory 8/9: libxc interfaceKeir Fraser2009-01-051-0/+6
| | | | | | | | | | | | | Implement libxc interface to PoD functionality: * Add xc_hvm_build_target_mem(), which takes both memsize and target. Memsize is the total memory, allocated in PoD pages and reported in the e820; target is the size of the cache. If these are the same, the normal funcitonality is called. (So you can use the same function to build always, and it will decide whether to use PoD or not.) * Add xc_domain_memory_[gs]et_pod_target(), which sets and/or returns information about the PoD cache and p2m entries. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xc_save: Clean up (*suspend)() callback hook.Keir Fraser2008-09-081-1/+1
| | | | Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
* Remove defunct powerpc port.Keir Fraser2008-05-081-14/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* HVM: First attempt at domain-resume on save-failure.kfraser@localhost.localdomain2007-04-121-5/+0
| | | | | | | Not working yet as we are a bit too keen to kill the qemu-dm process, before we know that the save has been successful. Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM] Save/restore: merge xc_linux_save and xc_hvm_saveTim Deegan2007-04-111-13/+6
| | | | | | | | into xc_domain_save, like we did for xc_domain_restore Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com> --HG-- rename : tools/libxc/xc_linux_save.c => tools/libxc/xc_domain_save.c
* [HVM] Save/restore: merge xc_linux_restore and xc_hvm_restoreTim Deegan2007-04-051-15/+7
| | | | | | | | into one function (and one file) since they share a lot of code Signed-off-by: Tim Deegan <Tim.Deegan@øensource.com> --HG-- rename : tools/libxc/xc_linux_restore.c => tools/libxc/xc_domain_restore.c
* Clean up save/restore state record handling. No need for Python tokfraser@localhost.localdomain2007-04-041-3/+0
| | | | | | read out the 'p2m size' field. Also that field is not needed at all for HVM guests. Signed-off-by: Keir Fraser <keir@xensource.com>
* hvm: Lazy memory allocation during HVM restore. General cleanup andkfraser@localhost.localdomain2007-04-041-4/+4
| | | | | reduce gross assumptions about memory-map layout. Signed-off-by: Keir Fraser <keir@xensource.com>
* Remove hvm_drain_io() hypercall, simplify qemu main loop and do notkfraser@localhost.localdomain2007-04-041-2/+0
| | | | | | pause the domain on reboot (not necessary and defeats new deferred shutdown logic). Signed-off-by: Keir Fraser <keir@xensource.com>
* Some save/restore cleanups.Steven Hand2007-04-021-4/+5
| | | | Signed-off-by: Steven Hand <steven@xensource.com>
* [HVM][QEMU] Save/restore: enable HVM live migrationTim Deegan2007-03-161-2/+4
| | | | | by getting page-dirtying bitmaps from qemu-dm as well as from xen. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Save/restore: tidy PFN handling in the tools.Tim Deegan2007-03-081-0/+1
| | | | | | Make the differences clearer between the number of frames, the max PFN and the size of the pfn array, and handle te framebuffer more cleanly. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Save/restore: make sure all ioreqs are gone when a domain is savedTim Deegan2007-03-081-0/+2
| | | | | by pausing the domain and pulling them through. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* Write Xen ELF notes into xenstore on domain build.kfraser@localhost.localdomain2007-02-261-0/+14
| | | | Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
* Merge with xenppc-unstable.hgkfraser@localhost.localdomain2007-02-141-3/+2
|\
| * [HVM] Save/restore: disentangle max_pfn from nr_pages.Tim Deegan2007-02-091-1/+1
| | | | | | | | | | | | | | These have been used interchangeably, which is OK for PV domains but not for HVM. This fixes an over-allocation by 256MB when restoring HVM guests that have more than 4GB of RAM. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
| * [HVM] Save/restore: don't try to set the console ring MFNTim Deegan2007-02-081-2/+1
| | | | | | | | | | | | in a HVM restore. In particular, don't print an uninitialized stack variable, which causes XMLRPC exceptions in xend. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* | [POWERPC][XEN] Fix mismerge.Hollis Blanchard2007-02-071-0/+14
| |
* | [POWERPC][XEN] Merge with xen-unstable.hg.Hollis Blanchard2007-02-061-0/+20
|\| | | | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
| * [HVM] save restore: frame workTim Deegan2007-01-181-0/+20
| | | | | | | | | | | | Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> frame work for HVM save restore in Control Panel
* | [XEND][POWERPC] Remove FlatDeviceTree.py, eliminate devtree from prose builder.Jimi Xenidis2007-01-211-14/+0
| | | | | | | | | | Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>