On Tue, Jun 14, 2016 at 11:56:16AM +0300, Pavel Butsykin wrote:
Yes, that's right, I'm just here to follow the rule - the simpler the better :) Your solution is more correct, because it allows to go to the next step, to make this knowledge outward. The caller may know better need extra memory or not. For example, in the context of this issue, we do not need additional memory for windows guests.
FWIW this is the final patch I went with: https://github.com/libguestfs/libguestfs/commit/08f82f2e3d6975b72340dd59f438... It will allocate 800MB on x86-64. Note that actual usage should be smaller since KVM will allocate the RAM only if the guest tries to use it. Also we have a few tricks coming soon like using DAX in the next version of qemu[1]. It's difficult to make the amount vary by guest type, since virt-v2v doesn't know the guest type until it has inspected it, which happens after the appliance has been launched. Rich. [1] https://www.redhat.com/archives/libguestfs/2016-May/msg00138.html -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org