Commit Graph
853 Commits
Author SHA1 Message Date
emellor@ewan ec7bb10f8e Call refresh in the domain_lookup and domain_lookup_by_name methods. This
should reduce the incidence of stale domain information being used by xend, but
is only a stop-gap.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-02 18:21:01 +01:00
emellor@ewan f578bafffd Fix call to XendCheckpoint.restore, since that method no longer needs a
XendDomain instance passed in.

Remove meaningless indirection of imports through web/reactor.py.  Tidy import
statements.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-02 18:17:26 +01:00
emellor@ewan 42fb9678c9 Add the config file parsing for the on_{poweroff,reboot,crash} options, so that
they actually take effect.  Added behaviour "rename-restart" for debugging
purposes, that renames the domain out of the way, preserving it for debugging,
but starts a new domain too.

Add explicit remove of old domain paths when creating a new domain, to avoid
stale information affecting us (by shutting the domain down, for example).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-30 17:10:20 +01:00
emellor@ewan db730ecdd1 Minor tidy.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-30 17:05:08 +01:00
emellor@ewan 8a3d958510 Change rebooting specification so that we can have domains crash and stay
around to be debugged, for example.

Fix problem in XendDomainInfo.eventChannel caused by a mis-merge.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-30 13:59:28 +01:00
emellor@ewan d934679092 Within the store, split the persistent information regarding a VM from the
transient information regarding a domain.  This allows live localhost migration,
which is important for testing migration, and also allows migration when we
have a distributed store.  The backend paths in the store now refer to the
frontend domain ID, not its UUID, and blktap has changed to match.

To support this split in the information, the cleanup procedure has been split
to match.

Change the save-restore interface between XendDomain, XendDomainInfo, and 
XendCheckpoint, to remove some intermingling, in particular taking XendDomain
out of the loop for the restore procedure.

Improved the recovery procedure to avoid trying to destroy dom0 when recovering.

Added a lock around XendDomain.refresh and one around
XendDomainInfo.refreshShutdown, to improve the behaviour when recreating
domains at startup.  There are still races here, so more thought needs to be
given to the locking.

Live reconfiguration of an existing domain is temporarily broken.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-30 13:41:10 +01:00
emellor@ewan 8d170a2989 Added cache-control headers to pages returned by HTTP server so that pages
expire immediately.  This prevents navigation to stale pages.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-30 11:55:49 +01:00
emellor@ewan 1b19d438d2 Remove the bizarre arrangement whereby EventChannel inherits from dict. Move
the channel-creation logic into eventChannel, making the EventChannel class
simpler.  Remove the closeEventChannel method -- it was simply doing a check
for None, and that isn't enough value to justify the extra method when there
is an EventChannel.close method there too.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-30 11:40:59 +01:00
emellor@ewan a4db84d76c Added DevController.configuration and configurations methods. These parse the
store for the current device configuration, and convert it back into the
s-expression used in the config files and the save files.  This means that we
can bring the devices up properly on restore.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-30 10:48:49 +01:00
emellor@ewan 4075caad61 Remove unused domain_devtype_get.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 17:00:22 +01:00
emellor@ewan 182124af7b Remove unused xend_domain_device.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 16:59:34 +01:00
emellor@ewan 1106624d57 Change device IDs to be integers, as required now by DevController. Remove
unused op_device.  Remove broken code to show the domain configuration using
the HTTP server.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 16:59:13 +01:00
emellor@ewan 3896bc2b68 Minor tidy up.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 15:09:24 +01:00
emellor@ewan 55da9243e8 Added new classmethod xstransact.ListRecursive, and use this inside
DevController to tidy up the code there.  Change the semantics of
xstransact.list and List to return the empty list rather than None if there
are no entries or the directory is not present, as this is easier to handle
for the client.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 15:06:48 +01:00
emellor@ewan a348233185 Fix returning of results broken by last change.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 15:00:11 +01:00
emellor@ewan 34a989b221 Added logging of exceptions coming through callInfo, for better debugging.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 14:03:06 +01:00
emellor@ewan bcf976db0e Minor tidy.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 14:02:38 +01:00
emellor@ewan 85506dfc97 Improve HTML output.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 13:44:15 +01:00
emellor@ewan ad1a856c94 Added missing quote to HTML output.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 13:43:33 +01:00
emellor@ewan 0b7f903b29 Added behaviour to read() to read directly from the transaction's path if no
arguments are specified.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 13:43:07 +01:00
emellor@ewan d391a2dddc Handle exceptions caused during processing of requests, to improve error
reporting.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-28 13:41:44 +01:00
emellor@ewan 817fbb6432 Remove unused import, mark unused variables.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 22:09:46 +01:00
emellor@ewan d67469375a Remove unused imports, variables.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 22:09:12 +01:00
emellor@ewan 92e31dac79 Fix final misuse of prettyprint parameters. 2005-09-27 22:08:07 +01:00
emellor@ewan 6269dad649 Remove unused imports, and unused progress parameters from domain_save, domain_restore. Rename one instance of id to domid. 2005-09-27 22:06:15 +01:00
emellor@ewan e33f948908 Added getDeviceSxprs, to support xm block-list. 2005-09-27 22:05:03 +01:00
emellor@ewan b4e6e65545 Added sxprs, for xm block-list. 2005-09-27 22:03:55 +01:00
emellor@ewan 823550cc47 Added behaviour to list() to list the transaction's path if no arguments are
given.  Added list_recursive().

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 22:02:57 +01:00
emellor@ewan 0fae7b55e5 This patch adds a quick check to 'xm restore' that checks the
existence and readability of the file given.

This fixes the issue detected in xm-tests 03_restore_badparm_neg and
04_restore_badfilename_neg.

Signed-off-by: Dan Smith <danms@us.ibm.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 15:10:38 +01:00
emellor@ewan 9427933f18 This patch adds a quick check in "xm save" to make sure the path given
exists, and is writable.

This will fix the issue detected by xm-test 03_save_bogusfile_neg.

Signed-off-by: Dan Smith <danms@us.ibm.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 15:06:40 +01:00
emellor@ewan f8e5b67cfe This patch cleans up some of the argument usage in PrettyPrint.py to
avoid a stack trace when doing an 'xm list -l'.  Most of the
prettyprint() methods were called with 1 argument, but the functions
required 2 (one of which was unused).

Signed-off-by: Dan Smith <danms@us.ibm.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 15:03:00 +01:00
emellor@ewan 3a2080259e Remove DBMap etc from XendDomainInfo, moving the handling of the domain root
and VM root totally into XendDomainInfo.  The DBMap stuff was all cruft,
following the move to xstransact.  Removing it may also help those suffering
from poor start-up times caused by a large store.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 14:49:31 +01:00
emellor@ewan 4ac7f7b347 Remove the domain and VM paths from the store when destroying a domain. This
goes a long way towards fixing the problem of stale entries in the store.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 14:36:58 +01:00
emellor@ewan 4cafea04fa Detangle the restart/reboot/halt/save/restore code. There is now one point
for management of shutdown state, XendDomainInfo.refreshShutdown, which is
able to cope whatever the current state of the domain.  This fixes bug #124:
running reboot within a domU doesn't bring the domain back up after shutdown,
and bug #256: "xm reboot" could not make domU reboot.

Fix the refreshing inside XendDomain to ensure that the values returned by xm
list reflect reality correctly.  We were removing XendDomainInfo instances,
but not creating them on start-up, so if xend were restarted, domain
information was being lost.

Merge XendDomain.dom0_unknown and initial_refresh into
XendDomainInfo.recreate.

Catch exceptions inside callInfo, and reraise them as XendErrors.

Remove unused XendDomain.close.

Further improvements are needed to XendDomainInfo to ensure that it avoids all
race conditions on shutdown, and can cope correctly with xend restarting
during a shutdown.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 13:53:06 +01:00
emellor@ewan 2585169bbb Use constant in XendDomainInfo rather than embedding a string literal.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 12:30:13 +01:00
emellor@ewan d501525831 Added missing import socket statement.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-27 12:29:36 +01:00
emellor@ewan 71d2fbe977 Add helper method XendDomain.callInfo that stubs through into XendDomainInfo.
This is used to remove much of the code duplication in the public methods there.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-24 23:10:31 +01:00
emellor@ewan 6b7179401d Added default value for ssidref -- 0.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-24 20:41:48 +01:00
emellor@ewan de9520f69b Move ImageHandler registration into image.py from XendDomainInfo.py. Move
ImageHandler.create and findImageHandlerClass to the module level, and inline
addImageHandlerClass.  Move ImageHandler.kernel, ramdisk, cmdline, and flags,
which seem inadvertently to have been declared as class variables, and make
them instance variables instead.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-24 20:36:15 +01:00
emellor@ewan 395b1e96a0 Removed unused Blkctl.py. The functionality here has been taken over by the
new hotplug system.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-23 17:17:22 +01:00
emellor@ewan a61dbab153 Merge the duplicated code for create, destroy, migrate, sysrq, and shutdown
into one handler that dynamically imports the correct subcommand handler.
Remove the fullhelp cruft, which was referencing something not actually present,
and was unused.  Remove xm_network_attach and xm_network_detach, which were
providing code for unadvertised and unsupported functionality.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-23 16:56:46 +01:00
emellor@ewan 78b04c6c84 Neaten the configuration parsing code. Add a self parameter to
configureBootloading.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-23 16:53:57 +01:00
emellor@ewan 9b0cb01573 Move ImageHandler.create call to initDomain, after the call to xc.domain_create.
This ensures that ImageHandler has the correct domain ID available to it, which
seems sensible in general, and is necessary for the VMX VNC support in
particular.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-23 16:50:02 +01:00
emellor@ewan a65b0d048f Remove unused XendDB.py.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-23 16:05:37 +01:00
emellor@ewan f43aec3cd9 Remove unused tempfile.py. Even if anyone were using it, they shouldn't be --
there's tempfile functionality in the Python standard library.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-23 16:04:43 +01:00
emellor@ewan 475b779529 Fix call with missing parameters. 2005-09-23 15:53:36 +01:00
emellor@ewan bdd477ad34 Add check for speed (takes 33 minutes on my laptop, OUCH!)
Make xenstored use tdb, transactions can soft-fail (EAGAIN)
Transactions no longer take root dir, no longer lock & block: commit can fail spuriously with EAGAIN, not ETIMEDOUT.
Speeds up transactions by over 1000 times, should be NFS safe.
New program: xs_tdb_dump to dump raw TDB contents.
Don't do failure testing: we are no longer robust against all ENOMEM 8(
Introduce "struct node" which contains perms, children and data.
Make struct xs_permissions unpadded, so we can write to tdb w/o valgrind complaints.
Gently modify TDB to use talloc, not do alloc on tdb_delete.

Fix up transaction users for new semantics.
Don't need a transaction around a single read in xen/i386/kernel/smpboot.c.
Python: transaction_start() returns True/False rather than raising exception on EAGAIN.
Fix usage comment on xs_transaction_end().
Include stdarg to xs_tdb_dump so it compiles.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2005-09-23 14:28:16 +01:00
kaf24@firebug.cl.cam.ac.uk 2b3f9eda6b Clean up xc_vmx_build():
1. Remove linux parameters.
 2. Remove init ramdisk.
 3. Remove e820 memmap config file parse.
 4. Removed provisional GDT.
 5. Removed some ugly tailing space.

Signed-off-by: Xin B Li <xin.b.li@intel.com>
2005-09-23 12:52:43 +01:00
emellor@ewan 42a5d02afb Move variable initialisation out of import section. Remove obsolete save
parameter from XendDominInfo.exportToDB.
2005-09-22 18:03:16 +01:00
emellor@ewan 089412c49e Rename XendDomainInfo and DevController.getDomain to getDomid.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-22 17:58:43 +01:00