Re: [Qemu-devel] Re: [PATCH] Fix bug for vcpu hotplug
On 08/19/2010 10:34 AM, Avi Kivity wrote: On 08/19/2010 06:24 PM, Anthony Liguori wrote: On 08/18/2010 02:33 AM, Avi Kivity wrote: On 08/18/2010 10:17 AM, Liu, Jinsong wrote: During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd. This patch is to fix the bug, allow hotplug for sysbus qdev. --- a/hw/qdev.c +++ b/hw/qdev.c @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name) if (!bus) { if (!main_system_bus) { main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus"); +main_system_bus->allow_hotplug = 1; } bus = main_system_bus; } Looks reasonable to me. Not really to me. SysBus does not support hotplugging and CPU hot plug shouldn't have anything to do with qdev hotplug. Can you explain a bit more why this is needed? On cpu hotplug an apic is added, and apics live on main_system_bus. That's the problem then. An APIC does not live on any bus and that's where the problem ought to be fixed. Regards, Anthony Liguori -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Qemu-devel] Re: [PATCH] Fix bug for vcpu hotplug
On 08/19/2010 06:24 PM, Anthony Liguori wrote: On 08/18/2010 02:33 AM, Avi Kivity wrote: On 08/18/2010 10:17 AM, Liu, Jinsong wrote: During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd. This patch is to fix the bug, allow hotplug for sysbus qdev. --- a/hw/qdev.c +++ b/hw/qdev.c @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name) if (!bus) { if (!main_system_bus) { main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus"); +main_system_bus->allow_hotplug = 1; } bus = main_system_bus; } Looks reasonable to me. Not really to me. SysBus does not support hotplugging and CPU hot plug shouldn't have anything to do with qdev hotplug. Can you explain a bit more why this is needed? On cpu hotplug an apic is added, and apics live on main_system_bus. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Qemu-devel] Re: [PATCH] Fix bug for vcpu hotplug
On 08/18/2010 02:33 AM, Avi Kivity wrote: On 08/18/2010 10:17 AM, Liu, Jinsong wrote: During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd. This patch is to fix the bug, allow hotplug for sysbus qdev. --- a/hw/qdev.c +++ b/hw/qdev.c @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name) if (!bus) { if (!main_system_bus) { main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus"); +main_system_bus->allow_hotplug = 1; } bus = main_system_bus; } Looks reasonable to me. Not really to me. SysBus does not support hotplugging and CPU hot plug shouldn't have anything to do with qdev hotplug. Can you explain a bit more why this is needed? Regards, Anthony Liguori -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Fix bug for vcpu hotplug
On 08/18/2010 10:17 AM, Liu, Jinsong wrote: During test, we found qemu-kvm has a bug result in guestos shutdown when vcpu hotadd. This patch is to fix the bug, allow hotplug for sysbus qdev. --- a/hw/qdev.c +++ b/hw/qdev.c @@ -108,6 +108,7 @@ DeviceState *qdev_create(BusState *bus, const char *name) if (!bus) { if (!main_system_bus) { main_system_bus = qbus_create(&system_bus_info, NULL, "main-system-bus"); +main_system_bus->allow_hotplug = 1; } bus = main_system_bus; } Looks reasonable to me. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] Fix bug for vcpu hotplug
Avi Kivity wrote: > On 08/06/2010 06:36 AM, Liu, Jinsong wrote: >> 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. > > Please copy qemu-devel on qemu patches. > >> @@ -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); >> } > > Doesn't seem right - this will set allow_hotplug on all busses. > > It needs to be set only on the system bus (hw/sysbus.c). Thanks Avi for comments! We update the patch to fix the bug in a simple way, your opinion? Thanks, Jinsong fix-vcpu-hotplug.patch Description: fix-vcpu-hotplug.patch
Re: [PATCH] Fix bug for vcpu hotplug
On 08/06/2010 06:36 AM, Liu, Jinsong wrote: 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. Please copy qemu-devel on qemu patches. @@ -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); } Doesn't seem right - this will set allow_hotplug on all busses. It needs to be set only on the system bus (hw/sysbus.c). -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html