Skip to content

Commit

Permalink
Merge branch 'fixes' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Jul 7, 2015
2 parents 45777c6 + 88f4306 commit 1ab4652
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 5 additions & 1 deletion src/apps/vhost/vhost_user.lua
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ function VhostUser:reply (req)
end

function VhostUser:report()
self.dev:report()
if self.connected then self.dev:report()
else print("Not connected.") end
end

function VhostUser:rx_buffers()
Expand Down Expand Up @@ -381,6 +382,9 @@ function selftest ()
end
timer.activate(timer.new("report", fn, 10e9, 'repeating'))

-- Check that vhost_user:report() works in unconnected state.
vhost_user:report()

app.main()
end

Expand Down
16 changes: 7 additions & 9 deletions src/core/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,13 @@ function report_apps ()
print(name, ("[dead: %s]"):format(app.dead.error))
elseif app.report then
print(name)
with_restart(app, app.report)
end
end
end

function report_each_app ()
for i = 1, #app_array do
if app_array[i].report then
app_array[i]:report()
-- Restarts are currently disabled, still we want to not die on
-- errors during app reports, thus this workaround:
-- with_restart(app, app.report)
local status, err = pcall(app.report, app)
if not status then
print("Warning: "..name.." threw an error during report: "..err)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/program/packetblaster/packetblaster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function run (args)
app.configure(c)
local fn = function ()
print("Transmissions (last 1 sec):")
app.report_each_app()
app.report_apps()
end
local t = timer.new("report", fn, 1e9, 'repeating')
timer.activate(t)
Expand Down
4 changes: 2 additions & 2 deletions src/program/snabbnfv/traffic/traffic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ local long_opts = {
function run (args)
local opt = {}
local benchpackets
local linkreportinterval = 60
local linkreportinterval = 0
local loadreportinterval = 1
local debugreportinterval = 600
local debugreportinterval = 0
function opt.B (arg) benchpackets = tonumber(arg) end
function opt.h (arg) print(short_usage()) main.exit(1) end
function opt.H (arg) print(long_usage()) main.exit(1) end
Expand Down

0 comments on commit 1ab4652

Please sign in to comment.