• Michael Brown's avatar
    xen-netback: Check for hotplug-status existence before watching · 2afeec08
    Michael Brown authored
    The logic in connect() is currently written with the assumption that
    xenbus_watch_pathfmt() will return an error for a node that does not
    exist.  This assumption is incorrect: xenstore does allow a watch to
    be registered for a nonexistent node (and will send notifications
    should the node be subsequently created).
    
    As of commit 1f256578 ("xen-netback: remove 'hotplug-status' once it
    has served its purpose"), this leads to a failure when a domU
    transitions into XenbusStateConnected more than once.  On the first
    domU transition into Connected state, the "hotplug-status" node will
    be deleted by the hotplug_status_changed() callback in dom0.  On the
    second or subsequent domU transition into Connected state, the
    hotplug_status_changed() callback will therefore never be invoked, and
    so the backend will remain stuck in InitWait.
    
    This failure prevents scenarios such as reloading the xen-netfront
    module within a domU, or booting a domU via iPXE.  The...
    2afeec08
xenbus.c 29.3 KB