added booted?/boot methods
This commit is contained in:
@@ -28,7 +28,15 @@ module Dumm
|
||||
Bridge.each { |bridge|
|
||||
bridge.delete
|
||||
}
|
||||
return nil
|
||||
return Dumm
|
||||
end
|
||||
|
||||
# wait until all running guests have booted up
|
||||
def boot
|
||||
Guest.each {|g|
|
||||
g.boot if g.running?
|
||||
}
|
||||
return Dumm
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -41,6 +41,23 @@ module Dumm
|
||||
i.delete
|
||||
}
|
||||
end
|
||||
|
||||
# has the guest booted up?
|
||||
def booted?
|
||||
begin
|
||||
exec("pgrep getty")
|
||||
rescue
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
# wait until the guest has booted
|
||||
def boot
|
||||
while not booted?
|
||||
sleep(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+5
-2
@@ -147,8 +147,11 @@ static int request(private_mconsole_t *this, void(*cb)(void*,char*,size_t),
|
||||
}
|
||||
else if (reply.err)
|
||||
{
|
||||
DBG1("received mconsole error %d: %*.s",
|
||||
reply.err, reply.len, reply.data);
|
||||
if (reply.len && *reply.data)
|
||||
{
|
||||
DBG1("received mconsole error %d: %*.s",
|
||||
reply.err, reply.len, reply.data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user