Skip to content
  • Kevin Wolf's avatar
    31b2ddfe
    graph-lock: Unlock the AioContext while polling · 31b2ddfe
    Kevin Wolf authored
    
    
    If the caller keeps the AioContext lock for a block node in an iothread,
    polling in bdrv_graph_wrlock() deadlocks if the condition isn't
    fulfilled immediately.
    
    Now that all callers make sure to actually have the AioContext locked
    when they call bdrv_replace_child_noperm() like they should, we can
    change bdrv_graph_wrlock() to take a BlockDriverState whose AioContext
    lock the caller holds (NULL if it doesn't) and unlock it temporarily
    while polling.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-ID: <20230605085711.21261-11-kwolf@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    31b2ddfe
    graph-lock: Unlock the AioContext while polling
    Kevin Wolf authored
    
    
    If the caller keeps the AioContext lock for a block node in an iothread,
    polling in bdrv_graph_wrlock() deadlocks if the condition isn't
    fulfilled immediately.
    
    Now that all callers make sure to actually have the AioContext locked
    when they call bdrv_replace_child_noperm() like they should, we can
    change bdrv_graph_wrlock() to take a BlockDriverState whose AioContext
    lock the caller holds (NULL if it doesn't) and unlock it temporarily
    while polling.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-ID: <20230605085711.21261-11-kwolf@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading