void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top,

                 Error **errp)

{

    Error *local_err = NULL;



    assert(!atomic_read(&bs_top->in_flight));

    assert(!atomic_read(&bs_new->in_flight));



    bdrv_set_backing_hd(bs_new, bs_top, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        goto out;

    }



    change_parent_backing_link(bs_top, bs_new);



    /* bs_new is now referenced by its new parents, we don't need the

     * additional reference any more. */

out:

    bdrv_unref(bs_new);

}

void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top,

                 Error **errp)

{

    Error *local_err = NULL;



    assert(!atomic_read(&bs_top->in_flight));

    assert(!atomic_read(&bs_new->in_flight));



    bdrv_set_backing_hd(bs_new, bs_top, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        goto out;

    }



    change_parent_backing_link(bs_top, bs_new);



    



out:

    bdrv_unref(bs_new);

}

void FUNC_0(BlockDriverState *VAR_0, BlockDriverState *VAR_1,

                 Error **VAR_2)

{

    Error *local_err = NULL;



    assert(!atomic_read(&VAR_1->in_flight));

    assert(!atomic_read(&VAR_0->in_flight));



    bdrv_set_backing_hd(VAR_0, VAR_1, &local_err);

    if (local_err) {

        error_propagate(VAR_2, local_err);

        goto out;

    }



    change_parent_backing_link(VAR_1, VAR_0);



    



out:

    bdrv_unref(VAR_0);

}

void FUNC_0(BlockDriverState *VAR_0, BlockDriverState *VAR_1,
Error **VAR_2)
{ Error *local_err = NULL; assert(!atomic_read(&VAR_1->in_flight)); assert(!atomic_read(&VAR_0->in_flight)); bdrv_set_backing_hd(VAR_0, VAR_1, &local_err); if (local_err) { error_propagate(VAR_2, local_err); goto out; } change_parent_backing_link(VAR_1, VAR_0); out:
bdrv_unref(VAR_0); }