Add basic fifo support for IO copy

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2015-12-14 14:15:26 -08:00
parent e480aedaea
commit e9f63fc9a4
14 changed files with 141 additions and 191 deletions

View File

@@ -15,6 +15,8 @@ type StartTask struct {
Container runtime.Container
Checkpoint string
IO *runtime.IO
Stdout string
Stderr string
Err chan error
}
@@ -34,8 +36,7 @@ func (w *worker) Start() {
defer w.wg.Done()
for t := range w.s.tasks {
started := time.Now()
// start logging the container's stdio
l, err := w.s.log(t.Container.Path(), t.IO)
l, err := w.s.copyIO(t.Stdout, t.Stderr, t.IO)
if err != nil {
evt := NewEvent(DeleteEventType)
evt.ID = t.Container.ID()
@@ -43,7 +44,7 @@ func (w *worker) Start() {
t.Err <- err
continue
}
w.s.containers[t.Container.ID()].logger = l
w.s.containers[t.Container.ID()].copier = l
if t.Checkpoint != "" {
if err := t.Container.Restore(t.Checkpoint); err != nil {
evt := NewEvent(DeleteEventType)