Skip to content
  • Kevin Wolf's avatar
    520d8b40
    block/export: Fix vhost-user-blk shutdown with requests in flight · 520d8b40
    Kevin Wolf authored
    
    
    The vhost-user-blk export runs requests asynchronously in their own
    coroutine. When the vhost connection goes away and we want to stop the
    vhost-user server, we need to wait for these coroutines to stop before
    we can unmap the shared memory. Otherwise, they would still access the
    unmapped memory and crash.
    
    This introduces a refcount to VuServer which is increased when spawning
    a new request coroutine and decreased before the coroutine exits. The
    memory is only unmapped when the refcount reaches zero.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-Id: <20220125151435.48792-1-kwolf@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    520d8b40
    block/export: Fix vhost-user-blk shutdown with requests in flight
    Kevin Wolf authored
    
    
    The vhost-user-blk export runs requests asynchronously in their own
    coroutine. When the vhost connection goes away and we want to stop the
    vhost-user server, we need to wait for these coroutines to stop before
    we can unmap the shared memory. Otherwise, they would still access the
    unmapped memory and crash.
    
    This introduces a refcount to VuServer which is increased when spawning
    a new request coroutine and decreased before the coroutine exits. The
    memory is only unmapped when the refcount reaches zero.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-Id: <20220125151435.48792-1-kwolf@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading