Commit 122c4a0b authored by xiang siwei's avatar xiang siwei Committed by Daniel P. Berrange

Add binding for virDomainQemuAgentCommand

parent 0e52f11f
......@@ -455,6 +455,16 @@ const (
DOMAIN_QEMU_MONITOR_COMMAND_HMP = DomainQemuMonitorCommandFlags(C.VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP)
)
type DomainQemuAgentCommandTimeout int
const (
DOMAIN_QEMU_AGENT_COMMAND_MIN = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN)
DOMAIN_QEMU_AGENT_COMMAND_BLOCK = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK)
DOMAIN_QEMU_AGENT_COMMAND_DEFAULT = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT)
DOMAIN_QEMU_AGENT_COMMAND_NOWAIT = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT)
DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN = DomainQemuAgentCommandTimeout(C.VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN)
)
type DomainProcessSignal int
const (
......@@ -1744,6 +1754,20 @@ func (d *Domain) QemuMonitorCommand(command string, flags DomainQemuMonitorComma
return rstring, nil
}
func (d *Domain) QemuAgentCommand(command string, timeout DomainQemuAgentCommandTimeout, flags uint32) (string, error) {
cCommand := C.CString(command)
defer C.free(unsafe.Pointer(cCommand))
result := C.virDomainQemuAgentCommand(d.ptr, cCommand, C.int(timeout), C.uint(flags))
if result == nil {
return "", GetLastError()
}
rstring := C.GoString(result)
C.free(unsafe.Pointer(result))
return rstring, nil
}
func (d *Domain) PinVcpu(vcpu uint, cpuMap []bool) error {
maplen := (len(cpuMap) + 7) / 8
ccpumap := make([]C.uchar, maplen)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment