qemu/hw/xen
Paul Durrant 67bc8e00f7 xen: fix xen-bus state model to allow frontend re-connection
There is a flaw in the xen-bus state model. To allow a frontend to re-
connect the backend state of an online XenDevice is transitioned from
Closed to InitWait, but this is currently done unilaterally which is
incorrect. The backend state should remain Closed until the frontend state
transitions to Initialising.

This patch removes the automatic backend state transition from
xen_device_backend_state_changed() and, instead, adds an extra check in
xen_device_frontend_state_changed() to determine whether a frontend is
trying to re-connect to a previously Closed XenDevice. Only if this is
found to be the case is the backend state transitioned from Closed to
InitWait. Note that this transition will be common amongst all XenDevice
classes and hence xen_device_frontend_state_changed() returns immediately
afterwards without calling into the XenDeviceClass frontend_changed()
method.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2019-02-04 11:04:49 +00:00
..
Makefile.objs xen: add a mechanism to automatically create XenDevice-s... 2019-01-14 13:45:40 +00:00
trace-events xen: add a mechanism to automatically create XenDevice-s... 2019-01-14 13:45:40 +00:00
xen_devconfig.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen_pt_config_init.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen_pt_graphics.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen_pt_load_rom.c xen: Don't use memory_region_init_ram_nomigrate() in pci_assign_dev_load_option_rom() 2018-06-22 13:28:42 +01:00
xen_pt_msi.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen_pt.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen_pt.h xen: Don't use memory_region_init_ram_nomigrate() in pci_assign_dev_load_option_rom() 2018-06-22 13:28:42 +01:00
xen_pvdev.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen-backend.c xen: add a mechanism to automatically create XenDevice-s... 2019-01-14 13:45:40 +00:00
xen-bus-helper.c xen: add xenstore watcher infrastructure 2019-01-14 13:45:40 +00:00
xen-bus.c xen: fix xen-bus state model to allow frontend re-connection 2019-02-04 11:04:49 +00:00
xen-common.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen-host-pci-device.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
xen-host-pci-device.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
xen-legacy-backend.c xen: automatically create XenBlockDevice-s 2019-01-14 13:45:40 +00:00