Wei Liu writes ("Re: [PATCH 2/2] xl: disable events earlier for shutdown event"): > On Thu, Feb 02, 2017 at 03:52:41PM +0000, Ian Jackson wrote: > > But I think I don't really understand what the original bug is. > > The original bug is that:
Ah. > 1. boot a guest with no disks, so diskws is NULL, num_disks == 0 > 2. some removable disks are added, and domain config updated > 3. guest reboots, xl gets shutdown event > 4. handle_domain_death gets the latest d_config, num_disks != 0 now > 5. try to disable disk eject events with evdisable_disk_ejects -> BOOM > > So basically 5 needs to happen before 4. Moving that snippet seems to do > the trick, and then freeing diskws + setting it to NULL makes the > reboot path automatically re-register diskws. Surely the right answer is to make evdisable_disk_ejects tolerate whatever it finds in diskws (including diskws==NULL). It could be idempotent too. That way nothing depends on the exact ordering. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel