Skip to content
  • Stefan Hajnoczi's avatar
    aa398a5c
    blockdev: make image streaming safe across hotplug · aa398a5c
    Stefan Hajnoczi authored
    
    
    Unplugging a storage interface like virtio-blk causes the host block
    device to be deleted too.  Long-running operations like block migration
    must take a DriveInfo reference to prevent the BlockDriverState from
    being freed.  For image streaming we can do the same thing.
    
    Note that it is not possible to acquire/release the drive reference in
    block.c where the block job functions live because
    drive_get_ref()/drive_put_ref() are blockdev.c functions.  Calling them
    from block.c would be a layering violation - tools like qemu-img don't
    even link against blockdev.c.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    aa398a5c
    blockdev: make image streaming safe across hotplug
    Stefan Hajnoczi authored
    
    
    Unplugging a storage interface like virtio-blk causes the host block
    device to be deleted too.  Long-running operations like block migration
    must take a DriveInfo reference to prevent the BlockDriverState from
    being freed.  For image streaming we can do the same thing.
    
    Note that it is not possible to acquire/release the drive reference in
    block.c where the block job functions live because
    drive_get_ref()/drive_put_ref() are blockdev.c functions.  Calling them
    from block.c would be a layering violation - tools like qemu-img don't
    even link against blockdev.c.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading