WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 3 of 3] [PATCH] xenserver: Avoid errors from ovs-vsctl

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 3 of 3] [PATCH] xenserver: Avoid errors from ovs-vsctl at system shutdown
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 8 Jul 2010 14:33:49 +0100
Delivery-date: Thu, 08 Jul 2010 06:53:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1278596026@ely>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1278596026@ely>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# HG changeset patch
# User Ben Pfaff <blp@xxxxxxxxxx>
# Date 1278596014 -3600
# Node ID d28575be8a5deec1b73ea7120a98e37be6373fa9
# Parent  017805983e8d424619afbd8e258ed086d11307af
[PATCH] xenserver: Avoid errors from ovs-vsctl at system shutdown.

>From ab32de001f10ddcb119360744c078ed9c1aebb06 Mon Sep 17 00:00:00 2001
Date: Fri, 25 Jun 2010 13:57:22 -0700
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 <Ian.Campbell@xxxxxxxxxx>
Signed-off-by: Ben Pfaff <blp@xxxxxxxxxx>
Signed-off-by: Dominic Curran <dominic.curran@xxxxxxxxxx>
---
 ...ensource_libexec_InterfaceReconfigureVswitch.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff -r 017805983e8d -r d28575be8a5d scripts/InterfaceReconfigureVswitch.py
--- a/scripts/InterfaceReconfigureVswitch.py    Thu Jul 08 14:33:26 2010 +0100
+++ b/scripts/InterfaceReconfigureVswitch.py    Thu Jul 08 14:33:34 2010 +0100
@@ -12,6 +12,7 @@
 # GNU Lesser General Public License for more details.
 #
 from InterfaceReconfigure import *
+import os
 import re
 
 #
@@ -360,6 +361,13 @@
 
     @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)
 scripts/InterfaceReconfigureVswitch.py |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


Attachment: xenserver_Avoid_errors_from_ovs-vsctl_at_system_shutdown.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api