Commit Graph
892 Commits
Author SHA1 Message Date
emellor@ewan 0c6f366280 Added Zope's test.py, and a unit test to sxp. This test itself isn't very
exciting, but it's there to encourage the creation of more interesting ones.  A
test target has been added to the main Makefile, and the one in tools/python.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-06 15:12:31 +01:00
emellor@ewan 705f86977c Merged. 2005-10-06 11:12:55 +01:00
emellor@ewan 0465a697d3 Rename all dying domains to be prefixed with Zombie. This allows a new domain
to be created with the same name, fixing the race condition inside XendDomain
that caused bug #278.

Move the state_set(TERMINATED) call onto the end of cleanupDomain rather than
destroyDomain, so that this flag is set when XendDomain cleans up a domain
that was killed without going through Xend.

Remove is_terminated, as this check is no longer necessary, since we are using
Zombie prefixes instead.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-06 11:09:14 +01:00
emellor@ewan 435cc5366c Reduce the log level for the 'cannot recreate information for dying domain'
message for all but the first refresh when Xend starts.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-06 11:04:49 +01:00
emellor@ewan 6bee43e0b6 Issue diagnostic if we find dying domains on Xend restart, because we will not
be able to show them any longer, as the paths in the store have gone.  Don't
call cleanupVm when a domain dies, as localhost-migrating VMs will be blown
away by this (there is actually a race between the saving process and the
resuming process).  This fixes bug #276.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-06 10:16:50 +01:00
emellor@ewan 4c78f9561d Raise an exception if an error appears on the pipes to our children, and make
sure that the child's pipes are closed even under that exception.  Move the
handling of POLLHUP to the end of the loop, so that we guarantee to read any
remaining data from the child if POLLHUP and POLLIN appear at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-06 10:13:11 +01:00
vh249@kneesaa.uk.xensource.com 993adabd00 mixup in vcpu-enable and vcpu-disable help string
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-10-05 19:16:29 -04:00
kaf24@firebug.cl.cam.ac.uk c436ce043d Activate suspending/resuming of the TPM interface and add
some missing code to tpmif.py.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-10-05 23:15:00 +01:00
kaf24@firebug.cl.cam.ac.uk 0f742e92ea EVTCHNOP_alloc_unbound can allocate a port in an arbitrary
domain (only if the caller is sufficiently privileged).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-05 19:14:13 +01:00
emellor@ewan a00e0c297c Fix the handling of VCPUs, specifically wrt the broken VCPU hotplugging, bug
#280.  The cpu/<id>/availability paths had moved into /vm, but that is not
easily accessible by the hotplugging driver, so I have created a /vm entry
called vcpu_avail, so that the setting migrates along with the domain, and
moved the cpu/<id> ones back to /local/domain.

Don't try and destroy the domain twice if it fails within construct.  This
wasn't harming anything, but there's no need.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-05 18:06:42 +01:00
emellor@ewan d4d9c86a25 Change boolean config option parsing to allow True and Y and similar useful
things.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-05 17:48:36 +01:00
emellor@ewan 293dfc0ac2 Recover from name uniqueness violation by renaming. Fixes bug #277.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-05 14:38:19 +01:00
emellor@ewan 39f62611c4 Removed the EventServer, replacing the events fired with simple logging
messages.  This closes bug #281.  Removed references to XendRoot where these
have become unnecessary either through the work above or just through time.

Renamed some parameters in event.py, to mark them as unused.  Fix a call to a
base class constructor there too.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-05 11:43:23 +01:00
emellor@ewan acbce46077 imported patch /home/emellor/block_detach.patch 2005-10-05 00:11:30 +01:00
emellor@ewan 240eceae66 Explicitly close files on save and restore. Rename all local variables named id or slice so as not to clash with the builtins.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-05 00:00:42 +01:00
emellor@ewan 30c72ff29e Explicitly close files.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 23:56:42 +01:00
emellor@ewan 186b17976c Clean up domains if creation/restoration fails.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 18:23:58 +01:00
emellor@ewan 186e5727ba Fix typo.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 17:54:33 +01:00
emellor@ewan 2c5923f7a9 Merge the child-process handling of the save and restore functions into one
forkHelper function.  Change the handling of file descriptor closure to wait
until both stdout and stderr descriptors have closed.  This may fix the
intermittent bug seen whereby xm restore; xend restart leaves the domain in a
misconfigured state, presumably because IntroduceDomain is not being called by
XendCheckpoint.restore.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 17:49:52 +01:00
emellor@ewan 440e4b259a Removed unused xen_domain method, and unused imports. Comment those methods
expecting domains_lock protection.  Remove notifications through eserver for
_add_domain and _delete_domain, and remove the notify parameters therein.

Tidy the exception handling in domain_restore_fd.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 16:38:04 +01:00
emellor@ewan ceb5b3d256 Fix call to state_set inside preserve (was erroneously calling set_state).
Tidy exception handling, and rename local 'channel' variable which was clashing
with the identical global name.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 16:27:16 +01:00
emellor@ewan a4986d8ff8 Fix xm restore broken by missing return statement.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 15:57:12 +01:00
jrb44@swoop.cl.cam.ac.uk e02845dc4a Merge to restore reverted changes. 2005-10-04 14:38:56 +01:00
jrb44@swoop.cl.cam.ac.uk 0cb67afc02 Merge. 2005-10-04 14:22:30 +01:00
emellor@ewan 4ab671f382 Catch xen.xend.XendProtocol.XendError as well as xen.xend.XendError.XendError.
This horror needs cleaning up -- this is just a stopgap.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 11:43:38 +01:00
emellor@ewan 81c4fa512f Fix localhost live migration. We were overvigorously wiping out the store
entries when a domain closed and on save, which meant that the /vm entries
disappeared when a localhost migration occurred.  XendCheckpoint has had extra
exception handling and logging added.  It also now calls back through
XendDomain.restore_,which has the correct locking semantics to prevent race
conditions during migration.

Added assertions to XendCheckpoint to ensure that the channels are set after
XendDomainInfo.restore.  I don't see why they would not be, and the old code
meant that in the case that they were not, IntroduceDomain would not be called
on the new domain, breaking Xend restart.

relocate calls through XendDomain.domain_restore_fd rather than directly to
XendCheckpoint to isolate XendCheckpoint from the rest of the world, and to
allow XendDomain to pass itself into XendCheckpoint for a callback.

Simplify the XendCheckpoint / XendDomainInfo interlock, giving only two
states, OK and TERMINATED.  If XendCheckpoint asks for a suspend, but sees a
shutdown, it is valid for it to proceed -- either way the domain has stopped.
Higher level tools may wish to disallow this, but at the very least, there is
no sense in waiting for a suspend that will never come.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 11:14:50 +01:00
emellor@ewan 6b6edfe1d5 Use the domain ID to refer to backends, not the UUID. This means that a new
backend is used on a localhost live migrate; migration was failing otherwise.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 11:01:38 +01:00
emellor@ewan 3a62270915 Cope with missing configuration information inside the configuration method.
This allows us to better recover if the store has been deleted.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 02:28:41 +01:00
emellor@ewan 5f189b1050 Move the import for XendError, and use a bare import, not a from...import.
This should silence the error message when the program is terminated during
startup.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 02:25:04 +01:00
emellor@ewan 3c28a0f427 Move XendDomainInfo.{create,recreate,parseConfig} to the top level of the
domain.  This allows us to refer to them using an import statement, rather than
a from .. import.  This is a step towards getting rid of the xroot hack.  All
other references to XendDomainInfo methods need to be doubly qualified (once
for the module, once for the class).

Remove XendDomainDict, replacing it with a simple dictionary, folding the
get_by_name method into XendDomain. 

Replace XendDomain.refresh_lock with a domains_lock which goes around any
reference to XendDomain.domains or anything that will create or destroy a
domain.  This serialises most accesses through XendDomain, ensuring that we will
not return stale state when racing against the watches fired in separate
threads.  This should have fixed bugs #270 and #234.

Added a number of domain_get_xyz methods.  Those named xyz_nr are to allow
components internal to XendDomain (XendDomainInfo, XendCheckpoint) to call back
into XendDomain without triggering further calls to XendDomain.refresh.  The
other methods simply make it clear which fallback behaviour is expected.

Replace XendDomainInfo.domain_exists with XendDomainInfo.domain_by_name; the
internals of this method needed to change to match those changes above, and it
has been a misnomer for some time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 02:21:28 +01:00
emellor@ewan b379670db6 Remove the reason code from the destroy action -- the reason is only of value
on a graceful shutdown.  Clarify the semantic difference between poweroff and
halt (we use halt to mean 'shutdown and stop' and poweroff to mean 'shutdown
and do whatever the configured behaviour is').

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 00:57:34 +01:00
emellor@ewan f020dc6069 Remove the reason code from the destroy action -- the reason is only of value
on a graceful shutdown.  Clarify the semantic difference between poweroff and
halt (we use halt to mean 'shutdown and stop' and poweroff to mean 'shutdown
and do whatever the configured behaviour is').

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 00:56:24 +01:00
emellor@ewan 0b630dbfca Remove the reason parameter from XendDomain.destroy -- it is useless. Accept
the halt shutdown reason inside XendDomainInfo.  This indicates that the
domain should be shutdown just like a poweroff, except that the domain is not
restarted, regardless of the on_poweroff configuration setting.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 00:30:49 +01:00
emellor@ewan c9577eb490 Added method XendDomain.privilegedDomain and use that inside DevController to
avoid hard-coding the domain ID 0.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-04 00:21:49 +01:00
emellor@ewan 6f75ef505d Cope with missing configuration information inside the configuration method.
This allows us to better recover if the store has been deleted.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-03 16:40:27 +01:00
emellor@ewan 6303fee512 Remove the reason code from the destroy action -- the reason is only of value
on a graceful shutdown.  Clarify the semantic difference between poweroff and
halt (we use halt to mean 'shutdown and stop' and poweroff to mean 'shutdown
and do whatever the configured behaviour is').

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-03 16:39:19 +01:00
emellor@ewan 81fd7244f5 Move the import for XendError, and use a bare import, not a from...import.
This should silence the error message when the program is terminated during
startup.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-03 16:33:09 +01:00
emellor@ewan 5cd7b9b437 The stopgap in changeset 7152:a73ab0ddf990 was broken -- revert the change to
domain_lookup_by_name, as it causes an infinite loop on startup.  Leave the
domain_lookup change.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-02 23:56:13 +01:00
emellor@ewan c8a89eae6b Move XendVnet from using DBMap etc to using xstransact. This is the last
dependency upon xsnode, xsobj, and xsresource, so these can all go.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-02 18:22:22 +01:00
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