Skip to content
Snippets Groups Projects
Commit 95a1b158 authored by Florent Gluck's avatar Florent Gluck
Browse files

Added SendCmd and SendReboot to QGA code

parent 2e189350
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,17 @@ func (q *QGACon)SendShutdown() error { ...@@ -38,6 +38,17 @@ func (q *QGACon)SendShutdown() error {
return err return err
} }
// Send a reboot command to the guest OS.
func (q *QGACon)SendReboot() error {
return q.SendCmd("reboot")
}
// Send a command to the guest OS.
func (q *QGACon)SendCmd(cmd string) error {
_, err := q.sock.Write([]byte(`{"execute":"guest-exec", "arguments":{"path":"`+cmd+`"}}`))
return err
}
// TODO: work in progress... // TODO: work in progress...
func (q *QGACon)WriteFile(filePath string) error { func (q *QGACon)WriteFile(filePath string) error {
filePath = "/home/nexus/pipo.txt" filePath = "/home/nexus/pipo.txt"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment