Skip to content

Commit 59e63ac

Browse files
committed
qemu: enable control mode to monitor socket
1 parent bb577d4 commit 59e63ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/qemu/driver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const (
4444
// Represents an ACPI shutdown request to the VM (emulates pressing a physical power button)
4545
// Reference: https://en.wikibooks.org/wiki/QEMU/Monitor
4646
// Use a short file name since socket paths have a maximum length.
47-
qemuGracefulShutdownMsg = "system_powerdown\n"
48-
qemuQmpCapabilitiesMsg = "qmp_capabilities\n"
47+
qemuGracefulShutdownMsg = `{"execute": "system_powerdown"}`
48+
qemuQmpCapabilitiesMsg = `{"execute":"qmp_capabilities"}`
4949
qemuMonitorSocketName = "qm.sock"
5050

5151
// Socket file enabling communication with the Qemu Guest Agent (if enabled and running)
@@ -505,7 +505,7 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drive
505505
return nil, nil, err
506506
}
507507
d.logger.Debug("got monitor path", "monitorPath", monitorPath)
508-
args = append(args, "-monitor", fmt.Sprintf("unix:%s,server,nowait", monitorPath))
508+
args = append(args, "-qmp", fmt.Sprintf("unix:%s,server=on,wait=off", monitorPath))
509509
}
510510

511511
if driverConfig.GuestAgent {

0 commit comments

Comments
 (0)