Commit Graph
554 Commits
Author SHA1 Message Date
cl349@firebug.cl.cam.ac.uk 79a13ff2fd Fix same_vm test by adding missing '$'.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-12-04 00:51:15 +01:00
cl349@firebug.cl.cam.ac.uk f7ba08cc97 Use test ([) instead of expr to compare integers.
expr $int1 '<' $int2 seems to be broken on some shells.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-12-04 00:49:51 +01:00
iap10@freefall.cl.cam.ac.uk f74b71caca Merge 2005-12-03 20:16:04 +01:00
iap10@freefall.cl.cam.ac.uk 0466574382 Update xend-config.sxp so that dom0-min-mem is 196MB by default, as this is rather more user friendly.
Also do some minor fixes to the README
Signed-off-by: ian@xensource.com
2005-12-03 20:05:39 +01:00
emellor@leeni.uk.xensource.com 60fdf33b73 Set hostname in DHCP config from the guest name, and if more than one interface
is specified, from guest-2, guest-3 etc.  Have the DHCP server send the
hostname to the guest.

Added a lock around DHCP config file frobbing, to avoid racing creation vs
deletion.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-03 12:21:27 +00:00
emellor@leeni.uk.xensource.com ffa06621c6 Read from the store if the filename reported by losetup has been truncated (the
loop driver stores only the first 64 chars of the filename).  In this case, we
need to read through the store until we find the domain using the device, and
read the configured filename from there instead.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-03 00:51:36 +00:00
cl349@firebug.cl.cam.ac.uk cb6bdaa39f Fix vif-net script for setups where eth0 has no IP address.
Use the IP address associated with the backend network interface
for connections from dom0 to the guest connected to this network
interface.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-12-02 22:15:58 +01:00
emellor@leeni.uk.xensource.com 9b08b0371d This patch adds a new domain config option, 'cpus' which is a list of
CPUs a domains' vcpus can use.  The older 'cpu' config option is
prepended to the list of cpus to use and will keep the behavior of
pinning VCPU0.

The cpus option supports ranges and negation, so:

cpus = "0-3,5,^1" produces -> [0,2,3,5]

The list is circular, so in a domain with the following config:

vcpus = 4
cpus  = "0,3,7"  # Use any of 0, 3, 7 for this domain.

would see vcpus 0-3 pinned to cpus 0,3,7,0 respectively.

Also, the pin operation is moved before the memory reservation as vcpu
to cpu mapping will be helpful for future NUMA work when trying to
allocate pages close to the physical cpus being used.

An update to the display of cpumap was needed to normalize the cpumap
values to the range of possible cpus.

I've also included some text for the xmdomain.cfg(5) man page.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2005-12-02 15:52:47 +00:00
emellor@leeni.uk.xensource.com d1dd4f46f5 Fix the block-sharing check for physical devices by using a lock to serialise
the check, reading from the store rather than /sys, and checking whether the
VM for apparently-conflicting uses is actually the same (i.e. this is a
migration or a reboot in progress).

This fixes recent failures in 12_block_attach_shared_domU and recloses bug #331.

This fix includes particularly skanky path slicing inside xenbus_probe, which
it would be nice to remove very soon.

The loopback device check still suffers from the problem that filenames over
64 characters long are truncated.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:48:44 +00:00
emellor@leeni.uk.xensource.com 0bac77637b Added /etc/init.d/dhcpd to list of init files to check for (supporting Centos
4.2).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:39:13 +00:00
emellor@leeni.uk.xensource.com d3be5880f8 Added serialisation facilities. Udev is supposed to serialise events, but sadly
the older hotplug infrastructure does not, so we must be able to serialise the
block-sharing checks (etc) ourselves.

Redirect stderr to /var/log/xen-hotplug.log, for better debugging.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:38:22 +00:00
smh22@firebug.cl.cam.ac.uk bb6d2f8575 Disable some over-zealous sanity checking for now (can cause major problems
with live migration to localhost). A proper fix will follow. 

Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-29 17:59:03 +01:00
emellor@leeni.uk.xensource.com 0c63b57930 Tidy and comment use of canonicalise_mode, et al.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-29 15:01:47 +00:00
emellor@leeni.uk.xensource.com 5c9e232d3d Merged. 2005-11-29 15:00:27 +00:00
emellor@leeni.uk.xensource.com 1f2b7910d7 Support facilities for the new DHCP support.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-29 14:57:33 +00:00
emellor@leeni.uk.xensource.com feea83809d Added trap for ERR, to get better response from the scripts when they are really
broken, and add do_or_die command.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-29 14:56:54 +00:00
emellor@leeni.uk.xensource.com 2832dba652 Replace grep >&/dev/null with grep -q.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-29 14:56:16 +00:00
emellor@leeni.uk.xensource.com 5941ac94f2 Added DHCP server support, configured by a dhcp=yes parameter. This will write
the appropriate entries into dom0's DHCP server configuration file, allowing
that server to provide info for the guest when it starts.

If an IP address is not configured for vif-nat, invent one using the domain
ID and vif ID.

Fix the vif-nat script.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-29 14:55:48 +00:00
rread@ubuntu.eng.hq.xensource.com b8ae09f01c The device sharing check races when more than one file backed vbd is
configured. Both of the files pick the same free loop device in the for
loop, and then one fails to losetup.  This patch will now retry if
losetup fails until it succeeds or no more devices are available.

Signed-off-by: Robert Read <robert@xensource.com>
2005-11-28 15:34:00 -07:00
emellor@leeni.uk.xensource.com dad18c78cb Change uses of \s within sed regexps -- some versions of sed do not support this
escape.

Allow the vif-nat and vif-route scripts to have netdev specified, rather than
hard-coding eth0.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-28 11:05:07 +00:00
emellor@leeni.uk.xensource.com 9e1ac75bfa Added device-sharing checks for loopback-mounted files. The existing
check_sharing functions have been rejigged slightly so that the file-specific
stuff can share the code therein.  This separates the actual test from the
generation of the error message, and introduces the canonicalise_mode function.

This also restores the broken teardown functionality for file: devices -- the
writing of XENBUS_PATH/node had been removed, but this is required for file
device teardown.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-27 00:56:34 +00:00
emellor@leeni.uk.xensource.com 963d9e8fdf Write the error message and the hotplug-status=busy in the same transaction, to
ensure that the message is picked up.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-26 23:59:09 +00:00
emellor@leeni.uk.xensource.com d966085083 Check when using physical devices that the device is not already in use. Using
a device from two guests, or from dom 0 and a guest, can destroy the filesystem,
and this check prevents that.  This should ensure that the xm tests
11_block_attach_shared_dom0 and 12_block_attach_shared_domU should pass.
Closes bug #331.

Devices may be shared only if all uses are read-only.  If anyone has read-write
access to a device, then no sharing is allowed.

The mode in the config file may now have an exclamation mark appended, to
indicate that devices may be shared (i.e. that this new check should be
bypassed).  This supports some network block devices, but is clearly dangerous
and should only be used when you know what you are doing.

The mode specified in the config file is now written explicitly to the store,
To implement this, the blkback driver has been changed to create two entries
in /sys describing each device in use.  This means that we can determine which
devices are in use without crawling through the store.

The physical-device node has been changed to give the major and minor of the
device, separated by a colon.  This means that we do not need to pack these
numbers into one, removing the restriction to 8 bit minors that we had in place
before.

The mode specified in the config file is now written explicitly to the store,
rather than using the presence or absence of a read-only node.  This supports
the write-sharing override above.

If the device is in use, a new hotplug status of "busy" is written to the
store, and a message is written to a new hotplug-error node.  Xend uses these
things for diagnosis.

The block scripts do not need to handle online or offline events, so this
support has been removed.  These scripts can be called twice, depending upon
the hotplug config, so they now identify the second run and do not attempt to
set up the device again.

The device directories in the store are cleaned out before new details are
written there.  This prevents stale information from messing up block device
hotplugging.  This will be one cause of "blkback: changing physical device
not supported" messages.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-25 20:58:07 +00:00
emellor@leeni.uk.xensource.com 7522af5c6a Only write a success node when coming online, not going offline. Delete the
interface from the bridge when going offline -- the comment stating that
interfaces are auto-removed does not seem to be true, at least some of the
time.  Log failure of brctl delif and ifconfig down only at debug level, as
this script may be called more than once, depending upon the hotplug
configuration.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-25 17:12:12 +00:00
emellor@leeni.uk.xensource.com 4494161ec1 Only write a success node when coming online, not going offline.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-25 17:09:49 +00:00
emellor@leeni.uk.xensource.com 88eca2a60d Don't issue the iptables diagnostic when removing entries. Depending upon your
hotplug config, the offline event may come through to this script twice, and
the iptables -D will fail the second time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-25 17:08:22 +00:00
emellor@leeni.uk.xensource.com 892f3730ae Match rename of parameters to match the corresponding hotplug events. This
took place some time ago, so presumably not many people are using this scripts!

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-25 17:07:19 +00:00
kaf24@firebug.cl.cam.ac.uk b588d4451a Update vtpm driver following the recent changes to the
xenbus driver and its semantics.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-11-25 09:14:01 +01:00
emellor@leeni.uk.xensource.com f6d80a7f57 Reverse accidental commits for changesets 8001 and 7996-7999.
The Mercurial Queues extensions suddenly looks a lot less useful than it first
seemed.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-23 19:37:33 +00:00
emellor@leeni.uk.xensource.com d64896a9f0 Merged. 2005-11-23 19:31:22 +00:00
emellor@leeni.uk.xensource.com 8856d17150 imported patch my-config 2005-11-23 19:19:23 +00:00
emellor@leeni.uk.xensource.com 92b5e81264 Don't treat the failure of ifconfig vifX.Y down as a fatal error. This hasn't
emerged as a problem in the field, AFAIK, but it seems that distro scripts
could have brought the device down already by this point (Debian stable's
net.agent does ifdown vifX.Y, and it wouldn't surprise me if someone decided
to do ifconfig vifX.Y down if this failed, for example).

Logging but ignoring the failure seems sensible.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-23 19:16:54 +00:00
emellor@leeni.uk.xensource.com 20f482d494 Remove the frontend device directories as well as the backend ones.
Closes bug #424.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-23 19:13:13 +00:00
emellor@leeni.uk.xensource.com 9fc5d0e1cb Added document to collate information regarding distro-specific
incompatibilities in the commands that we are using in the scripts.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-20 15:40:53 +01:00
dykman@us.ibm.com 35e6103a68 1) "brctl show" has no parameters.
2) Add a -n flag to iptables -L to skip DNS lookups
2005-11-20 15:37:08 +01:00
emellor@leeni.uk.xensource.com c3381a8dac Downgrade the failure to change the iptables settings from fatal to an error.
Even though we are checking for a working iptables installation, it is still
possible that the user does not have the PHYSDEV matcher installed, so just
issue a diagnostic instead.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-16 15:25:22 +01:00
emellor@leeni.uk.xensource.com 8d43373af6 Have the vif scripts expect the offline event, not the remove event. With
the remove event, the script environment variable has disappeared, so we must
hook on the offline event instead.  This fix was put into xen-backend.rules,
but not the vif scripts, so they were out of sync, and the interfaces were not
being properly closed down.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-15 15:56:47 +01:00
emellor@leeni.uk.xensource.com 946f9a1879 Added link_exists function, for neatness. Check for the existence of the pdev
before issuing the diagnostic about the missing vdev.  Having a pdev but no
vdev is a strong indicator that the network-bridge script has run once already,
and so there is nothing to worry about.  Having the vdev and no corresponding
pdev is still diagnosed.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-15 15:54:51 +01:00
emellor@leeni.uk.xensource.com 7845e5bb11 Fix check for a working iptables installation. Checking for the iptables
binary is not sufficient, because the user may not have the appropriate
modules installed.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-14 12:28:47 +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 c0efb8dc85 Rename the commands inside the hotplug scripts to match those used by hotplug
and udev.  Pass all commands through from xen-backend.agent or
xen-backend.rules rather than second-guessing the individual scripts.  This
should make it easier to tear down devices cleanly, especially the dangling
vifs we are seeing at the moment.

Cope with a missing type node inside the block script, as we don't want to
resurrect a removed node by writing a hotplug error message.

Log failure of iptables command.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-11 18:01:44 +01:00
emellor@leeni.uk.xensource.com 53ce8b9dd9 Don't call iptables if it is not installed. This code is only there to ensure
that packets between domU and the bridge are not firewalled, so if iptables is
not installed, then there is no worry.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-11 17:56:02 +01:00
emellor@leeni.uk.xensource.com aea7cae133 Fix function call syntax in vif-route and vif-nat.
Function calls in shell script should not contain parenthesis.

Signed-off-by: Murillo Fernandes Bernardes <mfb@br.ibm.com>
2005-11-11 17:04:17 +01:00
kaf24@firebug.cl.cam.ac.uk ea475aded3 nloopbacks default is now 8. So vifnum of greater than 7 requires
an adjustment to nloopbacks. Warning comment updated.

Signed-off-by: Nivedita Singhvi (niv@us.ibm.com)
2005-11-11 10:46:36 +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
kaf24@firebug.cl.cam.ac.uk a3dde685e8 Enable xm console for vmx guest.
When the serial port is redirect to pty, write the allocated
device to xenstore, then xm console can get it.
TODO:serial port by pty shall not block if there are no reading
on the other end

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-11-10 12:04:29 +01:00
kaf24@firebug.cl.cam.ac.uk b976b8510a Updates comments in network-bridge, removes dead code, minor typo fixes.
Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
2005-11-10 11:53:51 +01:00
kaf24@firebug.cl.cam.ac.uk e7570f0014 Support recent change moving virtual IOAPIC model into Xen for
ia64/VTI. Now ia64/vti will create links to arch/x86/dm/vmx_vioapic.c
and include/x86/vmx_vlapic.h.

Firstly, a small change to common virtual IOAPIC model to be used by
both sides. Also some compilation fix to tools is included in first
one. Secondly, there are ia64-specific changes to hook to common
IOAPIC model.

Based on this patch upon latest xen-ia64-unstable tip, we can see
multiple domains working again on XEN/IA64, including both domU and
VTI domain simultaneously in run-time.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
Signed-off-by Anthony Xu <Anthony.xu@intel.com>
Signed-off-by Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by Eddie Dong <eddie.dong@intel.com>
2005-11-09 14:53:12 +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
kaf24@firebug.cl.cam.ac.uk 385317d870 Update tools/examples docs.
Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
2005-11-08 12:17:53 +01:00