• Vitaly Kuznetsov's avatar
    Drivers: hv: vss: switch to using the hvutil_device_state state machine · 086a6f68
    Vitaly Kuznetsov authored
    Switch to using the hvutil_device_state state machine from using kvp_transaction.active.
    
    State transitions are:
    -> HVUTIL_DEVICE_INIT when driver loads or on device release
    -> HVUTIL_READY if the handshake was successful
    -> HVUTIL_HOSTMSG_RECEIVED when there is a non-negotiation message from the host
    -> HVUTIL_USERSPACE_REQ after we sent the message to the userspace daemon
       -> HVUTIL_USERSPACE_RECV after/if the userspace daemon has replied
    -> HVUTIL_READY after we respond to the host
    -> HVUTIL_DEVICE_DYING on driver unload
    
    In hv_vss_onchannelcallback() process ICMSGTYPE_NEGOTIATE messages even when
    the userspace daemon is disconnected, otherwise we can make the host think
    we don't support VSS and disable the service completely.
    
    Unfortunately there is no good way we can figure out that the userspace daemon
    has died (unless we start treating all timeouts as such), add a protection
    against processing new VSS_OP_REGISTER messages while being in the middle of a
    transaction (HVUTIL_USERSPACE_REQ or HVUTIL_USERSPACE_RECV state).
    Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Tested-by: default avatarAlex Ng <alexng@microsoft.com>
    Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    086a6f68
hv_snapshot.c 8.58 KB