aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python
Commit message (Collapse)AuthorAgeFilesLines
* Some cleanup in TPM-related files and implementation of functionality that kaf24@firebug.cl.cam.ac.uk2005-10-071-4/+2
| | | | | | | | got lost when switching to xenbus. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
* Change xs_read_watch interface to return a sized array (in userspace and inkaf24@firebug.cl.cam.ac.uk2005-10-071-3/+4
| | | | | | | | | | | kernel). Add index macros (XS_WATCH_*) for accessing the array to allow for future expansion. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Regig the construction of new domains so that restore and create can share theemellor@ewan2005-10-071-17/+11
| | | | | | | | construct method. This ensures that the domain will have any stale paths in the store removed on restore. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Merge.emellor@ewan2005-10-072-6/+8
|\
| * Big simplification of the Xen event-channel interface.kaf24@firebug.cl.cam.ac.uk2005-10-072-6/+8
| | | | | | | | | | | | | | | | EVTCHNOP_bind_interdomain in particular is much simpler. Signed-off-by: Keir Fraser <keir@xensource.com>
* | Rename the source domain on migration, regardless of the live flag. This fixesemellor@ewan2005-10-071-5/+5
|/ | | | | | | localhost non-live migration, and bug #297. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Fix conflicting merge.emellor@ewan2005-10-071-1/+1
| | | | | Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Merged.emellor@ewan2005-10-065-272/+29
|\
| * User tools send evtchn notifications via /dev/xen/evtchnkaf24@firebug.cl.cam.ac.uk2005-10-061-119/+2
| | | | | | | | | | | | | | | | rather than using hypercall directly. Signed-off-by: Keir Fraser <keir@xensource.com>
| * Change how event channels are allocated and used by the controlkaf24@firebug.cl.cam.ac.uk2005-10-065-153/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | tools. /dev/xen/evtchn is now used by daemons to connect to remote domains: the advantage is that the local ports are garbage collected automatically if the daemon dies. xen no longer constructs end-to-end event-channel port pairs -- it allocates an unbound port in new domU and writes that port to xenstore. It is then picked up by teh appropriate daemon which does interdomain bind via /dev/xen/evtchn. Signed-off-by: Keir Fraser <keir@xensource.com>
* | Remove xm commands block-refresh and vbd-refresh, as these are unsupported.emellor@ewan2005-10-067-51/+51
|/ | | | | | | | | | | | Allow xm block-detach to take a device name as well as a device ID. This closes bug #285 and fixes xm-test's 01_block-destroy_btblock_pos.py and 02_block-destroy_rtblock_pos.py. Rename and reconnect XendDomainInfo.configureDevice to reconfigureDevice. There is nothing using this at the moment, mind you. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Added Zope's test.py, and a unit test to sxp. This test itself isn't veryemellor@ewan2005-10-067-1/+1180
| | | | | | | | 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>
* Merged.emellor@ewan2005-10-063-8/+23
|\
| * mixup in vcpu-enable and vcpu-disable help stringvh249@kneesaa.uk.xensource.com2005-10-051-2/+2
| | | | | | | | | | Signed-off-by: Vincent Hanquez <vincent@xensource.com>
| * Activate suspending/resuming of the TPM interface and addkaf24@firebug.cl.cam.ac.uk2005-10-051-1/+16
| | | | | | | | | | | | | | | | some missing code to tpmif.py. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
| * EVTCHNOP_alloc_unbound can allocate a port in an arbitrarykaf24@firebug.cl.cam.ac.uk2005-10-051-5/+5
| | | | | | | | | | | | | | | | domain (only if the caller is sufficiently privileged). Signed-off-by: Keir Fraser <keir@xensource.com>
* | Rename all dying domains to be prefixed with Zombie. This allows a new domainemellor@ewan2005-10-061-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Reduce the log level for the 'cannot recreate information for dying domain'emellor@ewan2005-10-061-6/+11
| | | | | | | | | | | | | | message for all but the first refresh when Xend starts. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* | Issue diagnostic if we find dying domains on Xend restart, because we will notemellor@ewan2005-10-061-20/+25
| | | | | | | | | | | | | | | | | | | | 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>
* | Raise an exception if an error appears on the pipes to our children, and makeemellor@ewan2005-10-061-27/+39
|/ | | | | | | | | 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>
* Fix the handling of VCPUs, specifically wrt the broken VCPU hotplugging, bugemellor@ewan2005-10-051-44/+65
| | | | | | | | | | | | | #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>
* Change boolean config option parsing to allow True and Y and similar usefulemellor@ewan2005-10-051-3/+4
| | | | | | | things. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Recover from name uniqueness violation by renaming. Fixes bug #277.emellor@ewan2005-10-052-6/+24
| | | | | Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Removed the EventServer, replacing the events fired with simple loggingemellor@ewan2005-10-057-337/+25
| | | | | | | | | | | 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>
* imported patch /home/emellor/block_detach.patchemellor@ewan2005-10-052-2/+14
|
* Explicitly close files on save and restore. Rename all local variables ↵emellor@ewan2005-10-051-57/+46
| | | | | | | named id or slice so as not to clash with the builtins. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Explicitly close files.emellor@ewan2005-10-041-9/+16
| | | | | Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Clean up domains if creation/restoration fails.emellor@ewan2005-10-041-10/+24
| | | | | Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Fix typo.emellor@ewan2005-10-041-1/+1
| | | | | Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Merge the child-process handling of the save and restore functions into oneemellor@ewan2005-10-041-77/+73
| | | | | | | | | | | 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>
* Removed unused xen_domain method, and unused imports. Comment those methodsemellor@ewan2005-10-041-36/+16
| | | | | | | | | | 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>
* Fix call to state_set inside preserve (was erroneously calling set_state).emellor@ewan2005-10-041-16/+16
| | | | | | | | Tidy exception handling, and rename local 'channel' variable which was clashing with the identical global name. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Fix xm restore broken by missing return statement.emellor@ewan2005-10-041-1/+1
| | | | | Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Merge to restore reverted changes.jrb44@swoop.cl.cam.ac.uk2005-10-041-0/+9
|\
| * Catch xen.xend.XendProtocol.XendError as well as xen.xend.XendError.XendError.emellor@ewan2005-10-041-0/+9
| | | | | | | | | | | | | | This horror needs cleaning up -- this is just a stopgap. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* | Merge.jrb44@swoop.cl.cam.ac.uk2005-10-046-432/+513
|\ \ | |/ |/|
| * Fix localhost live migration. We were overvigorously wiping out the storeemellor@ewan2005-10-044-155/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Use the domain ID to refer to backends, not the UUID. This means that a newemellor@ewan2005-10-041-1/+1
| | | | | | | | | | | | | | backend is used on a localhost live migrate; migration was failing otherwise. Signed-off-by: Ewan Mellor <ewan@xensource.com>
| * Cope with missing configuration information inside the configuration method.emellor@ewan2005-10-042-6/+12
| | | | | | | | | | | | | | | | This allows us to better recover if the store has been deleted. Signed-off-by: Ewan Mellor <ewan@xensource.com>
| * Move the import for XendError, and use a bare import, not a from...import.emellor@ewan2005-10-041-5/+6
| | | | | | | | | | | | | | | | | | This should silence the error message when the program is terminated during startup. Signed-off-by: Ewan Mellor <ewan@xensource.com>
| * Move XendDomainInfo.{create,recreate,parseConfig} to the top level of theemellor@ewan2005-10-044-262/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Remove the reason code from the destroy action -- the reason is only of valueemellor@ewan2005-10-042-25/+11
| | | | | | | | | | | | | | | | | | 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>
| * Remove the reason code from the destroy action -- the reason is only of valueemellor@ewan2005-10-043-9/+5
| | | | | | | | | | | | | | | | | | 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>
| * Remove the reason parameter from XendDomain.destroy -- it is useless. Acceptemellor@ewan2005-10-042-15/+8
| | | | | | | | | | | | | | | | | | 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>
| * Added method XendDomain.privilegedDomain and use that inside DevController toemellor@ewan2005-10-042-2/+16
| | | | | | | | | | | | | | avoid hard-coding the domain ID 0. Signed-off-by: Ewan Mellor <ewan@xensource.com>
| * The stopgap in changeset 7152:a73ab0ddf990 was broken -- revert the change toemellor@ewan2005-10-021-1/+0
| | | | | | | | | | | | | | | | 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>
* | Cope with missing configuration information inside the configuration method.emellor@ewan2005-10-032-6/+12
| | | | | | | | | | | | | | This allows us to better recover if the store has been deleted. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* | Remove the reason code from the destroy action -- the reason is only of valueemellor@ewan2005-10-035-34/+16
| | | | | | | | | | | | | | | | | | 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>
* | Move the import for XendError, and use a bare import, not a from...import.emellor@ewan2005-10-031-5/+6
|/ | | | | | | | This should silence the error message when the program is terminated during startup. Signed-off-by: Ewan Mellor <ewan@xensource.com>
* Move XendVnet from using DBMap etc to using xstransact. This is the lastemellor@ewan2005-10-025-1192/+29
| | | | | | | dependency upon xsnode, xsobj, and xsresource, so these can all go. Signed-off-by: Ewan Mellor <ewan@xensource.com>