Commit Graph
3070 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk a5414d898b Ensure old Python files are overwritten during tools install.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2006-03-08 11:18:39 +01:00
kaf24@firebug.cl.cam.ac.uk 6dab2f670d Add next/previous key bindings to XenMon curses mode.
Signed-off-by: Diwaker Gupta <dgupta@cs.ucsd.edu>
2006-03-06 23:47:53 +01:00
kaf24@firebug.cl.cam.ac.uk bcdecd7942 Fix reporting of time intervals in the log mode of XenMon.
Fix duration to sleep between iterations (earlier hardcoded to 1sec)
Signed-off-by: Diwaker Gupta <dgupta@cs.ucsd.edu>
2006-03-06 23:47:14 +01:00
kaf24@firebug.cl.cam.ac.uk 1d9f9d55bd Simplify ptrace_names array declaration.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-06 19:26:30 +01:00
kaf24@firebug.cl.cam.ac.uk d3174e2e2e Fix build with some gcc versions.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-06 18:05:09 +01:00
kaf24@firebug.cl.cam.ac.uk 9603c69e65 libxc: Verify Magic number when reading dump
The xen core files record a magic number, 
but when they are loaded it isn't checked.
This patch resolves this.

Signed-Off-By: Horms <horms@verge.net.au>
2006-03-06 15:04:18 +01:00
kaf24@firebug.cl.cam.ac.uk e265d47bd6 Consolidate xc_ptrace and xc_ptrace_core
* xc_ptrace
  - Merge xc_ptrace_core into xc_ptrace
  - ATTACH now reads the data argument. If non-zero then
    a corefile is being debuged. Otherwise a thread has
    been attached to. This allows xc_waitdomain_core() or
    xc_waitdomain() to be called as appropriate in
    subsequent xc_ptrace() calls.
* xc_waitdomain
  - Rename xc_waitdomain (xc_ptrace.c version) __xc_waitdomain
  - Rename xc_waitdomain (xc_ptrace_core.c version) xc_waitdomain_core
  - Create xc_waitdomain (in xc_ptrace.c), a wrapper for __xc_waitdomain
    and xc_waitdomain_core.
  Consolidation seemed difficult but ctxt needs to be
  passed into xc_waitdomain_core or made global.
  Alternatively, xc_waitdomain_core could be moved into xc_ptrace.c,
  but this seems messy.
* map_domain_va
  - Rename map_domain_va (xc_ptrace_core.c version) map_domain_va_core
  - Have it accept ctxt, like xc_waitdomain_core
* myptrace and myxcwait (linux-xen-low.c)
  Removed, call the now generic xc_ptrace() and xc_waitdomain() instead

When calling xc_ptrace ATTACH, if a corefile is in use, a fd will
be passed, otherwise a pid. The fd part is important, as this
is saved internally in xc_ptrace_core.c, and passed to xc_waitdomain_core()
as neccessary. Pereviously xc_waitdomain_core() received a pid and
thus could not open the corefile.

Signed-Off-By: Horms <horms@verge.net.au>
2006-03-06 12:06:55 +01:00
kaf24@firebug.cl.cam.ac.uk d531f7eb39 libxc: xc_ptrace cleanups
General Cleanups
* Use { after if consistently in xc_ptrace.c and xc_ptrace_core.c
  (But not in xc_ptrace_core() which should be removed shortly)
* Remove duplicate code and centralise around xc_ptrace.h
* Avoid ifing values covered by case in xc_ptrace()
  - PTRACE_GETREGS, PTRACE_GETFPREGS and PTRACE_GETFPXREGS are grouped into
    a single case, and then with the exception of a call to FETCH_REGS(),
    different code is executed based on ifing the values covered by the
    case.  The PTRACE_GETFPREGS and PTRACE_GETFPXREGS code is actually a
    duplicate.  This patch breaks the code out to two different cases.

Error Handling
* Eliminate FETCH_REGS macro as it forces several functions
  to have an otherwise uneeded error_out label, mittigating
  any code savins.
* Rework error handling in xc_ptrace().
  - Remove FETCH_REGS as above
  - Make sure that all dom0 errors are caught
  - Make sure errno is always set on error
* Eliminate gotos in xc_ptrace_core.c that do nothing but return

Signed-Off-By: Horms <horms@verge.net.au>
2006-03-06 12:05:44 +01:00
emellor@leeni.uk.xensource.com 8ff99da748 Merged. 2006-03-04 19:16:36 +01:00
emellor@leeni.uk.xensource.com 8ee550dbe0 Allow callers to XendClient.xend_list_domains to specify the detail flag, and
turn detail off when doing vcpu-list.  This avoids calls to xenstore just to
get the list of domains for the vcpu-list call, significantly increasing
performance of that command on loaded systems.

Closes bug #545.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-04 19:15:36 +01:00
emellor@leeni.uk.xensource.com d34501c219 Log the tdb_error when a read fails with EIO. This is happening after a long
time under load -- hopefully this message will suggest why.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-04 19:12:37 +01:00
kaf24@firebug.cl.cam.ac.uk 0a4522458b Fix some warnings when compiling tools.
Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-03-04 10:25:05 +01:00
kaf24@firebug.cl.cam.ac.uk 262bd587ce /proc/xen/xsd_kva exports mmap interface that xenstored now uses to map the
domain0 xenbus page.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-03 19:07:55 +01:00
kaf24@firebug.cl.cam.ac.uk 74bb865dac Avoid floating point in hash table implementation.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-03 19:06:50 +01:00
emellor@leeni.uk.xensource.com 39dbaabab7 Merged. 2006-03-03 15:56:34 +01:00
emellor@leeni.uk.xensource.com ecabde4c14 Change the way that reboot-timeouts are handled. Rather than refreshing the
list of domains each time XendDomainInfo.refresh is called, and spawning
threads for each shutdown still in progress, we watch the control/shutdown
node and spawn just the one thread immediately.  When the daemon starts (say
after a crash) all domains are checked for entries in the store indicating a
reboot in progress.

This avoids a large cost on the store and in threads when the list of domains
is refreshed.  This happens every time the server is queried, so the cost can
be quite high.  It's especially a high cost when using xm shutdown -a -w --
this operation should perform a lot better now.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-03 15:41:56 +01:00
emellor@leeni.uk.xensource.com c84e1f2ac5 Added further integrity checking, this time checking for duplicate directory
entries and for orphaned nodes in the database.

Added two flags, -R and -L, to disable the recovery code and the remove of
/local at start-up.  This makes it much easier to analyse corrupted tdb files.

Added some missing talloc_free calls in the previous integrity checking code.

Removed the transaction handle from the trace_io message -- unfortunately,
the transaction is always null at this point, as it's not yet been looked up.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-03 15:37:28 +01:00
emellor@leeni.uk.xensource.com 988c0cb02e Cope when the filename returned by losetup for an existing loop device is not
fully qualified.  In this case, the readlink -f call to canonicalise that name
fails.

Closes bug #553.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-03 15:32:42 +01:00
kaf24@firebug.cl.cam.ac.uk 0814867e26 Minor enhancements to gdbbuild, the build script for gdbserver-xen.
1. Use $MAKE if set
 2. Make mirror configurable from environment

From: Horms <horms@verge.net.au>

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-03 11:17:09 +01:00
kaf24@firebug.cl.cam.ac.uk 59d0a0335d This patch undoes 8697 and makes xm reboot/shutdown work again. This code
does expose a bug in xenstored when it is killed & restarted, but that
is not caused by this code.

My sincere appology to Ke Yu for the long wait and assuming his code
was broken.  His code was perfectly fine. Its just that my test scripts
did something for a historical reason that I should have removed a long
time ago.

Signed-Off-By: Leendert van Doorn <leendert@watson.ibm.com>
2006-03-03 10:56:54 +01:00
kaf24@firebug.cl.cam.ac.uk da53848714 Raises an explicit error message when the domain config file specifies
an incorrect path to a file-backed VBD (disk image) or the file-backed
VBD does not exist.

Without this patch, if someone mis-types the path to the disk image,
he/she would have no indication as to what's wrong when the domain
fails to get created.

Signed-off-by: Khoa Huynh <khoa@us.ibm.com>
2006-03-03 10:56:13 +01:00
kaf24@firebug.cl.cam.ac.uk b8d1d84a4f VTPM_Tools: Fix error when closing only vtpm, and fix restore bug when
no dmis exist

The first bug prevented the TPM tests from running successfully more
than once in a row.

Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
2006-03-03 10:46:06 +01:00
kaf24@firebug.cl.cam.ac.uk f7145c633e Ignore external (user-provided) CFLAGS when building vmxassist and hvmloader.
They do more harm than good.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-03 10:44:40 +01:00
emellor@leeni.uk.xensource.com 2700e32492 Cope if xenstore is down.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 21:45:13 +01:00
emellor@leeni.uk.xensource.com 186f0e02a1 Added hashtable implementation, to support the reachability check against the
store.  This code is by Christopher Clark.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 21:44:49 +01:00
kaf24@firebug.cl.cam.ac.uk c7466ca15d Fix libxc warnings with gcc-4.1 and glibc-2.3.90.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-03-02 21:36:03 +01:00
kaf24@firebug.cl.cam.ac.uk a78479d028 Many fixes and cleanups for lomount:
- Fixed several overflows, off-by-one, and uninitialized variables.
- Added well-defined exit codes.
- Proper handling of system()'s return value.
- Errors parsing partition table cause it to stop now.
- etcetera...

Tested on 32 and 64 bit, with valgrind, with physical disks and disk
images.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-03-02 21:35:17 +01:00
emellor@leeni.uk.xensource.com 343da423ce Fix violation of C90 mixed-code-and-declarations restriction.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 03:21:17 +01:00
emellor@leeni.uk.xensource.com 03d3577c36 Fix printf.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 02:35:23 +01:00
emellor@leeni.uk.xensource.com 06d17943f0 Added a basic integrity checker, and some basic ability to recover from store
corruption, rather than just spewing error messages and exiting.

Added a xenstore-control executable, which sends commands to xenstored.
Currently, the only command is 'check', which triggers an integrity check.
(The integrity check is also triggered whenever a corrupted store is detected).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 02:09:23 +01:00
emellor@leeni.uk.xensource.com 8920f45cc8 Silence the messages that are emitted when removing nodes that already have
been removed.  This is fine, in a cleanup script.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 02:01:17 +01:00
emellor@leeni.uk.xensource.com 4749c682b0 Avoid a race between Xend removing the vm entries corresponding to a domain,
and the hotplug scripts checking whether that domain is still alive.  This
triggers the "xenstore-read: couldn't read path /local/domain/107/vm" message
in /var/log/xen-hotplug.log, followed by "Device XYZ is mounted in a guest
domain and so cannot be mounted now".

Closes bug #514.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-02 01:59:28 +01:00
emellor@leeni.uk.xensource.com 3ef81423e2 Remove unused #include <sys/ioctl.h>.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-01 17:52:37 +01:00
kaf24@firebug.cl.cam.ac.uk dfd53f76ba Fix tools Makefiles to respect CFLAGS. Disable stack-smash
protection when building vmxassist/hvmloader.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-02-28 11:41:54 +01:00
kaf24@firebug.cl.cam.ac.uk f9ef80600b Fix a multi HVM domain issue (bugzilla bug #542):
This issue can be reproduced on SMP platform, while the domain 0
is UP. The reason is, after finishing a dma request, the dma thread will
trigger the interrupt and then clear the call back function. When guest
get the interrupt , it will try to check the call back function, if it
is set, then it will trigger a dma request again. So if the checking for
the callbackfunction happens between trigger interrupt and clear
callback function on dma thread, it will cause NULL function calling.
After with domain 0 UP and smp platform, this situation can be
reproduced easily.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
2006-02-28 10:18:34 +01:00
emellor@leeni.uk.xensource.com 902bd89eeb Merged. 2006-02-27 18:44:38 +01:00
Ian.Campbell@xensource.com a6f599555c Add support for configuring feature flags when starting guests.
Guest configuration files may now contain a features= declaration
listing the features which should be enabled in a | separated
list.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-02-27 17:27:52 +00:00
emellor@leeni.uk.xensource.com 637c719f00 Reconstitute the ip parameter correctly. Closes bug #491.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-02-27 17:26:16 +01:00
emellor@leeni.uk.xensource.com 3775cfcd81 Use cleverer sed pattern to avoid use of head -1.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-02-27 17:16:28 +01:00
emellor@leeni.uk.xensource.com f32e156c0e Break out the hotplug cleanup code into xen-hotplug-cleanup. Claim the block
script's lock before doing the cleanup, to avoid a race that causes the message
"xenstore-list: could not list path backend/vbd/40" in /var/log/hotplug.log,
with a subsequent refusal to create the domain, after a domain reboot.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-02-27 17:16:04 +01:00
emellor@leeni.uk.xensource.com 7aa86f0d35 Move files that have appeared in the wrong place due to incorrect patch -p setting.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-02-27 16:28:57 +01:00
emellor@leeni.uk.xensource.com 975a49cb6e While testing TCP & UDP tests (coming soon), I tracked down a bug in the
IP addressing scheme
used by xm-test: each machine running network tests is using the same IP
addresses, so two machines
in the same network can cross-pollinate/interfere with each other's tests.

This patch changes the IP addressing scheme to add some randomness. It's
gone through a couple of dozen
passes of xm-test, some on -bridge and some on -route, while xm-test was
running on another box on the same network.

Signed-off-by: Jim Dykman <dykman@us.ibm.com>
2006-02-27 16:14:11 +01:00
emellor@leeni.uk.xensource.com d8a4248e02 The attached patch does the following:
- introduces two basic tests for the virtual TPM (skipped on hardware
where a TPM is not available or vtpm manager has not been started
manually before)
- adapts the Makefiles to make the test cases available
- splits up the hotplug files into two files where the vtpm-common.sh
can be sourced by 'other' scripts as well
- uses echo "$var" to return variables from functions
- gets rid of the 'set +e" work-around
- introduces a script (vtpm-delete) to delete entries from the virtual
TPM directory in /etc/xen/vtpm.db

The xm-tests will skip over the 2nd test on most systems and the patch
has otherwise no effect on existing tests.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-02-27 16:13:05 +01:00
emellor@leeni.uk.xensource.com 46ede6808b The attached patch breaks out
- log() function from xen-hotplug-common.sh -> logging.sh
- locking-related functions from xen-hotplug-common.sh  -> locking.sh

- xen-hotplug-common.sh 'sources' both those files now to not loose
these functions (which should make the break-out atomic)

- adapts the Makefile to install locking.sh and logging.sh at the right
place.

I ran the xm-tests over it and no (additional) errors appear due to this
change.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-02-27 16:11:01 +01:00
emellor@leeni.uk.xensource.com 5c0eb80b10 Merged. 2006-02-27 11:55:11 +01:00
kaf24@firebug.cl.cam.ac.uk 91bc5c3347 The disk isn't guaranteed to be the first device in the config sxp --
make sure we can restart domains when using a boot loader even if not.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-02-26 10:55:21 +01:00
kaf24@firebug.cl.cam.ac.uk b3a1978719 pygrub currently takes a file on the command line to mean a config file
if it can't figure out partitions and filesystems.  This then makes it
balloon to absurd sizes.  Make this only happen if you pass a debugging
flag

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-02-26 10:54:06 +01:00
kaf24@firebug.cl.cam.ac.uk ad55a2d28a Instead of using a static filename in the guest bootloader, use a random
filename so that multiple guests can start up simultaneously.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-02-26 10:53:18 +01:00
kaf24@firebug.cl.cam.ac.uk 73f56b3d57 Avoid pcnet dm packet loss / corruption.
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2006-02-25 12:27:53 +01:00
kaf24@firebug.cl.cam.ac.uk 3157cba60d Tools changes for per-vcpu io event channel on IA64.
Signed-off-by Kevin Tian <Kevin.tian@intel.com>
2006-02-24 10:29:09 +01:00