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>
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>
cannot allocate a contiguous multi-page extent of memory. This
should avoid unnecessary crashes in the xen-specific skbuff
cache constructor.
Signed-off-by: Keir Fraser <keir@xensource.com>
flag is now associated with the pgd rather than the mm -- this
avoids a race where a pgd is allocated from the pgd_cache but,
before it gets associated with an mm, the kernel suspends itself.
At this point the kernel mappings will not get rewritten when the
kernel is resumed, and the system will fail.
A further advantage is that the code is slightly simpler and less
invasive (no changes to mm_context for example).
Signed-off-by: Keir Fraser <keir@xensource.com>
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>
that loop completely -- the xc_init_store, initDomainStore calls can all go.
Have xenstored understand where the local domain information goes. Xend no
longer has to generate a path and pass it to xenstored through
xs_introduce_domain -- we just allow xenstored to generate the path, and then
call GetDomainPath later. There is still some work required to tidy this up.
Change the uuid module to generate uuids as lists of bytes, not in the
stringified form. Added a unit test for that module.
Change the semantics of Xend restart, relying on these changes to the
xenstored semantics and earlier changes to add an opaque handle to the
hypervisor's domain-specific data block. The semantics are now clearer, as
Xend can validate whether the details in the store match the current live
domain.
Added a usage statement to xenstored.
Some of this code is by Steven Hand.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
longs. Thi sensures appropriate alignment for architectures
that require it, and also allows us to naturally support up
to 4096 event channels per 64-bit guest.
Moved 'n_vcpu' field from shared_info to start_info. Really it
ought to disappear altogether as the info can be derived from
xenstore.
Fix a weird bug in XendDomainInfo where 'vcpus' information for
a domain defaults to floating point value 1.0 rather than integer
1. This looks like a Python bug to me, but in any case it is
'fixed' by explicitly converting the default value to an integer.
Signed-off-by: Keir Fraser <keir@xensource.com>
add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
Since max_pfn is (rightly) an unsigned long, we overflow for the current
definition of PFN_PHYS. Attached is my preferred solution as it will
hopefully avoid similar situations that may come up in the future.
Signed-off-by: srparish@us.ibm.com
handle on appropriate operations. Next step is to plug this
through to the store daemon and get rid of the nasty serialisation
mutex for transactions.
Signed-off-by: Keir Fraser <keir@xensource.com>
which defines aspects of the 'wire' protocol between
xs daemon and clients in user and kernel land, is now
xs_wire.h and moved to xen's public/io directory. From there
it is more easily accessible by kernels.
Signed-off-by: Keir Fraser <keir@xensource.com>
instead of just passing the node.
This allows us to extend watches to have additional arguments (like domids).
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
drivers better follow the Linux driver model. Changes include:
* Rename xenbus_register functions to more closely match what's used
with other buses. Adjust callers
* There's no need to wait for the first vbd of vif and do a timeout if
they fail, device probing is async
* Add sysfs attributes for examining type and nodename
* Set device of gendisk so /sys/block/foo/device points to the right
place
* Set device of net_device so that /sys/class/net/foo/device points to
the right place
Signed-off-by: Jeremy Katz <katzj@redhat.com>
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>
making an event_channel_op hypercall. Stefan Berger gets the
credit for diagnosing nasty domU driver problems that were a
result of garbage fields.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
change to watch out for is that the suspend record, on
save/restore, is now passed via register %edx not %esi
(both i386 and x86/64).
Signed-off-by: Keir Fraser <keir@xensource.com>
safe version for drivers to use that is aware of
save/restore. Post-restore notifications are silently
dropped, in the expectation that xenbus will eventually
get round to telling the driver it needs to reconnect.
Signed-off-by: Keir Fraser <keir@xensource.com>
unbind_evtchn_from_xxx. The bind now returns the IRQ
number on success. The unbind takes this as a parameter
instead of the event-channel port. Also, unbind closes
down the underlying event-channel port if it is still
live.
Signed-off-by: Keir Fraser <keir@xensource.com>