[Libvir] [PATCH] Implement memory operations for qemu driver

Richard W.M. Jones rjones at redhat.com
Tue Mar 18 09:56:10 UTC 2008

On Mon, Mar 17, 2008 at 04:21:04PM -0400, Cole Robinson wrote:
> The attached patch implements the following operations for the qemu driver:
> virDomainGetMaxMemory
> virDomainSetMaxMemory
> virDomainSetMemory

The patch itself, +1.

Maybe we should investigate whether qemu/kvm does or will support a
way to dynamically set the memory of an active domain.  (There is no
current support for this that I can see from the documentation).

> A few questions/comments:
> 1) I changed maxmem and memory in the qemu_vm_def struct to unsigned long
>    to match the public api for memory values. Seems to work, but not sure
>    if there are any undesirable side effects to this.

It seems better as unsigned long, particularly for supporting 64 bit
archs with lots of memory.

> 2) Should SetMaxMem be able to be called on a running guest? This code
>    allows it, since maxmem is basically a metavalue that doesn't directly
>    affect a guest.
> 3) Should maxmem be able to be set lower than the currently allocated mem?
>    This code does not allow this. If this changed, would also need to take
>    into account how we would handle this if we can change the maxmem while
>    the guest is running. After rethinking, we probably should be able to
>    do this, but I haven't changed the code.

As far as I understand what maxmem means (for Xen), this seems to be
correct behaviour.


Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.

More information about the libvir-list mailing list