Hotplug scripts include certain bash-isms that are not supported under
some distros' default shell (eg. Ubuntu 6.10's use of dash)
Signed-off-by: Alastair Tse <atse@xensource.com>
external-device-migrate script in its handling of parameters.
Patch from Roland Illig <roland.illig@gmx.de>.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
I have experienced that the vif-route script does not work as expected
when deleting a virtual interface (Redhat FC5). Both of the commands
"ifdown" and "ip route" cause an early vif-route script exit and
therefore will cause skipping of the later script commands (such as
cleaning up iptables entries for the default 'antispoof'). The
vif-route
script creates the following syslog error entry:
"/etc/xen/scripts/vif-route failed; error detected."
It appears that both of the problematic commands are actually
redundant
when destroying domains:
1. the interface is already gone (I assume because the domain frontend
is gone already) --> ifdown does not do anything
2. the route is gone as well since the interface has disappeared -->
ip
route del does not do anything
Executing those redundant commands with "do_without_error" ensures
that
the script completes and cleans up iptables rules. The attached
RFC-patch only masks those commands when bringing down an interface,
so
that domain creation continues to fail in case of vif setup problems
(intended behavior).
Having the iptables cleanup called correctly by vif-route is important
to keep the iptables rule-set clean, otherwise antispoof rules
accumulate with every vif creation.
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
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>
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>
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>
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>
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>
Many files:
Make interface to network/block scripts consistent:
- output on stdout is returned to the script caller
- output on stderr is logged at the error level, messages with a '-' prefix
are logged at the debug level and messages with a '*' prefix are logged
at the info level.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>