Skip to content

Commit

Permalink
feat: add cmd change: bin,stdin,stdout,stderr
Browse files Browse the repository at this point in the history
Signed-off-by: liuzheng <[email protected]>
  • Loading branch information
liuzheng committed Oct 9, 2023
1 parent 4299558 commit ab4aae0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,24 @@ func (m *Machine) UpdateBalloonStats(ctx context.Context, statsPollingIntervals
m.logger.Debug("UpdateBalloonStats successful")
return nil
}

// Reset Firecracker binary
func (m *Machine) WithFcBin(bin string) {
m.cmd.Path = bin
m.cmd.Args[0] = bin
}

// Reset Firecracker running Stdin
func (m *Machine) WithStdin(stdin io.Reader) {
m.cmd.Stdin = stdin
}

// Reset Firecracker running Stdout
func (m *Machine) WithStdout(stdout io.Writer) {
m.cmd.Stdout = stdout
}

// Reset Firecracker running Stderr
func (m *Machine) WithStderr(stderr io.Writer) {
m.cmd.Stderr = stderr
}

0 comments on commit ab4aae0

Please sign in to comment.