Commit Graph
1098 Commits
Author SHA1 Message Date
xenrtd@shispar-rt.testdev.hq.xensource.com 859804fbea Catch parsing errors in xm create. 2005-11-21 18:52:40 +01:00
emellor@leeni.uk.xensource.com dd6ab4433e Merged. 2005-11-21 18:47:31 +01:00
emellor@leeni.uk.xensource.com aecd7580d4 As with xs.c, change the module interface to match the current Python/C
tutorial, simplifying the interface here, and making it more conventional.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 18:46:09 +01:00
emellor@leeni.uk.xensource.com 2b2f00d237 Tidy use of module / package names.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 18:34:25 +01:00
emellor@leeni.uk.xensource.com 4922a76ab2 Merged. 2005-11-21 18:33:27 +01:00
emellor@leeni.uk.xensource.com 78d2a7ffe3 Return the changed path as an argument to the watch callback. This is useful
for the test CD, and simplifies DevController everso slightly.  It ought to be
generally useful, too.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 18:33:17 +01:00
emellor@leeni.uk.xensource.com e9653b1204 Remove many unnecessary uses of keyword arguments, to reduce complexity.
Have the self parameter to all the methods be an XsHandle, not a PyObject, to
avoid casting.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 17:48:22 +01:00
emellor@leeni.uk.xensource.com 0bed005388 Fix removal of use of scheduler, broken earlier today by mismerge.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 17:30:22 +01:00
emellor@leeni.uk.xensource.com f7abab3a59 Replace initialiser for readonly parameter in xshandle_init that should never
have been deleted.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 14:48:10 +01:00
emellor@leeni.uk.xensource.com 5d1f08e233 Merged. 2005-11-21 13:17:29 +01:00
emellor@leeni.uk.xensource.com 10201a9dd6 Removed, now unused.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 13:15:08 +01:00
emellor@leeni.uk.xensource.com 9282de479a Append the new device config to our internal structure, in device_create. This
will preserve the new device config across migration.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 13:14:38 +01:00
emellor@leeni.uk.xensource.com 431db49359 Catch RuntimeError inside initDomain, for better handling of out-of-memory, etc.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 13:13:57 +01:00
emellor@leeni.uk.xensource.com 875af1a9da Remove last remaining use of scheduler.py, so we can remove the whole module.
It's not worth a whole module to save us 8 characters of typing to start a
timer.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 13:12:09 +01:00
emellor@leeni.uk.xensource.com 8a20de98b5 Downgrade debug message to level "trace".
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 13:09:45 +01:00
emellor@leeni.uk.xensource.com cab9735d16 Added another test. Fix the existing tests to close the written config file
before running the test upon it, to ensure that the file is flushed.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 13:03:45 +01:00
emellor@leeni.uk.xensource.com bbd9571e5f Added reset method to Opts so that create.parseCommandLine can be used more than
once.  This makes it possible to unit test this code.  Remove the odd aliasing
of gopts to opts inside parseCommandLine.

Rename local variables globals and locals inside opts.load -- these are built-in
functions.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 13:00:36 +01:00
emellor@leeni.uk.xensource.com 8b3050a110 Remove whole piles of cruft from the connection layer. The only thing that was
using connectionMade, connectionLost, startedConnecting, clientConnectionLost,
and clientConnectionFailed was the test classes (TestClientFactory,
TestClientProtocol, TestServerFactory, TestServerProtocol), so they were
actually testing lots of code that no-one else was using.  All these classes
have gone, freeing up lots of cruft around.

The useless classes Factory, ServerFactory, ClientFactory, RelocationFactory,
UnixServerConnection, and TCPServerConnection have gone, in favour of passing
the Protocol class directly to SocketListener, and using SocketServerConnection 
directly.

connectTransport has gone, in favour of overriding connect directly.

Piles of closedown cruft has gone, as this was only supporting the correct
output of connectionLost events, none of which we need.

Unused SocketServerConnection.{getHost,getPeer} have gone.

Mark some parameters in relocate as unused.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 12:55:51 +01:00
emellor@leeni.uk.xensource.com 8c4aff7e06 Added method so that SrvDaemon can be run in the foreground without all the
forking implied by the start method.  This makes it easier to run valgrind
against Xend, or run it with a pydebug-compiled Python.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 12:44:43 +01:00
emellor@leeni.uk.xensource.com 0858255f54 Fix typo, and failure to unpack singleton tuple correctly.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 12:42:47 +01:00
emellor@leeni.uk.xensource.com 8c71f5197b Added unit test for the DevController subclasses.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 12:41:39 +01:00
emellor@leeni.uk.xensource.com dcae872252 Change the module registration declarations and change the object creation and
deallocation to match those in the Python/C tutorial.  This has been done to
make the interface here more conventional, in the hunt for bug #411.  One
double deallocation has been fixed, but this would only occur if we failed to
create the connection to Xenstore, and so unfortunately is not the cause of
that bug.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 12:40:02 +01:00
emellor@leeni.uk.xensource.com 3afa97b0f2 Remove all unnecessary uses of keyword arguments, to reduce complexity. In
many places we were supporting keywords for calling the methods here, and never
using that feature (especially where all the arguments were compulsory anyway)
and in some places we were even accepting positional and keyword arguments, and
not actually taking any arguments to the method at all!

Fix the permission parsing string in xspy_set_permissions -- this would have
blown up horribly if anyone were actually calling this code.

Fix the documentation comments to include the transaction handle throughout.

Have the self parameter to all the methods be an XsHandle, not a PyObject, to
avoid casting.

Remove unused pyvalue_int and pyvalue_str.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-21 12:34:37 +01:00
kaf24@firebug.cl.cam.ac.uk 6242befca2 Small build fix to Python xenstore interface library.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-11-20 10:18:29 +01:00
cl349@firebug.cl.cam.ac.uk ceb4196680 Revert 04a7decd0645b23f1f398340e927eb191f0e754d since it's not needed.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-11-19 04:35:37 +01:00
cl349@firebug.cl.cam.ac.uk ba0f86655c Fix support for sxp domain configuration files.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-11-19 01:59:43 +01:00
emellor@leeni.uk.xensource.com 72af5fff3b Merged. 2005-11-18 16:32:04 +01:00
emellor@leeni.uk.xensource.com 3b7259968a Remove one further reference to network_limit_help that I missed when merging.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-18 16:31:50 +01:00
emellor@leeni.uk.xensource.com eaa3641b4f Merged. 2005-11-18 14:30:47 +01:00
emellor@leeni.uk.xensource.com 224611c6da Remove barbaric abuse of goto out of one nested block and into a previous one.
Remove one other -- less barbaric but still horrible -- use of goto.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-18 14:28:38 +01:00
emellor@leeni.uk.xensource.com 7a9a19bd5a From Ken Grant: Add per command help / make help match new man pages.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-18 14:04:53 +01:00
emellor@leeni.uk.xensource.com 2f7678e706 Simplify the logic of each of the functions here, removing the many bizarre
uses of goto that reduce down to return NULL in any case, breaking the common
code out for returning values based upon the success or failure of an
operation, and the common code that parses transaction and path parameters,
used by xspy_read, xspy_ls, and xspy_mkdir.  Break out also the common code
that removes a watch token from the XsHandle watches list.

Use bool rather than int for result values, where this matches the same use
by tools/xenstore/xs.c.

Added missing free in xspy_get_permissions.

Use PySequence_SetItem inside xs_watch, rather than Py_INCREF followed by
PyList_SetItem.  If there is no None entry in the watches list, the code goes
on to append to the list using PyList_Append, and that call takes its own
reference rather than stealing one like PyList_SetItem.  This means that we
were previously leaking a reference if the list was full and so PyList_Append
was necessary.

Use PySequence_SetItem rather than Py_INCREF/PyList_SetItem also where we are
using assigning Py_None into the list, for neatness.

Remove meaningless pipe from xspy_release_domain's arg_spec.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-17 20:17:50 +01:00
smh22@tempest.cl.cam.ac.uk 99e88d6dd7 Trivial fixes for 64bit and xend.
Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-16 18:03:48 +01:00
smh22@firebug.cl.cam.ac.uk 4c908cf0e3 Many fixes for save/restore and related areas for PAE in particular. Now
should be able to save/restore successfully on machines with up to 16GB 
and any size of guest. 

Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-16 17:45:03 +01:00
emellor@leeni.uk.xensource.com 329d8364e0 Merged. 2005-11-16 15:50:36 +01:00
emellor@leeni.uk.xensource.com 02d6c42688 Watch for changes in the /vm section of the store, so that we update our
internal state if the store is configured by an external tool.

We react properly to changes in name and on_{reboot,poweroff,crash}.  Reacting
correctly to vcpus, vcpu_avail, memory, and maxmem will come soon (those code
aspects are already under review).  cpu_weight and bootloader to be considered.

Removed unused and semantically invalid method XendDomainInfo.setDomid.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-16 15:32:56 +01:00
emellor@leeni.uk.xensource.com 8676593f36 Added an unwatch method, so that XendDomainInfo can unregister the watch from
outside the watch handler.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-16 15:27:59 +01:00
emellor@leeni.uk.xensource.com 1edf495b0f Move the registration of the @releaseDomain watch so that we avoid a watch
between the watch firing and the first call to refresh. 

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-16 15:27:11 +01:00
emellor@leeni.uk.xensource.com a71d394cc3 Merged. 2005-11-16 13:38:16 +01:00
jmb@artemis.home.pimb.org 698d53df47 Dom0 might not be called Domain-0, so ask for the name in shutdown.py, instead of hardcoding it
Signed-off-by: Jody Belka <knew (at) pimb (dot) org>
2005-11-16 13:34:52 +01:00
kaf24@firebug.cl.cam.ac.uk 568a59e7fc Rename XENVER_parameters to slightly more informative
XENVER_platform_parameters.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-16 12:44:12 +01:00
emellor@leeni.uk.xensource.com 3bd89f2ebf Merged. 2005-11-16 11:32:14 +01:00
emellor@leeni.uk.xensource.com cb248d6b16 The following patch removes every (hopefully) reference to network-limit.
Upon further investigation it sets Device parameters that don't exist any
longer, thus causing exceptions.  As it looks like this is completely
obsolete, and no one is actively working on it, we should just rip it out to
end the confusion.

Signed-off-by: Sean Dague <sean@dague.net>
2005-11-16 11:31:57 +01:00
emellor@leeni.uk.xensource.com 63852bee47 Make watchStart and watchMain global functions rather than classmethods,
meaning that we no longer need to prefix all the field accesses with cls.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-15 19:19:02 +01:00
emellor@leeni.uk.xensource.com da5f951216 Merged. 2005-11-15 19:09:30 +01:00
emellor@leeni.uk.xensource.com 5d0f388f77 Have a watch callback return 0 or 1 depending upon whether it would like to
continue to receive watches.  This means that it is not necessary to probe
around in the xswatch internals to unregister a watch.

Tidy up the hotplug watch handling, moving the nested function out to a
separate place (I don't think that this was a problem in the end, but it was
making me nervous as I was debugging the recent race condition, and I find it
clearer out of the class in any case.  Pass an integer code representing
hotplug status, once it has been parsed from the store, as there are now a few
different places we can detect failure, and it's cleaner to pass a code from
those places.

Small tidy up to XendDomain, removing the unused releaseDomain field.
2005-11-15 19:08:11 +01:00
emellor@leeni.uk.xensource.com 9773f5386e Remove the handling of TypeError inside gather. It is not thrown by int()
when given a non-convertible value, as claimed by the comment, as the exception
ValueError is thrown in that situation.  TypeError is only thrown on int(None),
which cannot actually take place in this code, because of the explicit check
for None.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-15 18:47:39 +01:00
emellor@leeni.uk.xensource.com 56be995b8a This patch fixes dom0 SMP vcpu hotplug. Currently, domains without
config files (e.g. dom0) don't set info['vcpus'] correctly resulting in
incorrect cpu availablity values in the store.  This prevents hotplug
from functioning.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2005-11-15 17:30:55 +01:00
emellor@leeni.uk.xensource.com b195c30cf4 This patch fixes a number of vcpu related issues.
1.  xm vcpu-list now shows info for all vcpus by using
    info['max_vcpu_id']+1 as end of the range to query
    vcpu_info.
2.  Add new vcpu fields, online_vcpus, max_vcpu_id to
    XendDomainInfo.sxpr()
3.  Remove filter_cpump() which isn't needed now that
    the per vcpu cpumap field is correct.
4.  Update xm/main.py to use online_vcpus as the number
    vcpus to display in list.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2005-11-15 17:28:05 +01:00
emellor@leeni.uk.xensource.com f1d4a077ea Fix race between xspy_read_watch and xspy_watch, by placing the watch in the
xshandle's list of watches *before* registering the watch with Xend.

Closes bug #392.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-15 17:22:04 +01:00