From 5a126af98bf6d109490756c739b584a2a2e5b475 Mon Sep 17 00:00:00 2001
From: Liu, Jinsong <jinsong.liu@intel.com>
Date: Fri, 6 Aug 2010 11:05:54 +0800
Subject: [PATCH] Fix bug for vcpu hotplug

Recently seabios implement vcpu hotplug infrastructure.
During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd.
This patch is to fix the bug, mark bus->allow_hotplug as 1 after qdev_hotplug init done.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
---
 hw/qdev.c        |    3 +++
 pc-bios/bios.bin |  Bin 131072 -> 131072 bytes
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index e99c73f..c60c8f7 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -117,6 +117,9 @@ DeviceState *qdev_create(BusState *bus, const char *name)
         hw_error("Unknown device '%s' for bus '%s'\n", name, bus->info->name);
     }
 
+    if (qdev_hotplug)
+        bus->allow_hotplug = 1;
+
     return qdev_create_from_info(bus, info);
 }
 
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d0d4b6a..f6b094b 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
-- 
1.6.5.6

