Am 11.01.2011 00:04, Anthony Liguori wrote: >>> kvmclock should be created with >>> kvm_state as a parameter and kvm_vm_ioctl() is passed the stored >>> reference. Taking a global reference to kvm_state in machine_init is >>> not a bad thing, obviously the machine initialization function needs >>> access to the kvm_state. >>> >> This would also require changing sysbus interfaces for the sake of KVM's >> "abstraction". If this is the only way forward, I could look into this. >> >> Still, I do not see any benefit for the affected code. You then either >> need to "steal" a kvm_state reference from the first cpu or introduce a >> marvelous interface like kvm_get_state() to make this work from outside >> of the KVM core. >> > > Or move kvm_init() to pc_init() and then pc_init() has the kvm_state > reference. Or pass the reference to the machine_init service to avoid duplicating kvm_init logic for every KVM arch. That alone would still be consistent. But as long as we do not pass a kvm_state to each and every memory registration (for kvm_setup_guest_memory), this all is like putting a fence around half of your yard and only declaring it closed. Jan
Attachment:
signature.asc
Description: OpenPGP digital signature