hw/pcie: better hotplug/hotunplug support
commit554f802da3f8b09b16b9a84ad5847b2eb0e9ad2b
authorMarcel Apfelbaum <marcel.a@redhat.com>
Mon, 23 Jun 2014 14:32:49 +0000 (23 17:32 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 23 Jun 2014 14:48:42 +0000 (23 17:48 +0300)
tree6c6ae36db714a8a2540359af2154aaa393a6557c
parentf23b6bdc3c30c77ba0dffaa6de5e398dc3c49c51
hw/pcie: better hotplug/hotunplug support

The current code is broken: it does surprise removal which crashes guests.

Reimplemented the steps:
 - Hotplug triggers both 'present detect change' and
   'attention button pressed'.

 - Hotunplug starts by triggering 'attention button pressed',
   then waits for the OS to power off the device and only
   then detaches it.

Fixes CVE-2014-3471.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pcie.c