Re: [patch] kvmctl.c: allow custom memory setup.

Izik Eidus
2007-10-17T22:46:42Z

Gerd Hoffmann wrote:
> Gerd Hoffmann wrote:
>
>> I've made kvm_create() optionally skip the memory setup, so I can create
>> my own later on. That doesn't work though because creating the vcpu
>> fails then.
>>
>
> Ugh, vmx grabs last 4 pages from slot 0 (looks like for real mode
> emulation). Thus memory must exist before creating the vcpu. Which
> makes fitting filemap-backed memory into the current libkvm init
> procedure a bit difficuilt.
>
> I've decided to split the kvm_create() into a bunch of pieces which can
> be called as needed, so I can first create the vm, then do my custom
> memory setup, then create the vcpu without making vmx unhappy ...
>
> cheers,
> Gerd
>
>
hi,
why not making kvm_create_userspace_memory() recive a pointer to a
userspace allocated memory (that was allocated from file or from normal
malloc)
and make all the changes before kvm_create_userspace_memory() get called?
this way you just need to remove the memory allocation out of
kvm_create_userspace_memory() and alloc as you want.

what you think about that?