Commit Graph
827 Commits
Author SHA1 Message Date
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
emellor@ewan 251888ee61 Move initDomain out of image.py and into XendDomainInfo. The only thing that
needed any of the state of image.py was the bootloader code, which says there,
but all the rest was doing something that belonged more properly in
XendDomainInfo, with all the other generic domain initialisation code.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-22 17:52:07 +01:00
emellor@ewan 8259cb8841 Added diagnostic message when RuntimeError is raised inside XenStore.exists.
This is one of the first things to be used when xenstored starts up, so a
corrupted filesystem may manifest itself here.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-22 17:50:29 +01:00
emellor@ewan 3f962c0f21 Merged. 2005-09-22 16:12:14 +01:00
emellor@ewan 9f70470c55 A number of changes to get save-restore working again:
Fix the use of configuration inside domain_configure.  The config written by
XendDomainInfo.sxpr has moved, and this function needs to change to match.

Re-add a call to _add_domain inside domain_restore.

Inside XendDomainInfo.restore, perform the appropriate configuration to restore
the domain.

Validate maxmem_KiB, and cap it at memory_KiB if over that value.  Save
requires that value to be correct, as the logic for saving only the pages
in use is not in place inside Xen.

Output the device configuration in sxpr(), as required for save-restore.

Check for image being null when trying to call createDeviceModel -- configure
is called on restore as well as create, and the ImageHandler instance is not
present in the former.

Remove dead code create_blkif.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-22 16:05:44 +01:00
emellor@ewan 3f69932eed This patch adds a check in xend that prevents a user from trying to
destroy Dom0.  Currently, xm does not return an error for this case.
Xend tries to destroy dom0 and leaves the system in an unstable
state.  Subsequent attempts to create a domain result in the following
error message:

  Error: Error creating domain: (106, 'Transport endpoint is already \
  connected')

This will fix bugzilla bug #243

Signed-off-by: Dan Smith <danms@us.ibm.com>
2005-09-22 11:35:35 +01:00
emellor@ewan 79e2c4bff3 VMX guest memory calculation in python code is corrupted by changeset
6984, this patch fixes it.

Also print vmx builder parameters before calling vmx builer, just like
what's done before calling linux builder.

With this patch, qemu dm using SDL can work, however qemu dm using VNC
still has bug, we will fix it soon.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2005-09-22 11:21:37 +01:00
emellor@ewan 7dfa4a382a this patch fixes the bug that when "cpu" is not set in config file,
control panel complains "Error creating domain - int argument required".
Signed-off-by: Xin Li <xin.b.li@intel.com>
2005-09-22 11:09:11 +01:00
emellor@ewan 1bb7afe544 Merge. 2005-09-21 15:25:58 +01:00
emellor@ewan f28ff9d5c0 Split the configuration file parsing and xc dominfo parsing aspects of
XendDomainInfo out from the rest of the code, creating an intermediate
dictionary of common format.  This means that the rest of XendDomainInfo can
work whether creating a domain for the first time, or whether xend is
restarted but the domains still exist.  This means that xend is now robust in
the face of restarts.  The phase of validation of configuration details is
now more explicit, and stronger too.

Change the handling of memory sizes in XendDomainInfo's interface to use KiB
in setMemoryTarget and getMemoryTarget.  This gives reasonable granularity
whilst ensuring that we can handle values up to 2TiB without overflowing a
signed 32 bit value.  It is not clear that the xend code, especially the C /
Python interface, is either 64-bit clean or unsigned 32-bit clean, so this is
the safest choice for now.  The behaviour of Python's shift operator will
change in Python 2.4, so it is best to address this problem once we have moved
to that version.

Determine the backend flags on-the-fly, in getBackendFlags, rather than
computing them in advance in configureBackends and storing the value.  Change
addControllerClass so that backend flag information is in this table too,
rather than hard-coded elsewhere.

Improve the error reporting for name clashes.

Remove XendDomainInfo's dependence upon DBMap, and use xstransact directly
instead.  This changes the interface from XendDomain to XendDomainInfo, as
paths rather than DBMaps are passed in.

Remove the XendDomainInfo.recreate and restore flags.  Since the device and
domain handling is now stateless inside xend, much less work is necessary for
recreate and restore procedures, so we can do without these flags.

Remove XendDomainInfo's unused dependency upon SrvDaemon, and its unnecessary
dependence upon PrettyPrint.  Remove the unused show method.

Decouple image.py from XendDomainInfo.bootloader by passing a bootloading flag
into initDomain instead.  Decouple it from XendDomainInfo.config by passing
the semiparsed device configuration into create().  Move configuration in
VmxImageHandler so that rather than being scattered around the class it is in
or called from the configure method.  Device configuration is no longer
available anywhere else.

From Dan Smith <danms@us.ibm.com>:

      I could not find in the existing code the point at which
      a domain was added to the XendDomain list after restore.  Several
      attempts to restore would result in positive log messages, but the
      restored domain would not show up in "xm list".  This patch includes a
      call to _add_domain(), which results in restore working for me.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-21 15:23:26 +01:00
emellor@ewan 0c41a8f422 Remove unused DEBUG variable, and -d flag.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-21 11:31:55 +01:00
emellor@ewan efa1534b26 Removed unused getLevel method, and don't use intermediate variable called
'log', as this name hides the global logger instance.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-21 11:30:59 +01:00
emellor@ewan df0fc046af Added diagnostic messages to the RuntimeError exceptions when they occur inside
_read and _write.  Fix gather to not return the string 'None' when reading a
value of type string that does not exist.  The value None should be returned
instead.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-21 11:29:23 +01:00
emellor@ewan 57ff2ac70a Lots of minor changes to please pylint, including matching the number of
parameters between functions in the base classes and those that override them
in subclasses.  It's hard to see how this code worked at all.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-21 11:26:31 +01:00
emellor@ewan 7bfeb73ad7 On one of pyxc_domain_getinfo's error paths, free the block allocated
previously.  This would have caused a memory leak when attempting to get info
on a domain that does not exist.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-21 11:24:26 +01:00
kaf24@firebug.cl.cam.ac.uk dd0403c3f2 Some cleanup in tpm-related files.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-09-21 10:13:11 +00:00
kaf24@firebug.cl.cam.ac.uk 5ec9c16433 Parse vcpus for VMX guest.
Vcpus are passed to device model and vmx domain builder.

Signed-off-by: Yan Li <yanx.li@intel.com>
Signed-off-by: Xin Li <xin.b.li@intel.com>
2005-09-21 09:58:15 +00:00
emellor@ewan 0a8fb66792 Remove unused variables and imports.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:31:22 +01:00
emellor@ewan 5a9ab7acc1 domain_setmaxmem takes an int, not a long, for the maxmem_kb parameter. The
underlying xc_domain_setmaxmem already took an unsigned int, and
PyArg_ParseTupleAndKeywords call was only parsing an int, so there is no way
that longer values would get through here in any case.  Fixing the documentation
and the local variable is the best solution, until someone decides that we need
to support maxmem values greater than 2TiB.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:29:57 +01:00
emellor@ewan f519344e5c Move definition of xc, to avoid confusing pylint.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:25:00 +01:00
emellor@ewan 96df3030e7 Remove unused import.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:24:27 +01:00
emellor@ewan c14c80d31d Mark unused variables as such. Remove unused import.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:22:20 +01:00
emellor@ewan bf0102c5f3 Move definition of xc variable, to save confusing pylint.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:21:39 +01:00
emellor@ewan 8aee1a239f Mark unused variable as such.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:20:20 +01:00
emellor@ewan a3d83fdeea Added debugging message to exception on write.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-20 17:19:19 +01:00
kaf24@firebug.cl.cam.ac.uk eafc6710fa The vmx guest loading is broken from 6925 because of the new
DevController code.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-09-20 16:13:01 +00:00
cl349@firebug.cl.cam.ac.uk 4037ef392f Fix vnc configuration issue for creating vmx guest.
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-09-20 09:43:29 +00:00