Skip to content
  • Kevin Wolf's avatar
    b6d2e599
    block: Convert block job core to BlockBackend · b6d2e599
    Kevin Wolf authored
    
    
    This adds a new BlockBackend field to the BlockJob struct, which
    coexists with the BlockDriverState while converting the individual jobs.
    
    When creating a block job, a new BlockBackend is created on top of the
    given BlockDriverState, and it is destroyed when the BlockJob ends. The
    reference to the BDS is now held by the BlockBackend instead of calling
    bdrv_ref/unref manually.
    
    We have to be careful when we use bdrv_replace_in_backing_chain() in
    block jobs because this changes the BDS that job->blk points to. At the
    moment block jobs are too tightly coupled with their BDS, so that moving
    a job to another BDS isn't easily possible; therefore, we need to just
    manually undo this change afterwards.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    b6d2e599
    block: Convert block job core to BlockBackend
    Kevin Wolf authored
    
    
    This adds a new BlockBackend field to the BlockJob struct, which
    coexists with the BlockDriverState while converting the individual jobs.
    
    When creating a block job, a new BlockBackend is created on top of the
    given BlockDriverState, and it is destroyed when the BlockJob ends. The
    reference to the BDS is now held by the BlockBackend instead of calling
    bdrv_ref/unref manually.
    
    We have to be careful when we use bdrv_replace_in_backing_chain() in
    block jobs because this changes the BDS that job->blk points to. At the
    moment block jobs are too tightly coupled with their BDS, so that moving
    a job to another BDS isn't easily possible; therefore, we need to just
    manually undo this change afterwards.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Loading