static void replication_close(BlockDriverState *bs)

{

    BDRVReplicationState *s = bs->opaque;



    if (s->replication_state == BLOCK_REPLICATION_RUNNING) {

        replication_stop(s->rs, false, NULL);







    if (s->mode == REPLICATION_MODE_SECONDARY) {

        g_free(s->top_id);




    replication_remove(s->rs);

static void replication_close(BlockDriverState *bs)

{

    BDRVReplicationState *s = bs->opaque;



    if (s->replication_state == BLOCK_REPLICATION_RUNNING) {

        replication_stop(s->rs, false, NULL);







    if (s->mode == REPLICATION_MODE_SECONDARY) {

        g_free(s->top_id);




    replication_remove(s->rs);

static void FUNC_0(BlockDriverState *VAR_0)

{

    BDRVReplicationState *s = VAR_0->opaque;



    if (s->replication_state == BLOCK_REPLICATION_RUNNING) {

        replication_stop(s->rs, false, NULL);







    if (s->mode == REPLICATION_MODE_SECONDARY) {

        g_free(s->top_id);




    replication_remove(s->rs);

static void FUNC_0(BlockDriverState *VAR_0)
{ BDRVReplicationState *s = VAR_0->opaque; if (s->replication_state == BLOCK_REPLICATION_RUNNING) { replication_stop(s->rs, false, NULL); if (s->mode == REPLICATION_MODE_SECONDARY) { g_free(s->top_id); replication_remove(s->rs);