[Libvir] [PATCH] Add the message when a little memory is set with setmaxmem.

Daniel Veillard veillard at redhat.com
Mon Mar 26 09:25:51 UTC 2007

On Mon, Mar 26, 2007 at 11:34:10AM +0900, Masayuki Sunou wrote:
> Hi Daniel

  Hi Masayuki,

> I understood your suggestion.
> Therefore, I decline applying this patch.
> >    I'm afraid that patch - even if limited to virsh - is unfortunately not
> > a good idea, as usual the preferred way would be to get xend fixed to
> > return a better error message, so I prefer to decline applying that patch
> > as is. I'm also wondering if virDomainSetMemory() should not be called first
> > to try to shrink and then only make the check of the current memory usage,
> > the problem is that memory shrinking is likely to be a long operation in
> > that case since it certainly gonna involve moving blocks to disk.

  What do you think of the following sequence (in pseudo code):

set_max(max) {
    cur = virDomainGetMemory()
    if (cur > max) {
        ret = virDomainSetMemory(max);
	if (ret == 0) {

It gives the system one more chance to actually do the shrinking, but
I'm afraid it won't solve the initial problem of your patch which is to
avoid the Xen error message, it's unlikely virDomainSetMemory() error
would be any better than virDomainSetMaxMemory() one, but that could be
tried, if you think it's worth trying to chase this issue.


Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

More information about the libvir-list mailing list