From: Gonglei <arei.gong...@huawei.com>

Device should be removed from global boot list when
it is hot-unplugged.

Signed-off-by: Gonglei <arei.gong...@huawei.com>
Signed-off-by: Chenliang <chenlian...@huawei.com>
---
 hw/core/qdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index da1ba48..70294ad 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -972,6 +972,10 @@ static void device_finalize(Object *obj)
     NamedGPIOList *ngl, *next;
 
     DeviceState *dev = DEVICE(obj);
+
+    /* remove device's bootindex from global boot order list */
+    del_boot_device_path(dev);
+
     if (dev->opts) {
         qemu_opts_del(dev->opts);
     }
-- 
1.7.12.4



Reply via email to