kvm: destroy emulated devices on VM exit

The hassle of getting refcounting right was greater than the hassle
of keeping a list of devices to destroy on VM exit.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Scott Wood 2013-04-25 14:11:23 +00:00 committed by Alexander Graf
parent 22e64024fb
commit 07f0a7bdec
3 changed files with 18 additions and 16 deletions

View file

@ -393,6 +393,7 @@ struct kvm {
long mmu_notifier_count;
#endif
long tlbs_dirty;
struct list_head devices;
};
#define kvm_err(fmt, ...) \
@ -1069,8 +1070,8 @@ struct kvm_device_ops;
struct kvm_device {
struct kvm_device_ops *ops;
struct kvm *kvm;
atomic_t users;
void *private;
struct list_head vm_node;
};
/* create, destroy, and name are mandatory */