Commit Graph
268 Commits
Author SHA1 Message Date
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
kaf24@firebug.cl.cam.ac.uk bf4822dafb Remove the execute bit from shell snipplets (the -common files not
starting with #!) found in the example directory under tools. It
further changes the installation path of the udev rules to comply with
what debian does: It places the rules file in /etc/udev/ und creates a
symlink to it in /etc/udev/rules.d.

Signed-off-by: Tobias Hunger <tobias@aquzul.com>
2005-11-08 12:14:33 +01:00
emellor@leeni.uk.xensource.com ab6494f226 Fix misnamed call to legacy_mask_to_prefix. Thanks to Tim Moreton for finding
this.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:36:44 +01:00
emellor@leeni.uk.xensource.com 3d511563c0 Diagnostic for hitting the nloopbacks limit. This is presumably the cause of
all the "two bridges don't work" bugs that have been reported (bug #381).

Consideration will be given to raising the default limit -- this is just a
diagnostic of the problem.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:36:35 +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
emellor@leeni.uk.xensource.com 3bbe6d0380 Removed the event server, and all it entails. This is unused, and a big pile
of crusty rubbish.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-31 16:56:34 +01:00
emellor@leeni.uk.xensource.com ff9465e411 Merged. 2005-10-30 14:00:35 +01:00
emellor@leeni.uk.xensource.com af374bc7d2 Added xen-script-common.sh, for functions common to all scripts, not just the
hotplug ones.  Added evalVariables and findCommand functions to that, which we
use to clarify the handling of variables being passed in as command line
variables.

Make vif-bridge able to find the bridge for itself if only one bridge is in
use.  This means that it is not necessary to specify a bridge in many
configurations.  Allow the bridge to be specified on the command line, meaning
that a default may be provided in the xend-config.sxp if desired.

Added xenstore_read_default to xen-hotplug-common.sh, which reads from the
store but uses a given default if the path in the store is not present.  This
is used by vif-bridge to allow the store details (i.e. those given to xm create)
to override the default value given in the xend-config.sxp.

Remove vif-bridge setting -- the value can be specified on the vif-script
command line if necessary.

Added examples for network-nat/vif-nat.

Added lots of big comments.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 13:33:17 +01:00
kaf24@firebug.cl.cam.ac.uk 1464591d5f merge 2005-10-29 09:51:35 +01:00
emellor@leeni.uk.xensource.com 6ee89dae79 Fix the check for non-existence of the save/restore directories, by using &&
rather than -a.  The former shortcuts at the script level, whereas the latter
does not, which means that the backtick-enclosed arguments are evaluated
regardless of the success of preceding tests.

Tidy the aforementioned test into a function of its own.

Add an implementation of usleep for those systems that only have sleep (Debian,
for example).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-26 16:59:13 +01:00
emellor@leeni.uk.xensource.com a8a1d48e4c Break the write_dev function out from block into new block-common.sh, where it
can also be used by block-enbd and block-nbd.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-26 14:58:13 +01:00
emellor@leeni.uk.xensource.com 902a84f59f Added copyright notice.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-26 14:57:16 +01:00
emellor@leeni.uk.xensource.com b043099b44 New xendomains init script, courtesy of Kurt Garloff:
It now allows the user to configure what he wants to be done on
xendomains stop: sysrq, migrate, save, or shutdown.
For this to be safe, a timeout has been introduced (optional).
On start, saved domains may be restored, and not yet started
domains from the auto start dir will be started in addition.
status reports missing domains, restart and reload work as well.

The init script is somewhat SUSE-ish, but it should work on LSB
compliant and on RH based distros as well.

I would appreciate this to be put into tools/examples/init.d/

Signed-off-by: Kurt Garloff <garloff@suse.de>
2005-10-26 14:55:32 +01:00
emellor@leeni.uk.xensource.com ccbd11acd6 Added comment.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-26 12:06:58 +01:00
emellor@leeni.uk.xensource.com 617482f058 NBD scripts, courtesy of Kurt Garloff:
For domain migration, unless you use a rootless setup, you need
to have network storage available. For the poor people like me that
have no SAN, one easy possibility to have it is to use nbd.

Find attached the block-nbd script (in /etc/xen/scripts/) and
an example config file. The block-nbd script is based on the -enbd one.
They have been used successfully in the Xen Tutorial at Linux Kongress.

Signed-off-by: Kurt Garloff <garloff@suse.de>
2005-10-25 11:52:56 +01:00
emellor@leeni.uk.xensource.com 1033d025c4 Moved SuSE-specific getcfg call into a preiftransfer call. The semantics of
this aren't beautiful, but this gets the distro-specific code out of the body
of the network-bridge script and into a common place, while still preserving
the existing code behaviour.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-25 11:22:47 +01:00
djm@kirby.fc.hp.com 6a106a03b0 Oops, missed hg add of vti example file 2005-10-24 21:00:35 -06:00
djm@kirby.fc.hp.com 9f69bceba2 Image builder for ia64/vti domain, together with a example config file.
Signed-off-by Ke Yu <ke.yu@intel.com>
Signed-off-by Anthony Xu <anthony.xu@intel.com>
Signed-off-by Kevin Tian <kevin.tian@intel.com>
2005-10-24 20:56:53 -06: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
emellor@leeni.uk.xensource.com e5edf96441 Break common network code in xen-network-common.sh, and common vif hotplugging
code into vif-common.sh.

Fix the antispoofing in network-bridge to allow forwarding from physical
device to bridge, and vif0.0 to eth0.

Change the interface between netback driver and vif hotplugging scripts.  The
mac address and bridge details are read from the store directly by the script,
so that the kernel driver does not need to get involved.

Remove an awful lot of cruft from vif-bridge.  Move the iptables handling into
vif-common.sh, and fix it so that the new vif can get past the antispoofing
entries.  Merge vif-nat and vif-route into this structure too.

Use ip instead of ifconfig to get necessary details.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-21 12:06:17 +01:00
emellor@leeni.uk.xensource.com fb22028e11 Tidy xend-config.sxp, removing entries that haven't been used since the
hotplugging stuff was introduced (block-*, console-port-base, console-address)
and introducing entries for options that have been present for ages
(xend-{http,unix,relocation}-server, xend-unix-path, xend-relocation-address,
enable-dump).  Remove vif-antispoof, as Vifctl no longer passes this option
down.

Made the xend-relocation-server default to no, as this is a potential security
hole and so must be turned on explicitly.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-21 12:04:30 +01:00
emellor@leeni.uk.xensource.com e08da109cd Set antispoof default to yes, as this seems safer, and is the current behaviour
in VifCtl.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-20 14:06:07 +01:00
emellor@leeni.uk.xensource.com a77149f8e4 New network-bridge script and associated gubbins.
This is Kurt Garloff's reworked network-bridge script:

* we got rid of ifconfig
* it works for netdev != eth0
* arp on and off are symmetric as are ifdown and ifup
* ifup will be passed the ifcfg config file name if needed
  (the ifup may otherwise figure that the veth0 hardware is
   NOT the same as the original ${netdev} and not use the same
   config -- this happens on SUSE. Charles Coffing tracked this
   one down.)

Plus Kurt's avoid-dash patch:

the network setup scripts on SUSE have trouble with the bridge
name xen-br0; they don't expect the '-'.
Arguably this should be fixed.
But I assume there's more scripts out there which may not like it,
so I suggest the following patch to rename xen-br0 to xenbr0.

Plus Charles Duffy's patch to support multiple bridges:

The attached patch allows the network-bridge script to be used to
generate multiple bridges corresponding to different physical
interfaces. It adds a new parameter, "vifnum", used to refer both to
the loopback interface to be used and to set defaults regarding the
physical interface and bridge name.

Thus, if one wishes to start xenbr0 on eth0 and xenbr1 on eth1, one
need only call:

network-bridge start ## vifnum is 0 by default
network-bridge start vifnum=1

...well, that and set loopback.nloopbacks=2 in the Dom0 kernel
parameters.

Plus renaming of virtnum to vifnum in Charles' patch, as requested by Ian Pratt.

Plus a fix to DevController to allocate vif IDs starting from 0 (i.e. vif2.0
is now domain 2's first vif, as opposed to vif2.1 in the recent past).

Plus tidying up inside network-bridge using some helper variables.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-19 16:24:54 +01:00
emellor@leeni.uk.xensource.com f3adfa9dcb Set the console limit for DomUs based on a value set in xend-config.sxp.
Signed-off-by: Dan Smith <danms@us.ibm.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-19 13:37:16 +01:00
emellor@leeni.uk.xensource.com c8a1f1c7fc Some trivial changes for the tool scripts:
- make xen-hotplug-common.sh (un)set locales.
 - use xen-hotplug-common.sh in vif-bridge.

From Gerd Knorr <kraxel@suse.de>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-19 13:34:44 +01:00
kaf24@firebug.cl.cam.ac.uk e21acec89d Small cleanup in hotplug script.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-16 12:34:37 +01:00
emellor@leeni.uk.xensource.com da1385d8e8 Use new -t flag on xenstore-rm to keep the store pruned when devices go away.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-15 12:56:07 +01:00
emellor@leeni.uk.xensource.com 86234f86b5 Fix installation decision to make the DISTDIR and DESTDIR absolute before
comparing them.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-15 12:55:03 +01:00
kaf24@firebug.cl.cam.ac.uk 98adab9284 Add a option for enabling ne2000 NIC device model
Signed-off-by: Yan Li <yanx.li@intel.com>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
2005-10-12 17:04:11 +01:00
kaf24@firebug.cl.cam.ac.uk c27ad917f2 The NAT scripts currently work, but the changes below decrease user
error and allow the netmask to be passed in.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
2005-10-12 09:28:12 +01:00
emellor@ewan 27d7a34194 Fix completely broken xenstore_read function.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-10 18:58:46 +01:00
emellor@ewan 56a738f7ff Added error logging to the block hotplug script, and support facilities for
that.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-10 14:42:38 +01:00
kaf24@firebug.cl.cam.ac.uk 726081b63b Add installation of the udev rules if appropriate. With a normal 'make
install', the udev rules will be installed if udev version is >= 059;
otherwise, the hotplug rules get installed.

When 'make dist' is done, we set a variable so that both hotplug and
udev rules are installed into the dist tarball.  install.sh then takes
care of picking the proper rules.

Also changes the hotplug check to look for a proper udev version

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-10-07 14:47:45 +01:00
kaf24@firebug.cl.cam.ac.uk e3430966b8 Add udev rules that map similar to the hotplug agent. Based off of what
Chris Bainbridge posted the end of last week but doing things as
directly as possible.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-10-07 13:15:52 +01:00
kaf24@firebug.cl.cam.ac.uk 44e73911fe Move the block-phy and block-file handling into a common
block script that gets called by the hotplug agent.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-10-07 13:13:58 +01:00
kaf24@firebug.cl.cam.ac.uk 6f455ecab6 The hotplug agent sets the path now, but that's not as practical to do
with udev rules.  So instead, make sure that the path is set in the vif
scripts themselves.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-10-07 13:11:41 +01:00
kaf24@firebug.cl.cam.ac.uk 8d840be9ee This patch copies the NAT scripts in tools/examples/ to
/etc/xen/scripts/.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
2005-10-07 11:03:56 +01:00