Commit Graph
7607 Commits
Author SHA1 Message Date
Keir Fraser 322c096f9c General code clean-up of xc_linux.c.
Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-12-17 06:27:55 +00:00
Keir Fraser 79ba534b4d pygrub: add ext4 support
This is a port of the following two patches:
  http://patches.ubuntulinux.org/g/grub/extracted/ext4_support.diff
  http://patches.ubuntulinux.org/g/grub/extracted/ext4_fix_variable_sized_inodes.diff

Signed-off-by: Mark Johnson <mark.johnson@sun.com>
2009-12-16 16:42:44 +00:00
Keir Fraser 5a396b13fd HVM RDTSCP fixes
- Put the guest rdtscp cpuid logic in xc_cpuid_x86.c.
 - MSR_TSC_AUX's high 32bit is reserved, so only write the low 32bit.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2009-12-16 12:23:21 +00:00
Keir Fraser 7cafc0777f pygrub: fix attribute error when not found parser
Signed-off-by: Wei Kong <weikong.cn@gmail.com>
2009-12-16 12:20:57 +00:00
Keir Fraser 420820e830 xen-detect: Avoid dumping core
F12 introduces a tool to automatically report bugs when there are core
dumps.  Since xen-detect relies on fork+waitpid in order to trap a
SIGILL from a child, every time someone runs xen-detect on a bare
metal kernel a bug is reported into Red Hat's Bugzilla. :-)

However, even without this contingent need, leaving core dumps around
is not nice.  So this patch just traps SIGILL using
signal/sentjmp/longjmp, without the need to fork.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 11:58:45 +00:00
Keir Fraser 37f8a59c7c Fix bug in c/s 20332 "Add commands to hotplug usb devices to hvm guests"
Signed-off-by: James Song Wei <jsong@novell.com>
2009-12-14 09:36:26 +00:00
Keir Fraser b8a087fb41 HVM vcpu add/remove: parse vcpu_avail to Qemu
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

Disable qemu cmdline option until our qemu supports it.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:31:00 +00:00
Keir Fraser cf75018188 HVM vcpu add/remove: parse 'vcpu_avail' to firmware and set up madt
accordingly

-- currently firmware has got 'vcpus' from xend, this patch add parse
   'vcpu_avail' to firmware;
-- setup madt 'lapic' subitems of processors accoring to vcpus and
   vcpu_avail which finally come from config;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:25:47 +00:00
Keir Fraser c70ad37a1f HVM vcpu add/remove: setup dsdt infrastructure by mk_dsdt.c for vcpu add/remove
In order to support HVM vcpu add/remove, we need set dsdt
infrastructure.
-- By using mk_dsdt.c, it auto-produce related asl code when
compiling.
-- It define processor related objects and control methods (_MAT,
_EJ0, _STA, etc).
-- It also define GPE _L02 and Notify control method for SCI
interrupt, which will trigger HVM acpi driver to add/remove cpu.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:14:26 +00:00
Keir Fraser a4a7c638f7 xend: fix empty 'cpus' parsing
/etc/xen/xmexample.hvm says "" means "leave to Xen to pick", but we
get a "Error: string index out of range" currently.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-12-14 07:59:12 +00:00
Keir Fraser 51dfdb01ad xend: fix a typo introduced by changeset 20621:f9392f6eda79
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-12-14 07:58:47 +00:00
Keir Fraser 30acac4606 Fix bug in c/s 20332 "Add commands to hotplug usb devices to hvm guests"
Signed-off-by: James Song Wei <jsong@novell.com>
2009-12-14 07:58:15 +00:00
Keir Fraser bbe624405f Fix losetup -f not working on SLES10
Signed-off-by: Gary Grebus <gary.grebus@oracle.com>
2009-12-14 07:56:21 +00:00
Keir Fraser 0404e06849 libxenlight: Disable unneeded C++ binding for libconfig
If we want to avoid that a C++ compiler becomes a requirement for a
Xen build, we should disable the (unneeded) C++ library generation for
the embedded libconfig.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-12-11 09:00:40 +00:00
Keir Fraser b501c6cfa8 tools: improve NUMA guest placement when ballooning
the "guest to a single NUMA node" constrain algorithm does not work
well when we do ballooning. Ballooning and NUMA don't play together
anyway, as Dom0 and thus ballooning is not NUMA aware, I am working on
this but it will not be ready for the Xen 4.0 release window.  The
usual ballooning situation will result in an empty candidate list, as
no node has enough free memory to host the guest. In this case the
code will simply pick the first node: again and again, because all
nodes without enough memory will be ultimately penalized with the same
maxint value (regardless of the actual load).  The attached patch will
change this to use a relative penalty in case of not-enough memory, so
that low-load low-memory nodes will be used at one point. A half
loaded node has shown to be a good value, as an unbalanced system is
much worse than non-local memory access for guests.  Regardless of
that you should restrict the Dom0 on a NUMA system to a reasonable
memory size, so that ballooning is not necessary most of the time. In
this case the guest's memory will be NUMA local.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-12-11 08:59:54 +00:00
Keir Fraser fc63162a09 PVUSB: xm/xend support
You can see the following slides to understand the usage.
http://www.xen.org/files/xensummit_intel09/PVUSBStatusUpdate.pdf
Limitations:
"xm usb-hc-create" accepts up to 16 ports, but, current usbfront
can work with up to 15 ports. This may be bug and I'm preparing
to fix it.

This xm/xend support requires linux-2.6.18-xen.hg c/s 939 or above.
I recommend latest tip.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
2009-12-11 08:52:17 +00:00
Keir Fraser dcf8b0114d libxenlight: fix cd-insert cli arguments parsing
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-11 08:47:51 +00:00
Keir Fraser de7c9106c1 libxenlight: add a cli option to exit right after domain creation
This patch adds a command line option in xl to exit right after domain
creation and not wait in background for the death of the domain.
Users should be aware that if they use this option, they always have
to destroy the domain manually after the guest shuts down.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-11 08:46:02 +00:00
Keir Fraser 44ed88bd6b libxenlight: fix two memory related issues
- LIBXL_MAXMEM_CONSTANT is 1MB but must be expressed in KB;

- xc_dom_linux_build should take target_memkb instead of max_memkb as
  an argument.

Thanks to Andres for spotting the latter.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-11 08:45:26 +00:00
Keir Fraser 80b20a2fa0 tools: simplify PYTHON_PATH computation (and fixes for NetBSD)
Doesn't work when build-time python path differs from install-time. Do
we care about this given tools should be packaged/built for the
specific run-time distro?

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-12-09 10:58:52 +00:00
Keir Fraser 5f05fba8c1 tmem, xentop: Report a few key per-domain tmem statistics in xentop.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-12-09 10:46:11 +00:00
Keir Fraser 9905ac2b90 libxenlight: implement libxl_set_memory_target
This patch adds a target_memkb parameter to libxl_domain_build_info to
set the target memory for the VM at build time and a new function
called libxl_set_memory_target to dynamically modify the memory target
of a VM at run time.  Finally a new command "mem-set" is added to xl
that calls directly libxl_set_memory_target.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-09 10:44:11 +00:00
Keir Fraser 30c666cd1c libxenlight: xenstore data path writable by the guest
Make the data path on xenstore writable by the guest
because Citrix pv drivers requires it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-09 10:43:33 +00:00
Keir Fraser ef86b9f18b xend: Add keymap to vfb config for existing hvm guests
I submitted a patch a while back to add keymap to vfb config for hvm
guests.  This patch works fine for new config (xm create|new) but not
existing, managed guests.  To cover the latter case I've introduced a
validator method in XendConfig.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-12-08 07:49:54 +00:00
Keir Fraser 7b4effff89 libxenlight: implement cdrom insert/eject
This patch implements functions in libxenlight to change the cdrom in
a VM at run time and to handle cdrom eject requests from guests.

This patch adds two new commands to xl: cd-insert and cd-eject; it
also modifies xl to handle cdrom eject requests coming from guests
(actually coming from qemu).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-08 07:47:52 +00:00
Keir Fraser 4baca0b560 fs-backend: add a backend cleanup function
This patch implements a backend cleanup function in fs-backend so that
when the connection to the frontend is closed we don't leak nodes on
xenstore.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-08 07:45:15 +00:00
Keir Fraser d08e561228 libxenlight: minimal vfs support
This patch adds minimal support for fs-backend and minios' fs-front
to libxenlight:

- it creates a vfs directory on the stubdom's xenstore
device path and allows the stubdom to write to it;

- it doesn't try to cleany shutdown the vfs backend.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-08 07:44:45 +00:00
Keir Fraser 1f29decb33 libxenlight: physmap slack for pv domains
Contemplate a memory space slack for PV domains,
since they do ballooning (or flipping network rx)
and need some extra room in their pfn space.

Note that this does not allocate any extra memory
to the domain, it simply extends the physmap with
some extra room for "bounce bufffering back" pfn's
that are yielded to dom0.

The default slack is set at 8MB.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2009-12-05 12:30:46 +00:00
Keir Fraser 88cd47fe0f libxenlight: get state for one domain
Simple function to get the dominfo state of a single domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:11:44 +00:00
Keir Fraser 6eb9ddda17 libxenlight: domain resume
Added libxenlight implementation for resume domain.
This brings back a cooperative pv domain from the
shutdown state after save, enabling checkpointing.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:11:06 +00:00
Keir Fraser 69535954d1 libxenlight: Destroy device model only for domains that have it
Destroy device model only for domains that have it.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:10:22 +00:00
Keir Fraser 91064f9e07 libxenlight: avoid writing empty values to xenstore
Prevent segmentation fault caused by empty values
in key-value pairs for the /vm/ subdirectory
when restoring a pv domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:09:44 +00:00
Keir Fraser 1835885f4f libxenlight: disk and nic destroy calls
Expose disk and nic device destroy calls

Also removes the obsolete device shutdown calls.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:06:47 +00:00
Keir Fraser e7a1488520 libxenlight: refactor libxl destroy code
Refactor libxl device destroy code. Abstract function
waiting for the watch on the state node to fire.
Create a generic device delete function.

Only a single LIBXL_DESTROY_TIMEOUT elapses when
waiting for destruction of all the devices of a
domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:03:45 +00:00
Keir Fraser 88de8df0dc libxenlight: fix GC when cloning contexts
Provide a function to clone a context. This is necessary
because simply copying the structs will eventually
corrup the GC: maxsize is updated in the cloned context
but not in the originating, yet they have the same array
of referenced pointers alloc_ptrs.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
2009-12-04 07:02:49 +00:00
Keir Fraser 78eed7d044 xend: Fix parameters to PyArg_ParseTupleAndKeywords()
The kwd_list parameter PyArg_ParseTupleAndKeywords() must be a
NULL-terminated list.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-12-04 07:00:25 +00:00
Keir Fraser 8cf96a2728 libxenlight: Get rid of the dependency on the LIBCONFIG_SOURCE directory.
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
2009-12-04 06:51:53 +00:00
Keir Fraser 8e6a4e5326 libxenlight: Delete dep files on 'make clean', and include them in Makefile rules.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-04 06:50:46 +00:00
Keir Fraser f5772cd764 xend: Add GPL license stanza to MemoryPool.py
Signed-off-by: James Song (Wei) <jsong@novell.com>
2009-12-03 13:51:20 +00:00
Keir Fraser 0436d361aa Remus: fall back to xenstore if necessary
This is primarily for pvops until it gets a dedicated suspend
event channel.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-03 13:50:43 +00:00
Keir Fraser ba4d310958 Remus: fix shadow memory allocation, broken by 20558:4ed3b9b1de3f
This approach is perhaps a little cleaner than directly calling
balloon.free.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-03 13:50:14 +00:00
Keir Fraser 422f39c72e xentop: Allow full domain name display
Add a '-f' option to xentop to allow the full domain name to be
displayed. This is the original behavior which can cause the display
to be unaligned. Customers have requested this because only the
trailing characters of their domain names are unique and therefore
cannot be distinguished when the display is limited to a 10 character
width.

Signed-off-by: Charles Arnold <carnold@novell.com>
2009-12-02 18:43:28 +00:00
Keir Fraser 55a64741b6 libxenlight: fix multiple xenstore watches problem
this patch fixes the multiple xenstore watches problem in libxenlight
opening a new xenstore connection to set and read temporary watches on
the device state nodes.  This way they don't interfere with other long
running watches.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 18:42:36 +00:00
Keir Fraser 18ba65e5f8 libxenlight: use watch and select in libxl_wait_for_device_model
This patch reimplements libxl_wait_for_device_model using a xenstore
watch and a select loop.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 18:42:03 +00:00
Keir Fraser e510765e70 libxenlight: fix dm_xenstore_record_pid
The function dm_xenstore_record_pid is executed by a child of the main
process and therefore shouldn't use the same xenstore connection:
currently it opens a new connection but still uses the old one.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-12-02 18:41:31 +00:00
Keir Fraser 80d4e9ca77 xenstat: Fixes for 20528:e6e3bf767d16 (stats for dom0 network bonding)
In above c/s I introduced dom0 statistics for case we use network
bonding. The indentation was not good for xenstat C codebase and also
some modifications were done to the logic, mainly not using the parsed
variables we don't care about (as we care only about
{tx|rx}{bytes,packets,errs,drops} and no other variable from
/proc/net/dev) by passing NULLs to variables we don't care about. Also
dom0 statistics alteration was fixed to include {tx|rx}{drop,errs} for
dom0 (previous version of my patch was not having this code applied).

Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-12-02 13:45:35 +00:00
Keir Fraser fe356defec xend, vt-d: do not reserve vtd_mem if iommu is not enabled
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-12-02 13:43:37 +00:00
Keir Fraser e45215a3fe xend: Memory pool for pv guest on systems with >128G memory
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>
2009-12-02 08:51:12 +00:00
Keir Fraser 2cdc56dff4 xm: fix message in OptionError deprecated since Python 2.6
BaseException.message has been deprecated since Python 2.6.  To
prevent DeprecationWarning from popping up over this pre-existing
attribute, use a new property that takes lookup precedence.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
2009-12-02 08:47:49 +00:00
Keir Fraser 77c8da6806 remus: Skip Linux-specific build components on other OSes
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-02 08:46:11 +00:00