Commit Graph
1465 Commits
Author SHA1 Message Date
Alastair Tse 4c1d89c12c [XEND] Exposing the XendAPI module in the XMLRPCServer
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk e9a4477bde [XM] new.py that implements adding an unstarted domain
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 43b265a495 [XM] Add commands to implement lifecycle commands via the XM XMLRPC interface.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 7904cd04b9 [XEND] Make SXP be compatible with sequencetypes (Tuples and Lists)
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 97465697cb [XEND][XENAPI] XendNode implementation for Xen API Host, Host CPUs
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 1d9888c989 [XEND] Add a convenience function for UUID generation
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 02af4f3cd3 [XEND][XENAPI] XendCheckpoint should use XendConfig for passing configs.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 8eb29e99bd [XEND] Implementation of Xen-API in a separate module.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 2a44e6fed4 [XEND] Change blkif to use the new style configuration
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 02ba67937c [XEND] Massive XendDomain XendDomainInfo reorganisation to use XendConfig.
* Added some constants to do with lifecycle management in XendDomain
* Added docstrings
* Made all private functions prefixed with an underscore (_)
* Added lifecycle management in XendDomain which stores configs in SXP
  format.
* Added bits of XenAPI support.
* Moved all XendDomainInfo constants to a separate file
* Moved most of the domain creation login into XendDomainInfo rather
  than in module level functions.
* Moved to use Xen API compatible reporting of state.
* Reorganised methods into logical groups in XendDomain and XendDomainInfo
* Moved all domain configuration validation into XendConfig
* Removed DevController cruft from the bottom of XendDomainInfo to
  XendDevices.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 9caccb8f48 [XEND] XendConfig is an extended python dictionary that is used to exchange
VM configuration information to allow easy import and export to different
file types.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 00a4566470 [XEND] Refactoring device controllers to its own module so it can be used by both XendConfig and XendDomainInfo.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 965e9d0ac4 [XEND][XENAPI] Split Xend global constants out to its own file.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 19ce2d7016 [XEND][XENAPI] Adding some default Xen API Errors
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 84269c54b1 [XEND] Minor code formatting changes to XendRoot.py
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 5bbd381a3b [XEND][LIFECYCLE] Configurable storage path for lifecycle support
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 80e180d5b3 [XEND] Clean up some keyword clashes with XendCheckpoint
- Replaced str with domstr
- Disabled changing domain name while migrating

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 61c5734192 [XEND] Xen API Auth Manager for handling sessions
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse ef46d763af [XEND] Make XMLRPC Server shutdown cleanly.
We can now catch the end of Xend and clean up domains accordingly.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse d03a635aec [XEND] Make logging an optional parameter for the XMLRPCServer
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk fa82d0c586 [XEND] Replace dom with domid.
* Also removed stray semicolon
* Fixed whitespace for pciif.py
* Moved DEV_MIGRATE_TEST to xen.xend.__init__.py

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 70527787db [XEND] Python API break. Replacing ambiguious 'dom' with 'domid'
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 4cd942004e [XEND] Minor stylistic fixes for XendBootloader.py
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 4c89cbf41f [XEND] Make import sxp into absolute import.
* Replacing import sxp with from xen.xend import sxp to avoid
confusion.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 39c3a03dfa [XEND] Fix backslash escaping so it ignores escapes if they don't make sense.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
kaf24@firebug.cl.cam.ac.uk bd769a8dd5 [HVM][TOOLS] Improve warnign message when trying to create
an HVM guest on a non-capable platform.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-30 11:35:02 +01:00
Andrew Warfield 8e7cc683c5 [BLKTAP][XEND] Fix blktap to work with a bootloader
If a Xen guest has a bootloader configured, then it will fail to start
on a blktap image.  The problem is blkdev_uname_to_file, which cannot
parse the "tap:aio:$filename" image strings: it tries to split the
string apart at ":" and assign the result to a 2-tuple, and this
results in a python error if the split results in three or more
strings.

The fix is to split only at the first ":", and then to split again
if we detect "tap:" as the image type.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-09-28 12:12:59 -07:00
atse@norwich.uk.xensource.com fbda4315cd [XM] Report proper ACMError(s) instead of silently exiting.
Remove try except blocks so that ACMError(s) are properly reported to
the user rather than silently fail.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:46:09 +01:00
atse@norwich.uk.xensource.com 9a7d719155 [XM] Remove traceback printing from load/makepolicy.py.
Should pass the exception along to xm/main.py to handle properly like
the rest of the commands.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:29:52 +01:00
atse@norwich.uk.xensource.com 665dff5cd1 [XM] Fix stray quotes in usage message in getlabel.py
Fixed built-in function name conflict.
Raise correct exceptions for when option is invalid to be properly
reported by xm.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:23:21 +01:00
atse@norwich.uk.xensource.com 3c9f8469ed [XM] Fix error reporting for resources.py, remove duplicate try block.
Also fixed usage message to not include misspelling of the command.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:16:11 +01:00
atse@norwich.uk.xensource.com 438289a1bd [XM] Removed traceback printing for non ACMError exceptions
Removing try,except block as cfgbootpolicy should allow exceptions to
propagate instead of printing traceback to stdout.
(http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=778)

Changed usage of string.join, string.split when creating security
policy path name.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 11:50:51 +01:00
atse@norwich.uk.xensource.com 9bb76d3442 [XM] Set proper return code for exceptions in xm, catch ACMError.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-28 12:03:10 +01:00
atse@norwich.uk.xensource.com 7ce79f6a21 There's a typo in create.py, which affects PV bootloaders (such as
domUloader and probably pygrub).  Patch attached.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-09-28 10:10:59 +01:00
kfraser@localhost.localdomain a301105b5b [XM] Fix 'xm uptime' command.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 14:01:30 +01:00
kfraser@localhost.localdomain 3c9113ced2 [XM] Fix domain reported by 'xm sched-sedf'.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 14:00:33 +01:00
kfraser@localhost.localdomain 6681aec641 [XM] Fix 'xm rmlabel' command.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 13:59:48 +01:00
kfraser@localhost.localdomain 32b51f8b72 [XM] Reenable the '-h' option, disabled in changeset:11572.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-27 13:58:46 +01:00
Emmanuel Ackaouy 7ccdaed2ed Adds support for the keyword 'all' to the vcpu-pin operation.
Using 'all' in place of a specific vcpu will apply the cpumask
to all vcpus in the domain.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2006-09-26 12:17:51 +01:00
kfraser@localhost.localdomain ad27570a65 [TOOLS] Wait for backend devices to set up before resuming execution
of a restored guest.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-25 09:11:52 +01:00
atse@norwich.uk.xensource.com bfde0c9ad7 [XM] Fix argument parsing for dump-core subcommand
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-23 13:39:32 +01:00
atse@norwich.uk.xensource.com 3918261f47 [XM][ACM] Add try,catch back to main() for dry-run
Signed-off-by: Alastair Tse <atse@xensource.com>
Signed-off-by: Bryan D. Payne <bryan@thepaynes.cc>
2006-09-22 17:46:32 +01:00
atse@norwich.uk.xensource.com 3b61bd783a [XM] Move 'xm sysrq' into main.py
* There's not need for sysrq to be in its own file.
* Bonus advantage: can use arg_check rather than gopts for argument
  validation.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 16:32:30 +01:00
atse@norwich.uk.xensource.com cef39afbe9 [XEND] Do not attempt core dump to directories.
- Abort core dump if destination is a directory.
- Throw appropriate XendError expection on failure.
Reported by Masaki Kanno <kanno.masaki@jp.fujitsu.com>.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 16:20:36 +01:00
atse@norwich.uk.xensource.com 15473a42cf [XEND] Remove hard tabs from destroyDevice()
Reported by Hollis Blanchard.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 15:56:19 +01:00
atse@norwich.uk.xensource.com 8554ba8909 [XEND] Check for invalid memory sizes.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2006-09-22 15:36:11 +01:00
atse@norwich.uk.xensource.com 1681108c98 [XM] Text wrapping fix, xm create --help_config fix.
* Fix text wrap so it doesn't chop off last word in help message for
  certain cases.
* Fix handling of xm create --help_config
* Remove redundant gopts.usage() call.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 15:06:00 +01:00
atse@norwich.uk.xensource.com f88384ec46 [XM] Error handling cleanup
Introducing an OptionError exception to be used by all xm subcommands
to signal an error in the arguments. "xm" will catch these and output
the appropriate error and usage message.

Detailed Changes:

main.py:
 *  Cleaned up imports and moved warning filter outside of
    import block.
 *  Converted usage parameters and description to a python
    dict rather than strings to enable better usage help
    formatting.
 *  Removed unused list_label domain command.
 *  Added cmdHelp() prints out usage message for any command
 *  Added shortHelp() prints out the default help message when
    xm is invoked with no arguments.
 *  Added longHelp() prints out long help message when invoked
    with xm --help or xm help.
 *  Added extra optional paramter to getDomains() so we can
    tell Xend not to poll devices. This will speed up xm list.
    (PENDING changes to Xend itself.)
 *  Changed all references where 'dom' actually means 'domid'
    to use the correct name.
 *  Changed 'xm list' header format to use printf formatting style.
 *  Renamed xm_subcommand to xm_importcommand so it is more
    clear what it is doing (all xm commands are subcommands!)
 *  Moved cpu_make_map() inside xm_vcpu_pin as an anonymous func.
 *  Use OptionError whenever an invalid option is detected in xm.
 *  Added proper catch and error printing for XendError and
    OptionErrors in main().

addlabel.py:
cfgbootpolicy.py:
dry-run.py:
dump-policy.py:
get-label.py:
labels.py:
loadpolicy.py:
makepolicy.py:
rmlabel.py:
resources.py:
 *  Replaced usage() with help() that is called from main.py
 *  Replaced usage() invokation with raising OptionError

opts.py:
 *  Added very simple wrap() function that behaves differently
    to textwrap.wrap()
 *  Added OptionError()
 *  Replaced the string representation of Opt, Opts to output
    a nicely formatted usage message.
 *  Changed class Opts itself will throw approriate OptionErrors.
 *  Changed set_bool to recognise 'y' and 'n' as valid input

create.py:
 *  Some whitespace and column width cleanup.
 *  throws OptionError if encounters option error.

migrate.py:
 *  Replace usage() message with the string representation of
    gopts.

sysrq.py:
 * Replace usage message with throwing OptionErrors

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-22 11:37:31 +01:00
Tim Deegan 76ccc6e959 Merge 2006-09-21 15:04:29 +01:00
Tim Deegan 1c80d1b0a3 [XEND] Don't prepend '/dev/' to any absolute path.
Check for '/' rather than '/dev/' when translating e.g. 'hda'->'/dev/hda'
Signed-off-by: Tim Deegan <tim.deegan@xensource.com>
2006-09-21 15:00:50 +01:00