From ab32de001f10ddcb119360744c078ed9c1aebb06 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 25 Jun 2010 13:57:22 -0700 Subject: [PATCH] xenserver: Avoid errors from ovs-vsctl at system shutdown. Commit 823c5699 "interface-reconfigure: callout to datapath backend class method on rewrite" changed "interface-reconfigure rewrite" to update bridge external-ids in the vswitch database. But this had the side effect of causing errors at system shutdown, since ovsdb-server gets shut down before the rewrite action is called. This commit fixes the problem by skipping the update if the database socket does not exist. (It's just fine to skip the update, since the external-ids will be re-set the next time the system boots anyhow.) This commit fixed the problem on 5.6.810-34773p for me. I don't see the problem at all on 5.5.0. Presumably system shutdown order has changed. NIC-136. CC: Ian Campbell Signed-off-by: Ben Pfaff --- .../opt_xensource_libexec_InterfaceReconfigureVswitch.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index b7375555f..1e45759ad 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -12,6 +12,7 @@ # GNU Lesser General Public License for more details. # from InterfaceReconfigure import * +import os import re # @@ -367,6 +368,13 @@ class DatapathVswitch(Datapath): @classmethod def rewrite(cls): + if not os.path.exists("/var/run/openvswitch/db.sock"): + # ovsdb-server is not running, so we can't update the database. + # Probably we are being called as part of system shutdown. Just + # skip the update, since the external-ids will be updated on the + # next boot anyhow. + return + vsctl_argv = [] for pif in db().get_all_pifs(): pifrec = db().get_pif_record(pif) -- 2.43.0