ide: Register vm change state handler once only
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 16 Dec 2010 15:54:06 +0000 (15:54 +0000)
committerKevin Wolf <kwolf@redhat.com>
Fri, 17 Dec 2010 15:11:03 +0000 (16:11 +0100)
commit3f0854e8b659c2b7087f04d4f0e4bf3d123b8048
treefb48df4b8f9d9f01c1bacec8d40c96e908794c36
parent2aa17ce0a02ed6d6e2c3c6ee9cc84f559509e47a
ide: Register vm change state handler once only

We register the vm change state handler in a PCI BAR map() function.
This function can be called multiple times throughout the lifetime of a
PCI IDE device.  This results in duplicate vm change state handlers
being register, none of which are ever unregistered.

Instead, register the vm change state handler in the device's init
function once and for all.

piix tested, cmd646 and via not tested.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/cmd646.c
hw/ide/piix.c
hw/ide/via.c