From cb21c9e5a85a42e5e257cb749f49375bb73f51ac Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Tue, 26 Jun 2007 19:00:03 +0000 Subject: [PATCH 1/1] merge from head. --- NodeManager.spec | 2 +- bwmon.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/NodeManager.spec b/NodeManager.spec index 3af841b..bb11638 100644 --- a/NodeManager.spec +++ b/NodeManager.spec @@ -1,7 +1,7 @@ Summary: PlanetLab Node Manager Name: NodeManager Version: 1.4 -Release: 1%{?pldistro:.%{pldistro}}%{?date:.%{date}} +Release: 2%{?pldistro:.%{pldistro}}%{?date:.%{date}} License: PlanetLab Group: System Environment/Daemons URL: http://cvs.planet-lab.org/cvs/NodeManager diff --git a/bwmon.py b/bwmon.py index 579bae3..882b8f4 100644 --- a/bwmon.py +++ b/bwmon.py @@ -15,7 +15,7 @@ # Faiyaz Ahmed # Copyright (C) 2004-2006 The Trustees of Princeton University # -# $Id: bwmon.py,v 1.1.2.10 2007/06/25 17:47:10 faiyaza Exp $ +# $Id: bwmon.py,v 1.1.2.11 2007/06/26 18:03:55 faiyaza Exp $ # import os @@ -404,8 +404,6 @@ def gethtbs(root_xid, default_xid): name = bwlimit.get_slice(xid) - - if (name is None) \ and (xid != root_xid) \ and (xid != default_xid): @@ -458,11 +456,11 @@ def sync(nmdbcopy): (version, slices) = pickle.load(f) f.close() # Check version of data file - if version != "$Id: bwmon.py,v 1.1.2.10 2007/06/25 17:47:10 faiyaza Exp $": + if version != "$Id: bwmon.py,v 1.1.2.11 2007/06/26 18:03:55 faiyaza Exp $": logger.log("bwmon: Not using old version '%s' data file %s" % (version, datafile)) raise Exception except Exception: - version = "$Id: bwmon.py,v 1.1.2.10 2007/06/25 17:47:10 faiyaza Exp $" + version = "$Id: bwmon.py,v 1.1.2.11 2007/06/26 18:03:55 faiyaza Exp $" slices = {} # Get/set special slice IDs @@ -500,10 +498,17 @@ def sync(nmdbcopy): newslicesxids = Set(live.keys()) - Set(livehtbs.keys()) logger.log("bwmon: Found %s new slices" % newslicesxids.__len__()) - # Incase we upgraded nm and need to keep track of already running htbs + # Incase we rebooted and need to keep track of already running htbs norecxids = Set(livehtbs.keys()) - Set(slices.keys()) logger.log("bwmon: Found %s slices that have htbs but not in dat." % norecxids.__len__()) - newslicesxids.update(norecxids) + # Reset tc counts. + for norecxid in norecxids: + slices[norecxid] = Slice(norecxid, live[norecxid]['name'], live[norecxid]['_rspec']) + slices[norecxid].reset(livehtbs[norecxid]['maxrate'], + livehtbs[norecxid]['maxexemptrate'], + livehtbs[norecxid]['usedbytes'], + livehtbs[norecxid]['usedi2bytes'], + live[norecxid]['_rspec']) # Setup new slices for newslice in newslicesxids: -- 2.43.0