Commit Graph
1205 Commits
Author SHA1 Message Date
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
emellor@leeni.uk.xensource.com b5761b9ca6 Added line of debugging to try and catch hotplug script race.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-14 12:11:41 +01:00
emellor@leeni.uk.xensource.com f15f365867 Allocate MAC addresses using Xensource Inc's new OUI.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-14 11:06:25 +01:00
emellor@leeni.uk.xensource.com deb1c115f9 The various changes to move to using info instead of passing the config
sxpr everywhere broke the use of a boot loader for booting with.  The
attached fixes things up so that
a) use of a bootloader ==> kernel not specified in the config file
b) don't cleanup bootloader files until after the domain has booted
c) rerun bootloader on reboot

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-11-12 18:59:56 +01:00
emellor@leeni.uk.xensource.com 2654fdd1f6 New Xenbus driver structure, bringing an explicit state machine to the table.
This will make the drivers more robust to failure of the other end, and makes
current driver state more visible.  It also allows us to bring very similar
pieces of code from the drivers together into the xenbus driver.  This should
be the start of a fix to the problem with block and net device hotplugging,
because the code was previously confused about the difference between the
connection state of the kernel device layer, and the state of the xenbus
communication.  This confusion is addressed here.

Much of this work is influenced by Rusty Russell's skeleton driver, recently
posted to xen-devel, as that piece made suggestions as to structure and
arrangement that have been taken on board, albeit pushed down into the xenbus
layer.

A new file xenbus_client.c has been added.  This file implements the interface
between the xenbus layer and the layer specific to the driver.  Access to
lower layers is still allowed for those who do not need all the facilities of
the new driver.

xenbus_dev_error has moved from xenbus_xs.c into xenbus_client.c, and
xenbus_dev_ok has been removed, in favour of xenbus_switch_state.

DevController.py now closes down a device by writing a change to the Closing
state on the backend, to allow the frontend time to close down properly.  Its
also writes the frontend and backend details within the same transaction.

The timeout on the hotplug scripts has been cranked down from 2 minutes to 5
seconds.

The diagnose script has been updated to parse the new states.

The blktab and tpm drivers have yet to be ported to this structure.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-11 21:59:05 +01:00
kaf24@firebug.cl.cam.ac.uk f8e8438eef Remove unnecessary NULL checks before freeing memory blocks.
The following functions check for NULL internally:
 free, kfree, xfree, free_xenheap_page[s]

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-11 12:55:47 +01:00
Xiaofeng Ling 05fbb602ad This patch use same expression as vif for vmx guest but has a distinguish "type=ioemu"
just like block device.
e.g. vif=['type=ioemu, mac=01:00:00:00:00:33, bridge=xenbr0']
type=ioemu to specify for vmx NIC device.
nics=4 can specify 4 vmx NIC now.
bridge is passed to device model now.
With this patch, the error
"Error: Device 0 (vif) could not be connected."
will not happen for creating vmx guest
currently, it happens on some linux distribution.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-11-10 17:07:13 +01:00
emellor@leeni.uk.xensource.com fcec6e9143 Added missing __init__.py.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-09 16:40:07 +01:00
emellor@leeni.uk.xensource.com 19744cdc5f Cope with the ValueError exception that we get if you use Xend with the recent
change to parsing memory configuration against a store with entries written
by an older Xend.

Added maxmem field to list of things to be read from the store on recreate.
2005-11-09 16:08:37 +01:00
smh22@firebug.cl.cam.ac.uk b99415e527 More fixes for save/restore; use configured memory for generating sxp.
Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-09 13:59:53 +01:00
emellor@leeni.uk.xensource.com 7a2e27bf0c Merged. 2005-11-08 14:56:14 +01:00
emellor@leeni.uk.xensource.com 3483f006f3 Fix two leaks in the pyxc interface. The dictionaries are being added
to lists, and an extra ref was being left behind.

Signed-off-by: Sean Perry <sean@xensource.com>
Signed-off-by: Robert Read <robert@xensource.com>
2005-11-08 14:53:27 +01:00
Michael.Fetterman@cl.cam.ac.uk 11f72f4ab9 merge 2005-11-08 14:41:25 +01:00
Michael.Fetterman@cl.cam.ac.uk c02e0c7355 merge 2005-11-08 13:30:05 +01:00
emellor@leeni.uk.xensource.com c0c4bfbea8 Merged. 2005-11-08 12:31:43 +01:00
kaf24@firebug.cl.cam.ac.uk e1734495d8 After move randomMac to netif in 7637, we need to this for vmx guest.
otherwise, if no mac address configured, vmx guest can not be created.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-11-08 12:16:37 +01:00
kaf24@firebug.cl.cam.ac.uk 65ab7fb0d4 merge 2005-11-08 11:44:48 +01:00
emellor@leeni.uk.xensource.com 882949f3f5 Remove unused parameter.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-08 11:35:25 +01:00
mafetter@seana.research.intel-research.net 2fc4655033 Fix vncviewer spawning so it actually works.
How did this ever work for other people?
2005-11-08 11:31:16 +01:00
emellor@leeni.uk.xensource.com e10bc057a5 Push the process of waiting for devices to come up right out of DevController,
and drive this process from xm create.  Architecturally, this separates the
process of domain creation from the process of waiting for devices, allowing
tools to choose when to perform that wait (if at all).  This places the waiting
in the same category as the unpause after domain creation, architecturally.

The main advantage to this approach is that it takes waiting for devices out
of the scope of XendDomain's domains_lock.  When restarting a domain, the
watch would fire for @releaseDomain while we were waiting for new domains to
come up.  This would deadlock the watch thread, as no more new watches could
be delivered.  Closes bug #387.

In the longer term, we expect to be able to wait for devices to come up
completely, not simply to wait for the hotplug scripts to run, and so it is
necessary then to move the waiting procedure right out of the server, so that
it can be performed after the domain unpause.  Without unpausing the domain,
the frontends will not come up, and so we cannot detect successful device
completion.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-08 03:34:23 +01:00
emellor@leeni.uk.xensource.com c311699be9 Rearrange restart logic so that a failure to restart a domain does not cause
cascading secondary errors.  Fixes bug #384.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-08 03:07:57 +01:00
emellor@leeni.uk.xensource.com 44ae505717 Mark plenty of variables as unused, and remove an unused import.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-08 02:51:34 +01:00
emellor@leeni.uk.xensource.com 2fe2ab90a2 Remove unused XENSTORED_XYZ constants.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-08 01:26:16 +01:00
emellor@leeni.uk.xensource.com a5ba036bad Rename parameter to avoid shadowing builtin.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 21:22:02 +01:00
djm@kirby.fc.hp.com c179fd9015 Merge latest xen-unstable into xen-ia64-unstable 2005-11-07 11:13:38 -06:00
jbulpin@wicket.uk.xensource.com 0e2ea3b8b4 Fixed syntax error in iopif patch.
Signed-off-by: James Bulpin <james@xensource.com>
2005-11-07 13:04:27 +01:00
emellor@leeni.uk.xensource.com ed9f6cba75 Move the randomMAC method from xm.create into server.netif. This way, it can
be shared with other command line tools, and the xm network-attach command.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:36:53 +01:00
emellor@leeni.uk.xensource.com 27be16e320 Hack around problem whereby VMX domains (using the ioemu device) now fail
because the new hotplug script error checking kicks in.

ioemu really ought to move out of blkif.py.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:35:06 +01:00
emellor@leeni.uk.xensource.com 3dd98c5e02 Added assertion, to stop it blowing up more obscurely a little later.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:30:35 +01:00
emellor@leeni.uk.xensource.com 34c75893fb Tidy exception handling on IntroduceDomain, quieten down one debug message, add
another.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:30:16 +01:00
kaf24@firebug.cl.cam.ac.uk 12f3d679c6 Add support for the ioport_permission dom0 op to xend and xm
xm now accepts a parameter 'ioports' that accepts a hex ioport
or ioport range, in the form 02f8[-02ff]

Signed-off-by: Jody Belka <knew (at) pimb (dot) org>
2005-11-07 12:05:15 +01:00
kaf24@firebug.cl.cam.ac.uk 4cf846fd30 Revert c/s 7626 -- it's missing a new file.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-06 19:50:33 +01:00
kaf24@firebug.cl.cam.ac.uk a8849f0aff Add support for the ioport_permission dom0 op to xend and xm
xm now accepts a parameter 'ioports' that accepts a hex ioport
or ioport range, in the form 02f8[-02ff]

Signed-off-by: Jody Belka <knew (at) pimb (dot) org>
2005-11-06 16:40:33 +01:00
kaf24@firebug.cl.cam.ac.uk bfd12bf9c5 Added domain_ioport_permission to the python module xen.lowlevel.xc,
wrapping the equivalent libxc call

Signed-off-by: Jody Belka <knew (at) pimb (dot) org>
2005-11-06 16:40:15 +01:00
kaf24@firebug.cl.cam.ac.uk d0f9b588c0 This patch adds a check to make sure the config file passed to
vnet-create is correct.  This is better than throwing IOError, because
IOError's are currently reported as xend communication failures.
Also, fix the IOError handling at the end of the file so we don't get
a stack dump if that path is taken.

Signed-off-by: Dan Smith <danms@us.ibm.com>
2005-11-04 11:06:41 +01:00
kaf24@firebug.cl.cam.ac.uk 06c12463fc This is another patch that adds an arg_check() to domid and domname so
that we don't dump stack if a user runs either without an argument.

Signed-off-by: Dan Smith <danms@us.ibm.com>
2005-11-04 11:05:10 +01:00
kaf24@firebug.cl.cam.ac.uk 4fc33b9db4 This patch adds an arg_check into the set_vcpus code in xm, so that we
don't output a stack trace if <2 arguments are passed.

Signed-off-by: Dan Smith <danms@us.ibm.com>
2005-11-04 11:03:20 +01:00
emellor@leeni.uk.xensource.com a9fc2ae6bc Fix handling of child in forkHelper.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-03 02:44:41 +01:00
emellor@leeni.uk.xensource.com fe1e7e447b Rewritten handling of child stderr to avoid deadlock.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-02 16:42:29 +01:00
emellor@leeni.uk.xensource.com 6a889fa0e3 Merged. 2005-11-01 16:02:43 +01:00
emellor@leeni.uk.xensource.com c174bece23 Catch KeyboardInterrupt, to avoid spewing error messages on Ctrl-C.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-01 15:57:19 +01:00
emellor@leeni.uk.xensource.com f8681f1674 Added missing __init__.py.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-01 15:24:47 +01:00
kaf24@firebug.cl.cam.ac.uk e4072e1c33 Fix the DISPLAY configration that breaks vmx domain creation with SDL
on vncserver or remote X. Changeset 7547 added a test of
opts.vals.display when getenv("DISPLAY"); because there is a default
value:localhost:0, that causes the test always to be true.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-11-01 10:31:25 +01:00
emellor@leeni.uk.xensource.com cb3d870a1a From Murillo Fernandes Bernardes <mfb@br.ibm.com>:
The problem is: There is no mechanism to detect block device setup failure

Network devices have the same problem, and are fixed with this too.

I handling this problem in the way suggested by aliguori:
- hotplug scripts write a "hotplug-status" node on store
- Xend DevController.createDevice() check verify this node and return success
or throw an exception on failure.
- If no changes in "hotplug-status" node after DEVICE_CREATE_TIMEOUT seconds
Xend throw an exception showing the problem with hotplug scripts.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-31 17:10:57 +01:00