Commit Graph
1831 Commits
Author SHA1 Message Date
Ewan Mellor 16d8fd16ce Fix PV_initrd reference (should be PV_ramdisk).
Signed-off-by: Stefan Berger <stefanB@us.ibm.com>
2006-12-27 15:44:40 +00:00
Ewan Mellor bde11044ca Added network.{create,destroy}, and PIF.{create,create_VLAN,destroy}, and
a first blush at support for VLANs through Xen-API.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-27 15:42:56 +00:00
Ewan Mellor b16ecf8d4e Added Brctl.get_state, to support upcoming PIF implementation.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-27 15:39:32 +00:00
Ewan Mellor 85a87721a7 Override logging.Logger.findCaller so that the trace function here does not
appear as the source of log messages.

Remove the logger name from the log format -- it's adding no useful information.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-27 15:39:04 +00:00
Ewan Mellor bbe21e102e Tidy and fix bindings for the SR class.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-27 11:49:59 +00:00
Ewan Mellor 866cc9cd43 Fix HVM booting through Xen-API when the kernel is unspecified.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-27 00:38:01 +00:00
Ewan Mellor 53211200e3 Tidy up bindings for VDI class.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-27 00:35:27 +00:00
Ewan Mellor 894243ac7b Implement VM_BAD_POWER_STATE handling.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 19:29:05 +00:00
Ewan Mellor 686cfca86a Persist the VLAN setting.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 17:02:16 +00:00
Ewan Mellor 0d46f85d6c Fix plumbing for PIF calls. Change xen_api_success to convert None to the
empty string, to make it easier to write setters.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 16:56:46 +00:00
Ewan Mellor 8f56ead6e6 Persist network details when they change.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 16:42:24 +00:00
Ewan Mellor 0a8e4657af Implement network.set_{name_{label,description},default_{gateway,netmask}}.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 16:36:48 +00:00
Ewan Mellor 05c6990f46 Implement network.get_{name_{label,description},default_{gateway,netmask}}.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 16:32:35 +00:00
Ewan Mellor d33afed19d Change the way that networks and PIFs relate to each other -- the PIF holds a
reference to the network (and the host) not the other way around.  Persist only
the necessary details for the network (not the set of PIFs and VIFs).

Fix the plumbing of the network class inside XendAPI, and implement a few more
functions.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 16:26:51 +00:00
Ewan Mellor c1a482bad3 Cope with corrupt or empty VDI config files. Have to_record return strings
rather than integers, as required by the Xen-API spec.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 16:24:15 +00:00
Ewan Mellor 5474facc9b Change the way that MESSAGE_PARAMETER_COUNT_MISMATCH is diagnosed (using a
separate dictionary to record parameter counts, rather than trying to parse them
out of the exception) and tidy up the validator preprocessing and the
validators themselves.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 16:20:23 +00:00
Ewan Mellor 36d5fb9d37 Plumb the new PIF and network implementations in through the XendAPI class.
Use the new stateful records to save host, SR, network, and PIF configuration.
Add extra functionality to the SR class, to calculate capacities et al.

By Alastair Tse <atse@xensource.com>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 15:04:28 +00:00
Ewan Mellor d3fa64928f Added get_record method.
By Alastair Tse <atse@xensource.com>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 14:59:11 +00:00
Ewan Mellor d9510a25ab New XendNetwork and XendPIF classes, for implementing the Xen-API network and
PIF classes.

By Alastair Tse <atse@xensource.com>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 14:47:36 +00:00
Ewan Mellor 3e9ef3ef0a Added support for state records in Xend, for keeping storage and network
details.

By Alastair Tse <atse@xensource.com>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 14:38:25 +00:00
Ewan Mellor 6e59829ed2 Adjust the argument counts for a MESSAGE_PARAMETER_COUNT_MISMATCH to account for
the fact that XenAPI adds the session handle transparently.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-25 14:32:41 +00:00
Ewan Mellor 84172b6306 Don't try to copy the .mo files if they haven't been built.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 21:32:05 +00:00
Ewan Mellor 5bde93a974 Added retry behaviour when receiving SESSION_INVALID. This means that xm shell
and XenAPI.Session will reauthenticate across a Xend restart.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 20:20:34 +00:00
Ewan Mellor 42a0276111 Only build the message database if msgfmt is installed.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 19:06:31 +00:00
Ewan Mellor 8ecdc794ab Added I18N support for Xen-API error codes.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 11:24:10 +00:00
Ewan Mellor 055785c1c8 Move get_by_uuid to the right place to have the input validated. The recent
move was wrong.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-23 11:23:27 +00:00
Alastair Tse 720520b42d [XEND] Fix parsing of bootloader and bootloader_args in XendConfig
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-12-22 11:58:22 +00:00
Ewan Mellor 86650d1bd2 Added Xen-API-style error handling for INTERNAL_ERROR and
MESSAGE_METHOD_UNKNOWN.  Only add the Xen-API methods to the official Xen-API
XML-RPC server, not to the legacy one.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-22 11:39:29 +00:00
Ewan Mellor 9cb668c334 Move the decoration of all the Xen-API methods out of XendAPI.__init__ and
into the module scope.  This avoids the decorators being added multiple times,
once for each server running.

Fix handling of MESSAGE_PARAMETER_COUNT_MISMATCH in many cases.  Move the
get_by_uuid declarations, so that those functions get the per-class validator
as well, to check for existence of the object requested.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-22 11:38:05 +00:00
Ewan Mellor 4de19fce56 Cope with a response that's not a dictionary.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-22 11:34:13 +00:00
Ewan Mellor a72da7c894 Add a function for creating a domain from an existing XendConfig, and use that
on reboot, rather than writing out sxp and reparsing.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-21 17:39:32 +00:00
Alastair Tse 126fd46d21 [XEND] Xen API commands cleanup.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-12-21 14:49:19 +00:00
Alastair Tse eb6c68c585 [XEND] Minor syntax cleanup in security.py for sxp parsing.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-12-21 14:33:37 +00:00
Ewan Mellor 78e2e56bdc Implement the major part of the new error handling for the Xen-API.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-21 15:16:25 +00:00
Alastair Tse bbfa63024e [XEND] Add cpu_weight and cpu_cap parsing for SXP config create
Reported by Masaki Kanno on :
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=835

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-12-21 12:08:27 +00:00
Alastair Tse 3f3404d127 [XM] Throw proper exception for xm console for unstarted domains.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-12-21 12:05:41 +00:00
Julian Chesterfield 518df287df Qcow-create reserve flag update.
Signed-off-by: Julian Chesterfield <julian@xensource.com>
2006-12-19 21:33:12 +00:00
Ewan Mellor 9dc2a309b5 Fix parsing of cpus in the guest configuration file.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2006-12-19 12:00:11 +00:00
Ewan Mellor 75bbf9d488 Fix _login to pass arguments to the server unconditionally, rather than
requiring precisely two on the client-side.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-18 00:14:40 +00:00
Ewan Mellor 6d6cd40676 Fix the parsing of the image sexpr to use PV_kernel et al, rather than the old
kernel_ variables.  This fixes reboot of PV guests.

Also, give XendConfig its own logger, to allow us to tweak the log level for
that module independently.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-18 00:07:55 +00:00
Ewan Mellor 99ffd43bcd Write the xfb configuration details to the store, rather than storing them in
memory.  This ensures that the VM can be rebooted after a xend restart.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-18 00:00:57 +00:00
Ewan Mellor c7272094f3 Minor tidyup.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-17 23:59:08 +00:00
Ewan Mellor cbdf115ddb Fix printing of usage when OptionError is thrown.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-17 18:24:40 +00:00
Ewan Mellor 324ad7a4a8 An error occurs if the first detach was successful and the 2nd one is
not (of course). Return if the 1st detach is successful, try the 2nd one
if it was not successful. Throw an error if the 2nd one fails.
This should also fix problems I am currently seeing in the xm-test
suite.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-12-16 12:52:18 +00:00
Brendan Cully 24a6ed484b Improve XendCheckpoint's forkHelper error handling.
When inputHandler raises an exception, close stdin and stdout in the
child before attempting to close stderr, which is held open by a
separate thread. Without this patch, exceptions raised by device
migration caused xend to hang on child.childerr.close().

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2006-12-13 17:45:50 -08:00
Ewan Mellor 0a38a347b7 Persist all the Xen-API data values for VMs.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-16 12:49:23 +00:00
Ewan Mellor cd48fe7de0 Write the new version of the persisted config to a tempfile and then rename it,
to avoid corrupting the file on failure.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-15 17:19:00 +00:00
Ewan Mellor 539d271eff Allow the XenAPI Session object to have login_with_password called as a
methodname, to re-login through the same object (say when the server is
restarted).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-15 17:18:02 +00:00
kfraser@localhost.localdomain a090ca495e VNC pasword authentication support for the paravirt framebuffer server.
The rules for configuring the password are equivalent of those used
for HVM, but the actual guest config option is a little different as a
result of the recent refactoring of the PVFB config file syntax.

 - If the 'vfb' option in the guest config has a 'vncpasswd' parameter
   specified
      - If the passwd is not zero length, use that
      - Else run with no authentication (important as it enables
        override of next rule)
 - Else-if the xend-config.sxp has a password specified use that
 - Else run with no authentication

Example configuration:

 - To set an explicit guest password:
    vfb = [ "type=vnc,vncunused=1,vnclisten=0.0.0.0,vncpasswd=123456"]

 - To disable authentication, overriding any XenD configured
   default password
    vfb = [ "type=vnc,vncunused=1,vnclisten=0.0.0.0,vncpasswd="]

 - To run with default XenD configured password (if any)
    vfb = [ "type=vnc,vncunused=1,vnclisten=0.0.0.0"]

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2006-12-15 17:33:31 +00:00
Ewan Mellor 1c67fc6446 Fix mem-set, mem-max, and vcpu-set commands when used against inactive domains.
Signed-off-by: Daniel P. Berrange  <berrange@redhat.com>
2006-12-15 11:50:04 +00:00