mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
block/mirror: check backing in bdrv_mirror_top_refresh_filename
Backing may be zero after failed bdrv_attach_child in bdrv_set_backing_hd, which leads to SIGSEGV. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20170928120300.58164-1-vsementsov@virtuozzo.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
d67a6b09b4
commit
18775ff326
1 changed files with 5 additions and 0 deletions
|
@ -1058,6 +1058,11 @@ static int coroutine_fn bdrv_mirror_top_pdiscard(BlockDriverState *bs,
|
||||||
|
|
||||||
static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)
|
static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)
|
||||||
{
|
{
|
||||||
|
if (bs->backing == NULL) {
|
||||||
|
/* we can be here after failed bdrv_attach_child in
|
||||||
|
* bdrv_set_backing_hd */
|
||||||
|
return;
|
||||||
|
}
|
||||||
bdrv_refresh_filename(bs->backing->bs);
|
bdrv_refresh_filename(bs->backing->bs);
|
||||||
pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
|
pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
|
||||||
bs->backing->bs->filename);
|
bs->backing->bs->filename);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue