Commit Graph
90 Commits
Author SHA1 Message Date
aec0a31ffe Introduce git-checkout.sh
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Introduce a script to perform git checkout on an external git tree; use
git-checkout.sh in ioemu-dir-find.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-01-24 15:09:29 +00:00
Stefano Stabellini 079ff2d32c libelf-loader: introduce elf_load_image
Implement a new function, called elf_load_image, to perform the
actually copy of the elf image and clearing the padding.  The function
is implemented as memcpy and memset when the library is built as part
of the tools, but it is implemented as raw_copy_to_guest and
raw_clear_guest when built as part of Xen, so that it can be safely
called with an HVM style dom0.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-23 09:42:12 +00:00
Stefano Stabellini 7b8c36701d Introduce clear_user and clear_guest
Introduce clear_user for x86 and ia64, shamelessly taken from Linux.
The x86 version is the 32 bit clear_user implementation.  Introduce
clear_guest for x86 and ia64. The x86 implementation is based on
clear_user and a new clear_user_hvm function.  The ia64 implementation
is actually in xencomm and it is based on xencomm_copy_to_guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-23 09:41:27 +00:00
Stefano Stabellini 02a5923251 xen: implement an signed 64 bit division helper function
Implement a C function to perform 64 bit signed division and return
both quotient and remainder.
Useful as an helper function to implement __aeabi_ldivmod.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-23 09:40:35 +00:00
Stefano Stabellini d4acf6380c A collection of fixes to Xen common files
- call free_xenoprof_pages only ifdef CONFIG_XENOPROF;
- define PRI_stime as PRId64 in an header file;
- respect boundaries in is_kernel_*;
- implement is_kernel_rodata;
- guest_physmap_add_page should be ((void)0).
- fix guest_physmap_add_page;
- introduce CONFIG_XENOPROF;
- define _srodata and _erodata as const char*.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-23 09:39:58 +00:00
Stefano Stabellini 16c97203f1 Include some header files that are not automatically included on all archs
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-23 09:39:11 +00:00
Stefano Stabellini 03a4bcf085 Move cpufreq option parsing to cpufreq.c
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-23 09:38:34 +00:00
Stefano Stabellini 004d103be6 docs: xl.pod.1: introduction to FLASK
Add a simple introduction to FLASK to the xl man page, at the beginning
of the FLASK chapter. Link to the xsm-flask.txt document.
Currently FLASK, TMEM and PCI PASS-THROUGH are defined as =head2 so they
look like sub-chapters of VIRTUAL DEVICE COMMANDS. Make them =head1.

Based on a text written by Daniel De Graaf.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-10 16:13:06 +00:00
Stefano Stabellini ca3a3fefd2 xl.pod.1: add a note about autoballoon and dom0_mem
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:36 +00:00
Stefano Stabellini 04b3a805b9 xl.pod.1: add a refence to http://wiki.xen.org/xenwiki/ReportingBugs
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:36 +00:00
Stefano Stabellini b58d71d2b1 xl.pod.1: remove AUTHORS section
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:35 +00:00
Stefano Stabellini 747a54427a xl.pod.1: improve description of virtual device subcommands
Add a reference to xl-disk-configuration and xl-network-configuration.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:35 +00:00
Stefano Stabellini d3bbc3bef6 xl.pod.1: remove dry-run option from create and cpupool-create
there is already a global dry-run option, there is no point in adding
another one for each subcommand

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:35 +00:00
Stefano Stabellini e1509f2fd3 xl.pod.1: improve the description of pci-list-assignable-devices
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:34 +00:00
Stefano Stabellini ceb314efcc xl.pod.1: improve the description of the info subcommand
also update the example

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:34 +00:00
Stefano Stabellini 800b7341de xl.pod.1: improve the debug-keys subcommand description
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:34 +00:00
Stefano Stabellini d3ad54f021 xl.pod.1: introduce a TO BE DOCUMENTED section
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:33 +00:00
Stefano Stabellini 1cf61afb54 xl.pod.1: state when a subcommand is only available to HVM guests
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:33 +00:00
Stefano Stabellini 9ac72c8942 xl.pod.1: better description for the sysreq subcommand
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:32 +00:00
Stefano Stabellini 83e766a0fe xl.pod.1: state when a command requires PV drivers installed
Remove an old incorrect comment about vcpu-set requiring cooperation
from the guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:32 +00:00
Stefano Stabellini 49a2d806a8 xl.pod.1: add a reference to create in the -e option
Add a reference to the create subcommand in the description of
the -e option to unpause and migrate.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:32 +00:00
Stefano Stabellini 6e6b6df003 xl.pod.1: remove the two FIXME
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:31 +00:00
Stefano Stabellini 23258d81dd xl.pod.1: order subcommands alphabetically
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:31 +00:00
Stefano Stabellini 5139b55829 xl.pod.1: add a description of the global options
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:31 +00:00
Stefano Stabellini 32d8a04e72 xl.pod.1: improve create documentation
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:30 +00:00
Stefano Stabellini 239654bb1e xl.pod.1: add a description of console options
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:30 +00:00
Stefano Stabellini 30df9d465c xl.pod.1: add a barebone description of tmem commands
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-12-01 16:26:30 +00:00
Stefano Stabellini ebbd2561b4 libxl: Add a vkbd frontend/backend pair for HVM guests
Linux PV on HVM guests can use vkbd, so add a vkbd frontend/backend
pair for HVM guests by default.  It is useful because it doesn't
require frequent qemu wakeups as the usb keyboard/mouse does.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-11-22 16:19:48 +00:00
Stefano Stabellini 6e78f81a27 hvm: introduce HVM_PARAM_BUFIOREQ_EVTCHN
Introduce an event channel for buffered io event notifications,
advertise the port number using an hvm param.  This way the device
model is not forced to check the buffered io page for data several
times a second for the entire life of the VM (buffered io is mostly
used for stdvga emulation in Xen that is switched off after the guest
goes into graphical mode).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-16 15:17:37 +00:00
Stefano Stabellini 5c7aad5247 docs: introduce an xl man page in pod format
This is the initial version of an xl man page, based on the old xm man
page.  Almost every command implemented in xl should be present, a
notable exception are the tmem commands that are currently missing.
Further improvements and clarifications to this man page are very
welcome.

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>
2011-11-01 18:44:34 +00:00
Stefano Stabellini b96a29f785 x86: re-inject emulated level pirqs in PV on HVM guests if still
asserted

PV on HVM guests can loose level interrupts coming from emulated
devices if they have been remapped onto event channels.  The reason is
that we are missing the code to inject a pirq again in the guest when
the guest EOIs it, if it corresponds to an emulated level interrupt
and the interrupt is still asserted.

Fix this issue and also return error when the guest tries to get the
irq_status of a non-existing pirq.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-10-27 16:07:18 +01:00
Stefano Stabellini 2569814496 xen: if mapping GSIs we run out of pirq < nr_irqs_gsi, use the others
PV on HVM guests can have more GSIs than the host, in that case we
could run out of pirq < nr_irqs_gsi. When that happens use pirq >=
nr_irqs_gsi rather than returning an error.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Benjamin Schweikert <b.schweikert@googlemail.com>
2011-09-13 10:32:24 +01:00
Stefano Stabellini cee3fd7bb8 Clone and build Seabios by default
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:30:09 +01:00
Stefano Stabellini 9233be8d2c Clone and build upstream Qemu by default
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:29:14 +01:00
Stefano Stabellini 145854fa0d Rename ioemu-dir as qemu-xen-traditional-dir
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:27:53 +01:00
Stefano Stabellini 088276d615 Move the ioemu-dir-find shell script to an external file
Add support for configuring upstream qemu and rename ioemu-remote
ioemu-dir-remote.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:27:20 +01:00
Stefano Stabellini 1aa9c4f626 xen: get_free_pirq: make sure that the returned pirq is allocated
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-08-31 15:23:49 +01:00
Stefano Stabellini a7ffe0fdec xen: __hvm_pci_intx_assert should check for gsis remapped onto pirqs
If the isa irq corresponding to a particular gsi is disabled while the
gsi is enabled, __hvm_pci_intx_assert will always inject the gsi
through the violapic, even if the gsi has been remapped onto a pirq.
This patch makes sure that even in this case we inject the
notification appropriately.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-08-31 15:23:34 +01:00
Stefano Stabellini 79858fee30 xen: fix hvm_domain_use_pirq's behavior
hvm_domain_use_pirq should return true when the guest is using a
certain pirq, no matter if the corresponding event channel is
currently enabled or disabled.  As an additional complication, qemu is
going to request pirqs for passthrough devices even for Xen unaware
HVM guests, so we need to wait for an event channel to be connected
before considering the pirq of a passthrough device as "in use".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-08-31 15:23:12 +01:00
Stefano Stabellini f4766463d4 libxl: Fix segfault in get_all_assigned_devices
pcidevs is an array of ndev elements (ndev is the number of pci devices
assigend to a specific domain), but we access pcidevs + *num
where *num is the global number of pci devices assigned so far to all
domains in the system.

Fix the issue removing pcidevs and just realloc'ing *list every time we
want to add a new pci device to the array.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-14 15:49:49 +01:00
Stefano Stabellini ef75d43042 libxl: always set list out parameter of libxl_device_pci_list_assigned
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-06-21 17:35:57 +01:00
Stefano Stabellini f903829902 pv-on-hvm: hvm_domain_use_pirq return positive no matter if the evtchn is bound
This patch fixes PV on HVM interrupt remapping with recent Linux
kernels and upstream qemu.  hvm_domain_use_pirq should return positive
even if the evtchn is not currently bound. If it doesn't assert_irq
ends up injecting legacy interrupts even after the guest disabled the
irq.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-06-16 16:17:35 +01:00
Stefano Stabellini 5a6a776a65 libxl: libxl_domain_setmaxmem: actually call xc_domain_setmaxmem
Currently libxl_domain_setmaxmem doesn't do anything, but it should call
xc_domain_setmaxmem to enforce the new "xen maximum" target for the
domain (see tools/libxl/libxl_memory.txt).

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>
2011-05-26 15:05:47 +01:00
Stefano Stabellini 037f0cea24 libxl: fix initialization of the disk parsing iterator
Fix the initialization of the disk parsing iterator.

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>
2011-05-24 18:33:06 +01:00
Stefano Stabellini 29d533f5f5 x86: Check for valid pirq values in hvm_domain_use_pirq
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-05-12 16:42:54 +01:00
Stefano Stabellini b5bf4eedb4 x86/hvm: pv-on-hvm: fix de/assert_irq checks
The checks in assert_irq and deassert_irq to distinguish interrupts
that have been remapped onto event channels from the others that have
to be injected using the emulated lapic are wrong.

Fix the condition checks using the convenient hvm_domain_use_pirq
function.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-05-12 09:15:05 +01:00
Stefano Stabellini 8d5a53c1fa libxl: do not try to use blktap with qdisk
libxl_device_disk_add tries to use blktap when available even for qdisk
devices, this patch fixes it.

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>
2011-03-11 18:22:23 +00:00
Stefano Stabellini 44a953192a update README
update README: we are missing few compile time dependencies and a link
to the pvops kernel page on the wiki.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-10 18:11:31 +00:00
Stefano Stabellini 8f53c184ea libxl: introduce flexarray_append_pair
Introduce flexarray_append_pair: a simple syntactic sugar to add a pair
of pointers to a flexarray, very useful when adding pairs of strings to
xenstore.

Replace flexarray_vappend calls (and one pair of flexarray_append)
with flexarray_append_pair calls when dealing with flexarrays that are
going to be used with libxl__xs_kvs_of_flexarray:

NULL is a valid pointer value in these cases while flexarray_vappend
uses NULL as vargs terminator, so the old code is buggy.

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>
2011-03-09 17:03:34 +00:00
Stefano Stabellini 832085e21c xl: fix tap:aio disk parsing
Fix "tap:aio" parsing in xl after 22921

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-25 18:41:34 +00:00
Stefano Stabellini 69ec10d36a x86 NMI: continue in case of PCI SERR erros
Memory parity error is only valid for IBM PC-AT, newer machines use
bit 7 (0x80) of 0x61 port for PCI SERR. While memory errors are
usually reported via MCE.

Rename the memory parity error handler to pci serr handler and
print a warning and continue instead of crashing.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-02-25 11:29:45 +00:00
Stefano Stabellini b9ef3bf4e1 libxl: fix cd insert/eject
When multiple disks are passed to libxl_wait_for_disk_ejects, watch the
correct disk paths.

Parse the backend type and backend domid from xenstore in
libxl_event_get_disk_eject_info.

libxl_event_get_disk_eject_info must return a valid string in
disk->vdev, while at the moment is free'ed before returning.

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>
2011-02-18 15:04:19 +00:00
Stefano Stabellini 0cfffb1f9e libxl: remove the entries from xenstore when destroying a disk
Currently we are only changing the backend state but it is not enough to
entirely destroying a disk device: remove all the entries from xenstore
as well.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:50:44 +00:00
Stefano Stabellini 7b289f9e42 libxl: create xenstore backend for empty disks
We still need to create the vbd backend in xenstore even if the disk
format is DISK_FORMAT_EMPTY.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:49:57 +00:00
Stefano Stabellini 1c0d8c69ec xl: fix cdrom_insert parsing
Reuse the same code used to parse the disk line from the VM config file
in cd_insert.

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>
2011-02-17 19:49:00 +00:00
Stefano Stabellini 8f4208be5d xl daemon: fix some memory leaks
If we are watching multiple disks we have to free multiple waiters.

Free the event before continuing the loop.

Destroy the disk device returned by libxl_event_get_disk_eject_info.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:12:45 +00:00
Stefano Stabellini 7a52b5c131 libxl: implement trigger s3resume
This is the equivalent of xm trigger s3resume and it is implemented the
same way: using an ACPI state change.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-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>
2011-02-14 16:49:03 +00:00
Stefano Stabellini 33c82cfa48 libxl: do not call libxl__file_reference_unmap twice
Fix double free due to libxl__file_reference_unmap(&info->kernel) called
multiple times: first at the end of libxl__domain_build and then in
libxl_domain_build_info_destroy.

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>
2011-02-11 17:53:08 +00:00
Stefano Stabellini ec5fb67597 libxl: fix console autoconnect with pygrub, by invoking xenconsole twice
When using pygrub we have to connect to the console twice: once at the
beginning to connect to pygrub and a second time after creating the pv
console to connect to the guest's console.

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>
2011-02-04 18:29:55 +00:00
Stefano Stabellini 3ddd6a650b The current libxl_set_memory_target function subtracts a negative amount
from an uint32_t variable without checking if the operation wraps
around.

This patch fixes this bug (that I previously believed to be an
hypervisor issue):
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1729

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>
2011-02-01 19:25:08 +00:00
Stefano Stabellini 3146a8a802 libxl: when using pygrub, do not segfault if no blktap
Running xl create configfile where configfile includes the lines
   bootloader = "/usr/bin/pygrub"
   disk = [ 'file:/dev/mapper/vg0-partname,xvda1,w' ]
then xl segfaults at the line
     ret = strdup(dev);
of libxl_device_disk_local_attach() in tools/libxl/libxl.c . The
problem is that dev is not set if libxl__blktap_enabled(&gc) is false
or if phystype isn't recognized.  In the latter case we want to skip
that line and return NULL, but if libxl__blktap_enabled(&gc) is false
we should be returning something, at least in the cases where the
device has a name in the host which we can just refer to.

Also improve the error message when QCOW or QCOW2 are specified, and
avoid using an uninitialised value of "ret".

Signed-off-by: M A Young <m.a.young@durham.ac.uk>
Signed-off-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-28 16:54:13 +00:00
Stefano Stabellini 6c7a8976c4 libxl: fix segfault on device assignement
Fix a xl/libxl segfault when assigning a device to the guest (bug
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1713).

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-25 18:22:09 +00:00
Stefano Stabellini 62c2a1d098 libxl/xl: support empty disk paths (ejected cdroms)
Support empty disk paths, including in domain config files, for
compatibility with xend.  This allows a domain to be created with a
cdrom which is initially in the "ejected" (no cd present) state.

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>
2011-01-25 18:06:53 +00:00
Stefano Stabellini 648429dc40 libxl, minios: stubdom console based save/restore
Add two "special" PV consoles to stubdoms that are going to be used
to send and receive the qemu-xen save files on save/restore.

Use the second PV console to send the qemu-xen save file and the third
PV console to receive the qemu-xen save file on restore.

Fix the console shutdown function free_consfront that is called when the
qemu save file is closed.

Stubdom save/restore is still broken with xend.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-21 18:06:23 +00:00
Stefano Stabellini 1b1d0b8b75 tools: Change the name of the qemu save file at restore time
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>
2011-01-21 17:57:31 +00:00
Stefano Stabellini 09ccf42995 libxl: return "tap" as backend type for PHYSTYPE_QCOW2
Return "tap" as backend type for PHYSTYPE_QCOW2.  This arranges that
qcow2 disks should work in xl.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-14 19:28:25 +00:00
Stefano Stabellini cd55de70ca libxl: do not assume target and freemem-slack are written at the same time
This improves robustness in some pathological configurations.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-14 19:04:03 +00:00
Stefano Stabellini daf41b00bf libxl: introduce libxl_need_xenpv_qemu
Introduce libxl_need_xenpv_qemu to detect if the caller needs to create
a pv qemu instance (using libxl_create_xenpv_qemu).
A positive reply depends on the number of pv console and vfbs, and the
type of disk backends.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-14 18:55:53 +00:00
Stefano Stabellini 46d89e453b libxl, xl: Account for shadow memory for PV guests too
We need to account for the memory needed by shadow pagetables even for PV
guests, because in that case shadow pagetables are used during live
migration.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-23 19:25:00 +00:00
Stefano Stabellini d51d277c9b tools/libxl: use qdisk if blktap2 is not available
Whenever blktap2 is not available use qdisk as block backend instead.

[ This feature will only work with the relevant changesets from
  qemu-xen-unstable, recently applied.  -iwj ]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-11-23 19:23:22 +00:00
Stefano Stabellini a39b5bc64b libxl: Introduce a maximum limit for free_mem_slack (re (dom0) ballooning)
This fixes this message:
 libxl: error: libxl.c:2921:libxl_set_memory_target new target
               for dom0 is below the minimum threshold
which can occur spuriously if dom0_mem is specified and xl
autoballoning is left turned on.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-23 19:01:37 +01:00
Stefano Stabellini 2b989e000b xl: parse maxmem parameter in VM config files
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 18:04:11 +01:00
Stefano Stabellini ceb6e18f15 libxl: proper accounting for the videoram
Remove the videoram from the memory target of the domains consistently,
leave the total amount of memory in maxmem.

[fixed up for conflicts with libxl__ naming policy changes -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 18:03:41 +01:00
Stefano Stabellini ea4dce89d4 xl: free memory before building a domain
Free the needed amount of memory before proceeding with the domain
build.

Use a filelock to prevent other xl instances from conflicting during
this operation.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 18:02:36 +01:00
Stefano Stabellini 52bf5773ab Config.mk et al: introduce XEN_LOCK_DIR
Introduce a OS dependent global variable XEN_LOCK_DIR that points at the
system directory that contains lock files.

[fixed up for conflict in Config.mk -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:52:34 +01:00
Stefano Stabellini 73c54d46b1 xl: add a global configuration file
Add a global configuration file: /etc/xen/xl.conf; the only option
currently parsed is autoballoon that is 1 by default.

[fixed up for conflicts with libxl__ naming policy changes -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:42:01 +01:00
Stefano Stabellini 9825666445 libxl: introduce the concept of dom0 minimum memory
Introduce a minimum value for the memory assigned to dom0.

[fixed up for conflicts with libxl__ naming policy changes -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:40:44 +01:00
Stefano Stabellini 7010e9b7e4 libxl: add few more memory operations
libxl_domain_need_memory: calculate how much memory a domain needs in
order to be built and start correctly.

libxl_get_free_memory: calculate the total free memory in the system.

libxl_wait_for_free_memory: wait for a certain amount of memory to
become free in the system.

libxl_wait_for_memory_target: wait for a domain to reach its memory
target.

[fixed up for conflicts with libxl__ naming policy changes -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:39:32 +01:00
Stefano Stabellini 038955aa3b libxl: add a "relative" parameter to libxl_set_memory_target
Introduce a relative parameter to flag that target_memkb is a relative
amount of memory.  The first time we are reading/writing dom0 memory
target, fill the informations in xenstore if they are missing.

Introduce libxl_get_memory_target.

[fixed up for conflicts with libxl__ naming policy changes -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:37:09 +01:00
Stefano Stabellini eb7c5c76a3 libxl: use transactions in libxl_set_memory_target
[fixed up for conflicts with libxl__ naming policy changes]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:31:45 +01:00
Stefano Stabellini 4edf6e82b7 libxl: do not modify static-max after domain creation
static-max represents the maximum memory the domain can ever have,
therefore it shouldn't be changed after domain creation.

[adjusted to cope with code movement since patch series written -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:27:21 +01:00
Stefano Stabellini 6f566d1367 libxl: add current_memkb to libxl_dominfo
currently xcinfo2xlinfo reads tot_pages and uses that data to calculate
max_memkb, while tot_pages is the memory currently used by the domain
and max_pages is the theoretical maximum.
This patch calculates max_memkb from max_pages and introduces
current_memkb to store the current memory usage.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-22 17:23:22 +01:00
Stefano Stabellini e01988a3a3 xl: do not continue in the child and exec xenconsole in the parent
Currenctly console_autoconnect spawns a child that continues building
the domain while the parent exec's xenconsole; this patch inverts the
logic.

As a consequence autoconnect_console needs to be called twice: once for
pv guests at the beginning and once for hvm guests at the end.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-02 18:26:00 +01:00
Stefano Stabellini 7497632508 xl: parse the maxvcpus config file parameter
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-02 17:44:46 +01:00
Stefano Stabellini 5b67996cc6 libxl: drop libxl_set_vcpucount, introduce libxl_set_vcpuonline
This patch renames libxl_set_vcpucount to libxl_set_vcpuonline and
modifies the function to take a bitmap of online/offline vcpus as
parameter.

It also introduces a xenstore transaction to write the available cpus
to xenstore.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-31 19:05:01 +01:00
Stefano Stabellini 8ef0c5ff6c libxl: Disable opengl if info->opengl == 0 (correct sense of test)
Disable opengl if info->opengl == 0

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-19 18:15:44 +01:00
Stefano Stabellini aa70182b71 tools/libxl: Support pv qemu without any vfbs
Pv qemu provides backends for vfbs and consoles; even if no vfbs are
given can still be useful for the console backends.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-16 13:33:54 +01:00
Stefano Stabellini ce8ffdb551 tools: xenconsole[d] and libxl: multiple console support
This patch implements the new protocol for handling pv consoles and
emulated serials as described in the document docs/misc/console.txt.

The changes are:

- xenconsoled: do not write the pty under serial in xenstore if
xenconsoled is handling a consolepath;

- xenconsole: implement support for an explicit console type parameter;
the parameter can be "pv", to specify that the user wants to
connect to a pv console, or "serial", to specify that the user wants to
connect to an emulated serial. If the type parameter hasn't been
specified be the user, xenconsole tries to guess which type of console
it has to connect to, defaulting to pv console for pv guests and
emulated serial for hvm guests.

- xenconsole: use the new xenstore paths;

- libxl: rename libxl_console_constype to libxl_console_consback:
constype is used to to specify whether qemu or xenconsoled provides the
backend, so I renamed it to libxl_console_consback to make it more
obvious that we are talking about backends;

- libxl: add a new libxl_console_constype to specify if the console is
an emulated serial or a pv console;

- libxl: support the new xenconsole "type" command line parameter;

- libxl: use the "output" node under console in xenstore to tell qemu
where do we want the output of this pv console to go;

- remove the legacy "serialpath" from xenconsoled altogether

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>


Also: update the QEMU_TAG to pull in the qemu part of these changes.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-16 13:32:04 +01:00
Stefano Stabellini edef2b102f tools/libxl: libxl_device_generic_add: handle NULL fents or bents
This is going to be used by libxl_console_add in the next patch to
avoid creating the device/console path on xenstore for console 0.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-13 20:34:09 +01:00
Stefano Stabellini 8e1c320660 tools/libxl: usbdevice should imply usb
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-23 16:58:35 +01:00