name = bwlimit.get_slice(xid)
-
-
if (name is None) \
and (xid != root_xid) \
and (xid != default_xid):
# 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: