block.c (1cd2ad11d37c48f284f557954e1df675b126264c) | block.c (c0829cb1fd5e0b35abfcf9fc3f04502c1ed5d7b6) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * Copyright (c) 2020 Virtuozzo International GmbH. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 3327 unchanged lines hidden (view full) --- 3336} 3337 3338int bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd, 3339 Error **errp) 3340{ 3341 int ret; 3342 Transaction *tran = tran_new(); 3343 | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * Copyright (c) 2020 Virtuozzo International GmbH. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 3327 unchanged lines hidden (view full) --- 3336} 3337 3338int bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd, 3339 Error **errp) 3340{ 3341 int ret; 3342 Transaction *tran = tran_new(); 3343 |
3344 bdrv_drained_begin(bs); 3345 |
|
3344 ret = bdrv_set_backing_noperm(bs, backing_hd, tran, errp); 3345 if (ret < 0) { 3346 goto out; 3347 } 3348 3349 ret = bdrv_refresh_perms(bs, errp); 3350out: 3351 tran_finalize(tran, ret); 3352 | 3346 ret = bdrv_set_backing_noperm(bs, backing_hd, tran, errp); 3347 if (ret < 0) { 3348 goto out; 3349 } 3350 3351 ret = bdrv_refresh_perms(bs, errp); 3352out: 3353 tran_finalize(tran, ret); 3354 |
3355 bdrv_drained_end(bs); 3356 |
|
3353 return ret; 3354} 3355 3356/* 3357 * Opens the backing file for a BlockDriverState if not yet open 3358 * 3359 * bdref_key specifies the key for the image's BlockdevRef in the options QDict. 3360 * That QDict has to be flattened; therefore, if the BlockdevRef is a QDict --- 4591 unchanged lines hidden --- | 3357 return ret; 3358} 3359 3360/* 3361 * Opens the backing file for a BlockDriverState if not yet open 3362 * 3363 * bdref_key specifies the key for the image's BlockdevRef in the options QDict. 3364 * That QDict has to be flattened; therefore, if the BlockdevRef is a QDict --- 4591 unchanged lines hidden --- |