@@ -149,9 +149,9 @@ func (q *QEMUStubber) StopVM(mc *vmconfigs.MachineConfig, _ bool) error {
149149// stopLocked stops the machine and expects the caller to hold the machine's lock.
150150func (q * QEMUStubber ) stopLocked (mc * vmconfigs.MachineConfig ) error {
151151 // check if the qmp socket is there. if not, qemu instance is gone
152- if _ , err := os .Stat (q .QMPMonitor .Address .GetPath ()); errors .Is (err , fs .ErrNotExist ) {
152+ if _ , err := os .Stat (mc . QEMUHypervisor .QMPMonitor .Address .GetPath ()); errors .Is (err , fs .ErrNotExist ) {
153153 // Right now it is NOT an error to stop a stopped machine
154- logrus .Debugf ("QMP monitor socket %v does not exist" , q .QMPMonitor .Address )
154+ logrus .Debugf ("QMP monitor socket %v does not exist" , mc . QEMUHypervisor .QMPMonitor .Address )
155155 // Fix incorrect starting state in case of crash during start
156156 if mc .Starting {
157157 mc .Starting = false
@@ -162,7 +162,7 @@ func (q *QEMUStubber) stopLocked(mc *vmconfigs.MachineConfig) error {
162162 return nil
163163 }
164164
165- qmpMonitor , err := qmp .NewSocketMonitor (q . QMPMonitor .Network , q . QMPMonitor .Address .GetPath (), q .QMPMonitor .Timeout )
165+ qmpMonitor , err := qmp .NewSocketMonitor (mc . QEMUHypervisor . QMPMonitor .Network , mc . QEMUHypervisor . QMPMonitor .Address .GetPath (), mc . QEMUHypervisor .QMPMonitor .Timeout )
166166 if err != nil {
167167 return err
168168 }
@@ -196,7 +196,7 @@ func (q *QEMUStubber) stopLocked(mc *vmconfigs.MachineConfig) error {
196196 }
197197
198198 // Remove socket
199- if err := q .QMPMonitor .Address .Delete (); err != nil {
199+ if err := mc . QEMUHypervisor .QMPMonitor .Address .Delete (); err != nil {
200200 return err
201201 }
202202
@@ -206,14 +206,14 @@ func (q *QEMUStubber) stopLocked(mc *vmconfigs.MachineConfig) error {
206206 }
207207 disconnected = true
208208
209- if q .QEMUPidPath .GetPath () == "" {
209+ if mc . QEMUHypervisor .QEMUPidPath .GetPath () == "" {
210210 // no vm pid file path means it's probably a machine created before we
211211 // started using it, so we revert to the old way of waiting for the
212212 // machine to stop
213213 return q .waitForMachineToStop (mc )
214214 }
215215
216- vmPid , err := q .QEMUPidPath .ReadPIDFrom ()
216+ vmPid , err := mc . QEMUHypervisor .QEMUPidPath .ReadPIDFrom ()
217217 if err != nil {
218218 return err
219219 }
0 commit comments