diff options
author | Glauber Costa <glommer@redhat.com> | 2009-07-14 11:35:15 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2009-07-14 19:37:30 -0300 |
commit | 083a3c080eac2c7dd7f07c98464487410fc9e338 (patch) | |
tree | 812a07e86d66fead15c715e8fecc5726f55dea1e /qemu-kvm.h | |
parent | fold libkvm-all into standard qemu header (diff) | |
download | qemu-kvm-083a3c080eac2c7dd7f07c98464487410fc9e338.tar.gz qemu-kvm-083a3c080eac2c7dd7f07c98464487410fc9e338.tar.bz2 qemu-kvm-083a3c080eac2c7dd7f07c98464487410fc9e338.zip |
duplicate KVMState
In this patch, we duplicate most of KVMState in our files. This should be
removed later, when they are 100 % equal. Meanwhile, we fold our kvm_context_t
structure inside it.
To make transition smooth, we still keep a global variable kvm_context
pointing to its position inside the global KVMState. This way we don't
need to hurry about changing all callers.
kvm_init() and kvm_finalize are changed, though, since they have now to
deal with the creation/destruction of a global KVMState
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'qemu-kvm.h')
-rw-r--r-- | qemu-kvm.h | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/qemu-kvm.h b/qemu-kvm.h index 20993f682..5d2d54caa 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -128,18 +128,7 @@ int kvm_set_msrs(kvm_vcpu_context_t, struct kvm_msr_entry *msrs, int n); * \param opaque Not used * \return NULL on failure */ -kvm_context_t kvm_init(void *opaque); - -/*! - * \brief Cleanup the KVM context - * - * Should always be called when closing down KVM.\n - * Exception: If kvm_init() fails, this function should not be called, as the - * context would be invalid - * - * \param kvm Pointer to the kvm_context that is to be freed - */ -void kvm_finalize(kvm_context_t kvm); +int kvm_init(int smp_cpus); /*! * \brief Disable the in-kernel IRQCHIP creation @@ -1166,4 +1155,27 @@ static inline int kvm_set_migration_log(int enable) return kvm_physical_memory_set_dirty_tracking(enable); } +typedef struct KVMSlot +{ + target_phys_addr_t start_addr; + ram_addr_t memory_size; + ram_addr_t phys_offset; + int slot; + int flags; +} KVMSlot; + +typedef struct kvm_dirty_log KVMDirtyLog; + +typedef struct KVMState +{ + KVMSlot slots[32]; + int fd; + int vmfd; + int coalesced_mmio; + int broken_set_mem_region; + int migration_log; + struct kvm_context kvm_context; +} KVMState; + + #endif |