Skip to content
  • Hanna Reitz's avatar
    be64bbb0
    block: Pass BdrvChild ** to replace_child_noperm · be64bbb0
    Hanna Reitz authored
    
    
    bdrv_replace_child_noperm() modifies BdrvChild.bs, and can potentially
    set it to NULL.  That is dangerous, because BDS parents generally assume
    that their children's .bs pointer is never NULL.  We therefore want to
    let bdrv_replace_child_noperm() set the corresponding BdrvChild pointer
    to NULL, too.
    
    This patch lays the foundation for it by passing a BdrvChild ** pointer
    to bdrv_replace_child_noperm() so that it can later use it to NULL the
    BdrvChild pointer immediately after setting BdrvChild.bs to NULL.
    
    (We will still need to undertake some intermediate steps, though.)
    
    Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
    Message-Id: <20211111120829.81329-6-hreitz@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-Id: <20211115145409.176785-6-kwolf@redhat.com>
    Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
    be64bbb0
    block: Pass BdrvChild ** to replace_child_noperm
    Hanna Reitz authored
    
    
    bdrv_replace_child_noperm() modifies BdrvChild.bs, and can potentially
    set it to NULL.  That is dangerous, because BDS parents generally assume
    that their children's .bs pointer is never NULL.  We therefore want to
    let bdrv_replace_child_noperm() set the corresponding BdrvChild pointer
    to NULL, too.
    
    This patch lays the foundation for it by passing a BdrvChild ** pointer
    to bdrv_replace_child_noperm() so that it can later use it to NULL the
    BdrvChild pointer immediately after setting BdrvChild.bs to NULL.
    
    (We will still need to undertake some intermediate steps, though.)
    
    Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
    Message-Id: <20211111120829.81329-6-hreitz@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-Id: <20211115145409.176785-6-kwolf@redhat.com>
    Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
Loading