func (d *VirDomain) SetMemoryFlags(memory uint64, flags uint32) error { result := C.virDomainSetMemoryFlags(d.ptr, C.ulong(memory), C.uint(flags)) if result == -1 { return GetLastError() } return nil }
// SetMemory dynamically changes the target amount of physical memory allocated // to a domain. This function may require privileged access to the hypervisor. func (dom Domain) SetMemory(memory uint64, flags DomainMemoryModifyFlag) error { dom.log.Printf("changing domain memory to %v kiB (flags = %v)...\n", memory, flags) cRet := C.virDomainSetMemoryFlags(dom.virDomain, C.ulong(memory), C.uint(flags)) ret := int32(cRet) if ret == -1 { err := LastError() dom.log.Printf("an error occurred: %v\n", err) return err } dom.log.Println("memory changed") return nil }