2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00
Commit Graph

59 Commits

Author SHA1 Message Date
Andy Hill
ec9f40dce1 Fix misspellings in comments and docs.
Flagged with: https://github.com/lyda/misspell-check
Run with: git ls-files | misspellings -f -

Signed-off-by: Andy Hill <hillad@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-04 21:53:33 -07:00
Ed Maste
8a77bb2ec8 Don't assume python is in /usr/bin.
Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-30 17:17:24 -07:00
Ben Pfaff
acfb4e9597 xenserver: Synchronize scripts with XenServer 6.0.0.
This commit updates the "vif" and "interface-reconfigure" scripts installed
by Open vSwitch on Citrix XenServer with those in XenServer 6.0.0.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-24 09:52:48 -08:00
Andrew Evans
404c169247 xenserver: Merge upstream changes and drop pre-5.6.100 support.
Citrix have made modifications to the various interface configuration scripts
that OVS replaces, so at present those modifications are lost when OVS is
installed on e.g. XenServer 5.6.100. This commit applies those changes while
preserving OVS-specific modifications that have been made in the interim.

One major change introduced by these updates is the removal of support for
XenServer releases prior to 5.6.100.

This commit also updates the OVS-supplied xen-bugtool in similar fashion. We
will soon remove xen-bugtool from OVS altogether and move the added OVS
functionality to an XML extension as described in the Supplemental Pack DDK
guide.
2011-02-11 13:03:06 -08:00
Ian Campbell
92e906e484 interface-reconfigure: Handle CHIN Tunnel objects
Only the vswitch backend is able to implement CHIN.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-23 12:32:08 -07:00
Ian Campbell
823c5699d4 interface-reconfigure: callout to datapath backend class method on rewrite
Use this mechanism to allow the vswitch backend to update the vswitch
configuration's mapping from datapath to XenAPI datamodel Network
UUIDs. The vswitch needs a mechanism to update these when they change
(i.e. on pool join and eject).

Refactor the DatapathFactory method to return the class which the
caller can instantiate or not as the require.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-04 10:20:36 -07:00
Ian Campbell
9a2b117527 CP-1592: interface-reconfigure: Configure network device MTU from Network.MTU field
With override via other-config:mtu field on specific objects in the datamodel.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1267008538 0
# Node ID a91df72fd4bf6329831d3efcae45a5ff55e3ba2e
# Parent  219104a041786d7274b15800de5c3efccf0c4f42
2010-02-24 10:54:41 -08:00
Ben Pfaff
b63fadcfdc xenserver: Add --no-syslog feature to interface-reconfigure.
This makes it easier to do unit tests (some of which will be added in an
upcoming commit) by allowing messages to be read from stderr instead of
having to somehow intercept syslog calls.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:55:44 -08:00
Ben Pfaff
64ddb6fecf xenserver: Add --root-prefix feature to interface-reconfigure.
This makes it easier to do unit tests (some of which will be added in an
upcoming commit) by allowing fake configuration files and scripts to be
added in a directory other than the real root.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-02-23 09:55:42 -08:00
Ben Pfaff
1fa5a1050f xenserver: Update to use upstream XenServer location for dbcache.
I thought that this was going to be more difficult (see this email thread:
http://openvswitch.org/pipermail/dev_openvswitch.org/2010-January/001023.html
) but it turned out to be trivial.
2010-01-26 10:35:11 -08:00
Ian Campbell
b3080599f6 xenserver: Update interface-reconfigure and vif integration scripts.
This patch updates the versions of the host integration scripts to
what is present in the recent XCP update and the next release of
XenServer (5.6). I think it probably works on 5.5 as well but I
haven't verified that.

These new versions support runtime selection of the Linux bridging vs
vswitch through the toolstack. The patch includes the necessary
reconfiguration (rewriting /etc/xensource/network.conf) to enable
vswitch in the RPM %post stage.

The RPM spec file integration is only lightly tested, seems to work
for me.

This commit is as provided by Ian Campbell, with a few minor tweaks:

    - Updated xenserver/automake.mk to distribute the added files.

    - Updated RPM spec file not to complain if the added files do
      not already exist (since they do not exist on XenServer 5.5.0).

    - Change location of dbcache back to /var/lib/openvswitch/dbcache
      so that this can coexist with our other internal builds.
      (Undoubtedly we will have to adopt the new location chosen by Ian
      eventually, however.)
2010-01-25 10:36:08 -08:00
Ben Pfaff
d17ee8689b Merge citrix branch into master. 2009-11-18 14:14:29 -08:00
Ian Campbell
c4b1912e82 xenserver: interface-reconfigure and vif hotplug relicensing.
As part of the Open Sourcing of xapi (the XenServer toolstack) via the
XenCloud project (announcement in [0]). The upstream versions of
interface-reconfigure and the vif hotplug script have been re-licensed
under an LGPL v2.1 + exception license. The exception applies to other
files in the upstream repository and doesn't particularly make sense for
these scripts but it is included to maintain the uniformity of the
license for the upstream repository.

This patch synchronises the licenses headers on those scripts with the
upstream version. Since those headers refer to a file called LICENSE in
the upstream repository I have included a copy here, slightly modified
to indicate precisely which files it applies to.

Git shows[1] that only myself and Nicira employees have made
modifications to these scripts in the openvswitch repository. The
licensing change has been okayed by Keith Amidon on behalf of Nicira.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

[0]
http://lists.xensource.com/archives/html/xen-devel/2009-11/msg00117.html
2009-11-13 09:52:13 -08:00
Jesse Gross
42061b2a5b mirroring: Preserve key for disabling learning.
Don't delete the key for disabling MAC learning on a given VLAN
after a reboot.  Also logs when learning is disabled.
2009-11-11 16:00:05 -08:00
Jesse Gross
d65349ea28 Merge citrix branch into master. 2009-11-10 15:12:01 -08:00
Justin Pettit
2a577bd807 xenserver: Fix issue with deleting network UUID on VLAN destruction
In XenServer, a VLAN is considered an additional network with its own
UUID.  The interface-reconfigure script properly adds this network UUID
to the configuration script, but commit 774428 removed the code that
would remove this information on VLAN destruction.  Ian Campbell was the
author of that commit and felt that reverting this part was safe.

Bug #1973
2009-11-03 21:46:29 -08:00
Jesse Gross
450f38cf3c xen: Restore state files for VIF VLANs
A change on master to use ovs-vsctl instead of state files for VLANs
was ported to the citrix branch, which does not have ovs-vsctl.  The
interface reconfigure portion, which does not store the state files
was ported but the vif-hotput script portion was not.  This restores
interface reconfigure to again save the state files.

Bug #2187
2009-10-19 21:03:22 -07:00
Ben Pfaff
bc17490dfc xenserver: Crossport "master" interface-reconfigure to "citrix".
This commit copies the interface-reconfigure script from "master" into
"citrix" and fixes up a few incompatibilities: the location of ovs-cfg-mod,
which in master is in /usr/bin and in citrix is in /root/vswitch/bin, and
the RPM spec file fragments needed to initialize the database cache.

The purpose of this commit is to obtain the bug fixes that have been
applied (mainly by Ian Campbell) to "master" but which are not in "citrix".

It's difficult to understand the changes from this commit alone.  It is
more meaningful to compare the resulting files against those currently
on the master branch.
2009-10-08 15:17:32 -07:00
Ian Campbell
55bc65533f xenserver: use ovs-vsctl for VIF VLANs instead of separate state files
ovs-vsctl did not exist when this code was originally written, but it
provides exactly what is needed to get rid of those separate state
files.

The vif hotplug script diff is against the xs5.7 branch but I think is
applicable to master and/or citrix with just context changes.

I was thinking of using ovs-vsctl exclusively for configuration
modifications from the vif hotplug script but that would need a
mechanism to pass the additional vif details to ovs-vsctl add-port as
well as perhaps making the bridge optional to del-port. The other option
would be to use the --no-reload option and split the config mods into
two parts, but I don't like that idea much.
2009-10-05 10:07:28 -07:00
Ian Campbell
7744280b18 xenserver: Include bridge.*.xs-network-uuids for all networks
Previously I advised that only networks which were currently attached to
the host be listed in /etc/ovs-vswitchd.conf. However I've just realised
that this interacts badly with the slightly ugly special case used for
PIF.currently-attached when reading from dbcache instead of talking to
Xapi. This bites on boot when /etc/init.d/management-interface tries to
plug a selection of PIFs which are deemed to be somehow required by
xapi. (not helped by a bug in XenServer 5.7.0 which can cause this list
to be larger than it should be and not internally consistent).

For now I think it prudent to simply list all networks which could
potentially be attached to a given datapath, until I can figure out what
the sane fix is on the XenServer end.

(I think there are two options for a proper fix, either inspect the
current state of the network devices or assume dbcache represents the
desired final state after devices are plugged on boot. I'm leaning
towards the later since the dbcache should indicate the set of PIFs
which were attached on shutdown, which xapi will likely be trying to
replug on boot... Needs more thought though).
2009-10-05 09:49:34 -07:00
Ian Campbell
0b8870d4a5 xenserver: Rework interface-reconfigure.
Substantially reworks interface-reconfigure, with the following fixes:

      * Create and use ifcfg files only for ipdev, use vswitch
        configuration for topology setup.

      * Take care over moving from bond to slave and back to tear down
        any residual sibling devices

      * Take care to leave datapath present when manipulating VLANs to
        avoid interrupting traffic on the slave PIF as well as other
        VLANs.

      * Lots of minor stuff
2009-10-02 11:35:42 -07:00
Ian Campbell
fa2bec94d0 xenserver: Synchronize interface-reconfigure from Citrix.
* Drop "--test-mode" option -- it was never wired up to anything.

* Add some additional checks for valid parameter combinations

* Raise some errors for unimplemented (but not currently used in
  XenServer) options.
2009-09-17 11:33:00 -07:00
Ben Pfaff
057fed2b5c xenserver: Drop "init-dbcache" by making PIF optional for "rewrite".
Commit ac9634f0af "xenserver: Make RPM install work again" introduced a
new command "init-dbcache" for the interface-reconfigure script.  However
it is cleaner to simply make the PIF argument to the "rewrite" command
optional.

CC: Ian Campbell <Ian.Campbell@citrix.com>
2009-09-17 09:23:18 -07:00
Ben Pfaff
f134604bdc xenserver: Fix detection of xs-network-uuids in interface-reconfigure.
Commit c798b21c6a "xenserver: Only consider the host we are running on in
interface-reconfigure" dropped the get_pifs_by_record function in favor
of get_pifs_by_device, but didn't adapt callers properly, so that the
XenServer network PIFs weren't properly found and thus the xs-network-uuids
keys weren't set correctly.

This fixes the caller.

Bug #2043.
2009-09-15 14:21:00 -07:00
Ben Pfaff
eaa3c7e88b xenserver: Install into /usr instead of /root/vswitch.
/usr is the standard location for installation, so use that instead of our
nonstandard location under /root.

This migrates everything except the kernel modules to /usr.  The kernel
modules will be migrated in an upcoming commit.

One possibly surprising change is that the manpages listed in the %files
section of vswitch-xen.spec not only moved but added .gz extensions.  This
seems to be because RPM automatically compresses manpages, but only if they
are installed in a standard system location.
2009-09-11 15:13:08 -07:00
Ben Pfaff
ac9634f0af xenserver: Make RPM install work again.
The RPM install was generating a database cache in Python pickle format in
/etc/ovs-vswitchd.conf, but interface-reconfigure was looking for it in
XML format in /var/lib/openvswitch/dbcache.  This fixes the problem, by
adding an init-dbcache command to interface-reconfigure and then using that
at RPM install time.

This moves the database cache creation from %pre to %post.  This is
necessary so that interface-reconfigure is available from the install
script.
2009-09-11 14:41:39 -07:00
Ben Pfaff
0d46ae039b xenserver: Remove dead store from interface-reconfigure.
No point in looking up pifrec if we're not going to use it.
2009-09-11 14:06:14 -07:00
Ben Pfaff
fcf78c4ff9 xenserver: Remove unmaintained comments in interface-reconfigure.
I added these comments a long time ago and have not kept them up-to-date,
so it is probably better to delete them than to confuse people.
2009-09-11 14:06:14 -07:00
Ian Campbell
5de7052b9b Only write Network.PIF elements for this host to dbcache. 2009-09-09 10:41:45 -07:00
Ian Campbell
b88907e798 Add PIF.currently_attached to the list of fields used by interface-reconfigure 2009-09-09 10:41:41 -07:00
Ian Campbell
e44d184463 Move vswitch state files to /var/lib.
I believe this is the correct location for files of this type.
2009-09-09 10:41:38 -07:00
Justin Pettit
00908dc27a Merge commit 'origin/citrix' 2009-08-25 13:23:11 -07:00
Ben Pfaff
eeb569bf8c xenserver: Compute correct physical PIFs for VLANs on bonds.
Otherwise the bond device is considered the physical PIF of a VLAN-on-bond
PIF, and various bad stuff happens.
2009-08-20 15:39:01 -07:00
Ben Pfaff
1d87357a13 Merge citrix into master. 2009-08-19 16:08:18 -07:00
Ben Pfaff
9d04e270a8 xenserver: Completely ignore datapath devices for renaming purposes.
Commit 2bb451b69 "xenserver: Rename network devices to match MAC addresses
of physical PIFs" started renaming network devices so that they match
the MAC address that we expect them to have.  This worked OK at the time.

Commit 35c979bff "vswitchd: Support creating fake bond device interfaces"
later started creating fake bond devices to make the Citrix QA scripts
happier.

Unfortunately these commits interact badly: the bond devices created by
the latter commit are sometimes chosen as the physical devices to be
renamed over the physical PIF device names.  This is because we do allow
datapath internal ports to be chosen as "physical devices" as a last
resort.  This commit reverses this decision, eliminating that possibility.
This probably won't become a problem unless somehow we encounter a physical
Ethernet card driver that lacks a queue, but that is unlikely since the
performance would be awful.
2009-08-19 13:44:05 -07:00
Ben Pfaff
8fef8c7121 Merge citrix into master.
This was a somewhat difficult merge since there was a fair amount of
superficially divergent development on the two branches, especially in the
datapath.

This has been build-tested against XenServer 5.5.0 and XenServer 5.7.0
build 15122.  It has been booted and connected to XenCenter on 5.5.0.

The merge revealed a couple of outstanding bugs, which will be fixed on
citrix and then merged back into master.
2009-08-19 13:03:46 -07:00
Ian Campbell
6dd3fad481 xenserver: Store XAPI dbcache as XML in interface-reconfigure.
This allows the Citrix host installer to also write the dbcache on upgrade
which enables the management interface to come up on a slave after upgrade.

CP-1148.
2009-08-18 16:09:32 -07:00
Ian Campbell
171ed16859 xenserver: Whitelist specific XAPI fields to pickle in interface-reconfigure.
Only add certain fields to the database cache of database
objects. This constrains the cases we need to deal with when
pickling/unpickling.

CP-1148.
2009-08-18 16:09:32 -07:00
Ian Campbell
c798b21c6a xenserver: Only consider the host we are running on in interface-reconfigure.
Drop records for PIFs,bonds,VLANs etc for other hosts at the point at
which we fetch the records from xapi rather than filtering everytime
we iterate through the lists.

CP-1148.
2009-08-18 16:09:32 -07:00
Ian Campbell
d8ba4acf44 xenserver: Factor out XAPI interactions in interface-reconfigure.
Currently interface-reconfigure stores a copy of the XAPI database using
python's pickling functionality. Since the XenServer host installer also needs
to write this file (so it is present after slave upgrade) we would like to
switch to something more explicitly under our control.

Begin by factoring out XAPI interactions.
2009-08-18 16:09:32 -07:00
Justin Pettit
d2cd45db48 xenserver: Add missing argument for fake-iface config
The interface-reconfigure script may add the 'fake-iface' configuration
option to the ovs-vswitchd.conf, but neglects to mention the interface.
This resulted in a "bonding.%s.fake-iface=true" line, which is clearly
wrong.  This commit corrects that behavior.
2009-08-17 12:43:59 -07:00
Ben Pfaff
88acec3bb5 xenserver: Configure MTU, Ethtool on PIFs in interface-reconfigure.
MTU and Ethtool settings on physical devices are supposed to come from
the PIF records, but we weren't configuring them at all.
2009-08-10 14:13:45 -07:00
Ben Pfaff
c87d1024dd xenserver: Obtain Ethtool, MTU, static routes from network instead of PIF.
Our version of interface-reconfigure was pulling the Ethtool, MTU,
and static route configuration for the local port from the PIF for the
local port, but these settings need to come from the network record
instead.

Bug #1798.
2009-08-10 13:50:22 -07:00
Ben Pfaff
05e2ad788d xenserver: Factor MTU, Ethtool into functions in interface-reconfigure.
interface-reconfigure needs to configure MTU and Ethtool settings not just
on the local port, as it currently does, but on the physical devices as
well.  This commit factors out the code for this so that it can be called
from multiple places.
2009-08-10 13:50:22 -07:00
Ben Pfaff
bc952bb371 xenserver: Rename functions, variables in interface-reconfigure.
This commit adds "get_" prefixes to the physdev_names and physdev_pifs
functions' names, because I want to use those names as variable names,
and then renames variables appropriately.
2009-08-10 13:50:22 -07:00
Ben Pfaff
8f749dac31 xenserver: Fix typo in adding static routes in interface-reconfigure. 2009-08-10 13:50:22 -07:00
Ben Pfaff
0d7e8aac8d xenserver: Bring up physical devices before configuring local port.
If DHCP is in use, then the physical devices have to be up before we
configure the local port, otherwise the DHCP request will never hit the
wire and we have no hope of getting an IP address.

This problem has been here for a long time, but it was masked until
commit c170afc1 "xenserver: Really take devices down in
interface-reconfigure." actually caused devices to go down and stay down.

Fixes bug #1809 "vswitch upgrade broke the xenserver".
2009-08-07 17:02:34 -07:00
Ben Pfaff
35c979bff4 vswitchd: Support creating fake bond device interfaces.
Citrix QA scripts expect that "brctl show" shows a bond interface for each
bond that is added to a bridge.  The only way to do that without modifying
brctl itself is to create an actual network device by that name, so this
commit adds a new bonding configuration key that causes an internal
device by the name of the bond to be created.

This feature is also necessary, but not sufficient, to allow XenCenter to
accurately show the link status and statistics of bridges (bug #1363).

This new configuration key is intentionally undocumented, because I don't
want anyone to use it.

Bug NIC-19.
2009-08-07 15:11:42 -07:00
Ben Pfaff
0ceda58c06 xenserver: Fix infinite recursion in get_netdev_by_mac.
Oops.
2009-08-07 14:47:06 -07:00
Ian Campbell
c239b2d4f3 xenserver: Cope gracefully with non-integer MTU in interface-reconfigure.
CP-1148.
2009-08-06 17:07:18 -07:00