Commit Graph
303 Commits
Author SHA1 Message Date
smh22@firebug.cl.cam.ac.uk b4c7ff25ae Fix race in blkfront resume path (watch thread could fire watch during the
(short-ish) time that we were in BLKIF_STATE_DISCONNECTED). 

Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-17 14:56:50 +01:00
emellor@leeni.uk.xensource.com 56bb0fdcd9 Merged. 2005-11-17 12:12:57 +01:00
emellor@leeni.uk.xensource.com 439bebba61 Here's the patch for making the otherend_changed entrypoint
optional.  The USB driver doesn't need this entrypoint because the state
machine driven by it is factored out of the driver code entirely into
xenidc.

Signed-off-by: Harry Butterworth butterwo@uk.ibm.com
2005-11-17 11:54:52 +01:00
kaf24@firebug.cl.cam.ac.uk 77625388ed Fix IOCTL_PRIVCMD_GET_MACH2PHYS_MFNS to work properly for
4MB superpages (32-bit non-pae).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-17 11:47:49 +01:00
smh22@firebug.cl.cam.ac.uk 4c908cf0e3 Many fixes for save/restore and related areas for PAE in particular. Now
should be able to save/restore successfully on machines with up to 16GB 
and any size of guest. 

Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-16 17:45:03 +01:00
kaf24@firebug.cl.cam.ac.uk 250a814ea4 Remove unnecessary cast of kmalloc() result.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-11-16 11:35:26 +01:00
kaf24@firebug.cl.cam.ac.uk 7cfd98e2f1 Correctly export xencons functions to avoid ugly 'extern'
declarations.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-11-16 11:32:19 +01:00
kaf24@firebug.cl.cam.ac.uk 4f114eacb2 Fix function that shouldn't be globally defined.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-11-16 11:30:32 +01:00
kaf24@firebug.cl.cam.ac.uk 119496c00d Trivial coding style fix.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-11-16 11:29:52 +01:00
kaf24@firebug.cl.cam.ac.uk b30b10f57a Replace 0 with NULL when assigning pointer fields/parameters.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-11-16 11:27:19 +01:00
kaf24@firebug.cl.cam.ac.uk 3741b397bd Fix 64-bit build that I broke by making acpi table mapping
fixup dependent on CONFIG_XEN_X86 (that only xen/i386
defines).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-15 19:46:48 +01:00
kaf24@firebug.cl.cam.ac.uk 84cf021917 acpi change is Xen/x86 specific, so make it dependent on
CONFIG_XEN_X86.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-15 17:02:37 +01:00
kaf24@firebug.cl.cam.ac.uk 1ae4120aa8 Declare local variables at the start of a block, not in the middle
(ISO C constraint).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-14 11:47:38 +01:00
kaf24@firebug.cl.cam.ac.uk 26ed038491 Clean up xenstore/console shared page initialisation, which is
now handled solely by the domain builder.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-14 11:36:42 +01:00
kaf24@firebug.cl.cam.ac.uk 3947efa1c2 Revert accidentally applied changes from changeset
7783:5aad7e145e501fbfb346954950a33b042a963633.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-14 11:35:50 +01:00
kaf24@firebug.cl.cam.ac.uk e7b975b0b6 If /sbin/ isn't in the path, udev rules will erroneously not get
installed.

Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
2005-11-14 11:05:34 +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
emellor@leeni.uk.xensource.com 65052bf1d8 New location for code common to both netfront and netback, with the MAC parsing
pulled here.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-11 17:59:20 +01:00
kaf24@firebug.cl.cam.ac.uk 7be6aca3ad Missed two files from NULL-pointer-check changeset.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-11 14:54:20 +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
kaf24@firebug.cl.cam.ac.uk 5aa99be215 Merge with xen-unstable-ia64.hg 2005-11-11 10:47:43 +01:00
kaf24@firebug.cl.cam.ac.uk 41317fc7d5 Remove unnecessary ifdef in defn of xprintk. Install
xenguest.h.
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2005-11-11 10:39:20 +01:00
djm@kirby.fc.hp.com 093551c035 Merge latest xen-unstable into xen-ia64-unstable 2005-11-10 08:34:09 -06:00
kaf24@firebug.cl.cam.ac.uk 4440e29b50 Indirect writes to phys_to_machine_mapping array through an inline
function defined in page.h.

For self-migration, I need the ability to trap writes to the p2m map
during migration, because I keep a dictionary mapping mfns to pfns,
which I use for remapping the page tables once I am on the other side.

Signed-off-by: Jacob Gorm Hansen <jacobg@diku.dk>
2005-11-10 15:16:01 +01:00
kaf24@firebug.cl.cam.ac.uk 2ea876d2a0 Attached patch allows building of netfront and blkfront as modules
(xennet.ko and xenblk.ko).  

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-11-09 14:42:15 +01:00
kaf24@firebug.cl.cam.ac.uk 69e309b3b1 Remove use of get_gendisk in blkfront gen_gendisk is no long exported
by 2.6 kernel. Now blkfront can be built as a kernel module.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-11-09 14:41:14 +01:00
djm@kirby.fc.hp.com 64123904fb Fix domU (by Kevin Tian) 2005-11-08 12:15:55 -06:00
kaf24@firebug.cl.cam.ac.uk 366aac2d16 Rationalise the kernel event-channel binding interfaces. The
new interfaces are simpler and should be implementable by any
architecture.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-08 15:58:31 +01:00
emellor@leeni.uk.xensource.com 7aa98216f5 Increase the static constant default number of loopback interfaces, nloopbacks,
to 8.  These interfaces are very cheap, so there's no problem having a few
spare.  Anyone with more than 8 NICs can still use the kernel command line or
the module parameter line to pass a larger limit to this module.

Detail the kernel command line parameter for nloopbacks in the diagnostic in
network-bridge.

Closes bug #381.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-08 15:15:02 +01:00
djm@kirby.fc.hp.com 7d9cb9cf9b Missed ia64 changes to one drivers/xen file 2005-11-07 11:25:59 -06:00
djm@kirby.fc.hp.com c179fd9015 Merge latest xen-unstable into xen-ia64-unstable 2005-11-07 11:13:38 -06:00
kaf24@firebug.cl.cam.ac.uk 676ad5da47 fast_flush_area() should index the unmap request array using
invcount, not i. Also, fix initialisation of pending_grant_handles:
it was happening too late, and the use of memset() was bogus.

Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-07 12:52:49 +01:00
kaf24@firebug.cl.cam.ac.uk 93859a896b Fix error path in blkback driver where a grant mapping in the
middle of a batch fails. Spotted by Harry Butterworth (IBM).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-06 17:50:24 +01:00
smh22@firebug.cl.cam.ac.uk 6054f20239 Quiet down balloon driver.
Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-05 10:55:38 +01:00
djm@kirby.fc.hp.com 15e7453af8 Minor driver code changes/rearrangement to reduce ia64-specific patches
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
2005-11-04 10:40:29 -06:00
kaf24@firebug.cl.cam.ac.uk 64217a3735 Temporary fix for blkfront failure on save/restore.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-01 16:44:25 +01:00
emellor@leeni.uk.xensource.com 55c3f7f34f From Gerd Knorr <kraxel@suse.de>:
Watch events may get lost, the xenstored response races against the new
watch being added to the watch list in register_xenbus_watch().  Fixed
by adding the watch to the list unconditionally, and remove it in the
error case.

That one fixes the network issues I'm seeing.  Due to the race the
"online" hotplug event for the vif backend was lost sometimes.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-31 17:03:13 +01:00
emellor@leeni.uk.xensource.com 07237aa4f3 Merged. 2005-10-30 19:23:36 +01:00
emellor@leeni.uk.xensource.com 0ac3c6cbd5 Move misplaced netif_free declaration.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 17:17:21 +01:00
kaf24@firebug.cl.cam.ac.uk 2e4f771f0c Once grant refs run out, netfront prints a nice message, but doesn't set
err properly to notify the caller, and the domU crashes. (See bug 183 for
details).

Signed-off-by: Jim Dykman <dykman@us.ibm.com>
2005-10-30 16:43:05 +01:00
emellor@leeni.uk.xensource.com 5b4535ea04 Change the grant table interface so that gnttab_end_foreign_access_ref returns
an error code if the page is still in use, and gnttab_end_foreign_access takes
a page to free.  This allows us to cope with frontends wanting to end access
while backends are still using pages by, eventually, placing the page and
grant table entry on a list, for freeing later.  At the moment, the page and
grant table entry are leaked, with a diagnostic.

Tidied up netfront.c's clean-up code.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 16:33:05 +01:00
emellor@leeni.uk.xensource.com d684300900 Added cast to silence warning on 64-bit.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 16:25:52 +01:00
kaf24@firebug.cl.cam.ac.uk 1464591d5f merge 2005-10-29 09:51:35 +01:00
kaf24@firebug.cl.cam.ac.uk 650fa32a00 BUG_ON() is a macro very very similar to assert(), and it's a really bad
idea in general to put statements with side-effects inside such a construct
(for example the BUG_ON() could be compiled away for non-debug builds).

The patch below fixes this for the drivers/xen tree.

I chose the general construct to store the respective return values in a
local var instead of an if (...) BUG(); because it looks like most of these
BUG_ON()'s need to be replaced by real error handling when going towards
production releases anyway, and then the local variable is going to be
needed anyway. (and besides the if construct tends to get unreable due to
the unlikely() etc).

Please apply.

Greetings,
   Arjan van de Ven
2005-10-27 17:09:01 +01:00
emellor@leeni.uk.xensource.com 655b6990ad Merged. 2005-10-25 11:24:01 +01:00
emellor@leeni.uk.xensource.com 35b62f2630 Remove recently added uses of errno, as these cause trouble on ia64 builds.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-24 18:21:38 +01:00
djm@kirby.fc.hp.com b92c88b847 Need additional include for ia64 2005-10-24 10:46:39 -06:00
djm@kirby.fc.hp.com ee52af859f Necessary change to make ia64 dom0 rework:
- All even channels on xen/ia64 shares one common interrupt vector
	- xen_start_info is initialized only after xen_init, so adjust
	  sequence to avoid access before initialization

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2005-10-24 09:15:53 -06:00
vhanquez@kneesa.uk.xensource.com 9b6fdc5d38 compute the correct totalram_pages when the balloon increase or decrease the
reservation. memory reports should be more correct now.

From: Satoshi Uchida <s-uchida@ap.jp.nec.com>
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-10-24 12:57:37 +01:00
emellor@leeni.uk.xensource.com 4384b3fc70 Instead of writing errors to
/local/domain/0/backend/<devclass>/<dom>/<devid>/error, write them instead to
/local/domain/0/error/backend/<yada>.  This is not the best place for them
perhaps, but it moves them out of the backend directory, on which the drivers
have a watch.  This fixes the problem whereby writing an error will trigger a
watch, causing the error message to be written again, and repeat.  Fixes bug
#286.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-23 22:34:13 +01:00