block-backend.c (3ca1f3225727419ba573673b744edac10904276f) | block-backend.c (228ca37e12f97788e05bd0c92f89b3e5e4019607) |
---|---|
1/* 2 * QEMU Block backends 3 * 4 * Copyright (C) 2014-2016 Red Hat, Inc. 5 * 6 * Authors: 7 * Markus Armbruster <armbru@redhat.com>, 8 * --- 421 unchanged lines hidden (view full) --- 430 bs = bdrv_open(filename, reference, options, flags, errp); 431 if (!bs) { 432 blk_unref(blk); 433 return NULL; 434 } 435 436 blk->root = bdrv_root_attach_child(bs, "root", &child_root, 437 BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, | 1/* 2 * QEMU Block backends 3 * 4 * Copyright (C) 2014-2016 Red Hat, Inc. 5 * 6 * Authors: 7 * Markus Armbruster <armbru@redhat.com>, 8 * --- 421 unchanged lines hidden (view full) --- 430 bs = bdrv_open(filename, reference, options, flags, errp); 431 if (!bs) { 432 blk_unref(blk); 433 return NULL; 434 } 435 436 blk->root = bdrv_root_attach_child(bs, "root", &child_root, 437 BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, |
438 blk->ctx, perm, BLK_PERM_ALL, blk, errp); | 438 perm, BLK_PERM_ALL, blk, errp); |
439 if (!blk->root) { 440 blk_unref(blk); 441 return NULL; 442 } 443 444 return blk; 445} 446 --- 397 unchanged lines hidden (view full) --- 844 * Associates a new BlockDriverState with @blk. 845 */ 846int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp) 847{ 848 ThrottleGroupMember *tgm = &blk->public.throttle_group_member; 849 bdrv_ref(bs); 850 blk->root = bdrv_root_attach_child(bs, "root", &child_root, 851 BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, | 439 if (!blk->root) { 440 blk_unref(blk); 441 return NULL; 442 } 443 444 return blk; 445} 446 --- 397 unchanged lines hidden (view full) --- 844 * Associates a new BlockDriverState with @blk. 845 */ 846int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp) 847{ 848 ThrottleGroupMember *tgm = &blk->public.throttle_group_member; 849 bdrv_ref(bs); 850 blk->root = bdrv_root_attach_child(bs, "root", &child_root, 851 BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, |
852 blk->ctx, blk->perm, blk->shared_perm, | 852 blk->perm, blk->shared_perm, |
853 blk, errp); 854 if (blk->root == NULL) { 855 return -EPERM; 856 } 857 858 notifier_list_notify(&blk->insert_bs_notifiers, blk); 859 if (tgm->throttle_state) { 860 throttle_group_detach_aio_context(tgm); --- 1594 unchanged lines hidden --- | 853 blk, errp); 854 if (blk->root == NULL) { 855 return -EPERM; 856 } 857 858 notifier_list_notify(&blk->insert_bs_notifiers, blk); 859 if (tgm->throttle_state) { 860 throttle_group_detach_aio_context(tgm); --- 1594 unchanged lines hidden --- |