On 23/03/17 22:28, Eduardo Habkost wrote: > The xen-backend devices created by the Xen code are not supposed > to be treated as dynamic sysbus devices. This is an attempt to > change that and see what happens, but I couldn't test it because > I don't have a Xen host set up. > > If this patch breaks anything, this means we have a bug in > foreach_dynamic_sysbus_device(), which is supposed to return only > devices created using -device. > > The original code that sets has_dynamic_sysbus was added by > commit 3a6c9172ac5951e6dac2b3f6cbce3cfccdec5894, but I don't see > any comment explaining why it was necessary.
xen-backend devices are created via qmp commands when attaching new pv-devices to a domain. They can be dynamically removed, too. Setting has_dynamic_sysbus was necessary to support this feature. So just removing it will break Xen. NAK as a standalone patch. Juergen > > Cc: Juergen Gross <jgr...@suse.com> > Cc: Stefano Stabellini <sstabell...@kernel.org> > Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> > --- > hw/xen/xen_backend.c | 11 ----------- > 1 file changed, 11 deletions(-) > > diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c > index 6c21c37d68..4607d6d3ee 100644 > --- a/hw/xen/xen_backend.c > +++ b/hw/xen/xen_backend.c > @@ -550,15 +550,6 @@ err: > return -1; > } > > -static void xen_set_dynamic_sysbus(void) > -{ > - Object *machine = qdev_get_machine(); > - ObjectClass *oc = object_get_class(machine); > - MachineClass *mc = MACHINE_CLASS(oc); > - > - mc->has_dynamic_sysbus = true; > -} > - > int xen_be_register(const char *type, struct XenDevOps *ops) > { > char path[50]; > @@ -580,8 +571,6 @@ int xen_be_register(const char *type, struct XenDevOps > *ops) > > void xen_be_register_common(void) > { > - xen_set_dynamic_sysbus(); > - > xen_be_register("console", &xen_console_ops); > xen_be_register("vkbd", &xen_kbdmouse_ops); > xen_be_register("qdisk", &xen_blkdev_ops); >