HomeFreeBSD

xen/blkback: fix reconnection of backend

Description

xen/blkback: fix reconnection of backend

The hotplug script will be executed only once for each backend,
regardless of the frontend triggering reconnections. Fix blkback to
deal with the hotplug script being executed only once, so that
reconnections don't stall waiting for a hotplug script execution
that will never happen.

As a result of the fix move the initialization of dev_mode, dev_type
and dev_name to the watch callback, as they should be set only once
the first time the backend connects.

This fix is specially relevant for guests wanting to use UEFI OVMF
firmware, because OVMF will use Xen PV block devices and disconnect
afterwards, thus allowing them to be used by the guest OS. Without
this change the guest OS will stall waiting for the block backed to
attach.

Fixes: de0bad00010c ('blkback: add support for hotplug scripts')
MFC after: 1 week
Sponsored by: Citrix Systems R&D

Details

Provenance
roygerAuthored on May 11 2021, 10:19 AM
Parents
rG4b86a24a76a4: tcp: In rack, we must only convert restored rtt when the hostcache does restoreā€¦
Branches
Unknown
Tags
Unknown