• K
    block/qdev: Allow node name for drive properties · 8daea510
    Kevin Wolf 提交于
    If a node name instead of a BlockBackend name is specified as the driver
    for a guest device, an anonymous BlockBackend is created now.
    
    The order of operations in release_drive() must be reversed in order to
    avoid a use-after-free bug because now blk_detach_dev() frees the last
    reference if an anonymous BlockBackend is used.
    
    usb-storage uses a hack where it forwards its BlockBackend as a property
    to another device that it internally creates. This hack must be updated
    so that it doesn't drop its original BB before it can be passed to the
    other device. This used to work because we always had the monitor
    reference around, but with node-names the device reference is the only
    one now.
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    Reviewed-by: NMax Reitz <mreitz@redhat.com>
    8daea510
dev-storage.c 23.8 KB