KVM: coalesced_mmio: fix kvm_coalesced_mmio_init()'s error handling
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Mon, 15 Mar 2010 13:13:30 +0000 (22:13 +0900)
committerAvi Kivity <avi@redhat.com>
Mon, 17 May 2010 09:15:53 +0000 (12:15 +0300)
commit6ce5a090a9a0ea4266a2cad058c69e2f27201e11
treeae8223dc3c73309fb34890b735bb4a0d75caafdc
parent31299944584fd62df8b0cfa30ad2c56f445b8cf2
KVM: coalesced_mmio: fix kvm_coalesced_mmio_init()'s error handling

kvm_coalesced_mmio_init() keeps to hold the addresses of a coalesced
mmio ring page and dev even after it has freed them.

Also, if this function fails, though it might be rare, it seems to be
suggesting the system's serious state: so we'd better stop the works
following the kvm_creat_vm().

This patch clears these problems.

  We move the coalesced mmio's initialization out of kvm_create_vm().
  This seems to be natural because it includes a registration which
  can be done only when vm is successfully created.

Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
virt/kvm/coalesced_mmio.c
virt/kvm/kvm_main.c