Fix freeing assigned devices
commita2d609b8106d300af383bfcb048f2a69dc79d6dd
authorWeidong Han <weidong.han@intel.com>
Fri, 12 Jun 2009 16:58:03 +0000 (13 00:58 +0800)
committerAvi Kivity <avi@redhat.com>
Mon, 15 Jun 2009 12:41:15 +0000 (15 15:41 +0300)
treec8c664a684e2746240c11bb676822df06a1e7114
parentfbea8af7fa9d16371a635a628ee5396f01dac356
Fix freeing assigned devices

In free_assigned_device, kvm_remove_ioperm_data won't be
called, because the check skips type IORESOURCE_IO. For
IORESOURCE_MEM, it should destroy the registered memory,
otherwise it may be failed to create new memory slot because
it is already there. hot add and hot remove a device several
times can trigger this failure.

This patch fixes the above issues.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/device-assignment.c