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) { virDomainSetMaxMemory(max) } } } 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. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list