Skip to content

Commit

Permalink
Merge pull request #20198 from jakecorrenti/remove-extra-files-line
Browse files Browse the repository at this point in the history
Remove `c.ExtraFiles` line in machine
  • Loading branch information
openshift-merge-robot authored Sep 29, 2023
2 parents fff4e2f + 9b39641 commit cc8c28e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
5 changes: 2 additions & 3 deletions pkg/machine/applehv/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ func (m *MacMachine) Start(name string, opts machine.StartOptions) error {
defer ioEater.Close()

// TODO handle returns from startHostNetworking
forwardSock, forwardState, err := m.startHostNetworking(ioEater)
forwardSock, forwardState, err := m.startHostNetworking()
if err != nil {
return err
}
Expand Down Expand Up @@ -816,7 +816,7 @@ func (m *MacMachine) setupStartHostNetworkingCmd() (gvproxy.GvproxyCommand, stri
return cmd, forwardSock, state
}

func (m *MacMachine) startHostNetworking(ioEater *os.File) (string, machine.APIForwardingState, error) {
func (m *MacMachine) startHostNetworking() (string, machine.APIForwardingState, error) {
var (
forwardSock string
state machine.APIForwardingState
Expand Down Expand Up @@ -858,7 +858,6 @@ func (m *MacMachine) startHostNetworking(ioEater *os.File) (string, machine.APIF

cmd, forwardSock, state := m.setupStartHostNetworkingCmd()
c := cmd.Cmd(gvproxyBinary)
c.ExtraFiles = []*os.File{ioEater, ioEater, ioEater}
if err := c.Start(); err != nil {
return "", 0, fmt.Errorf("unable to execute: %q: %w", cmd.ToCmdline(), err)
}
Expand Down
9 changes: 0 additions & 9 deletions pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1317,14 +1317,6 @@ func (v *MachineVM) startHostNetworking() (string, machine.APIForwardingState, e
return "", machine.NoForwarding, err
}

dnr, dnw, err := machine.GetDevNullFiles()
if err != nil {
return "", machine.NoForwarding, err
}

defer dnr.Close()
defer dnw.Close()

cmd := gvproxy.NewGvproxyCommand()
cmd.AddQemuSocket(fmt.Sprintf("unix://%s", v.QMPMonitor.Address.GetPath()))
cmd.PidFile = v.PidFilePath.GetPath()
Expand All @@ -1342,7 +1334,6 @@ func (v *MachineVM) startHostNetworking() (string, machine.APIForwardingState, e
}

c := cmd.Cmd(binary)
c.ExtraFiles = []*os.File{dnr, dnw, dnw}
if err := c.Start(); err != nil {
return "", 0, fmt.Errorf("unable to execute: %q: %w", cmd.ToCmdline(), err)
}
Expand Down

0 comments on commit cc8c28e

Please sign in to comment.