void bdrv_delete(BlockDriverState *bs)

{

    assert(!bs->peer);



    /* remove from list, if necessary */

    if (bs->device_name[0] != '\0') {

        QTAILQ_REMOVE(&bdrv_states, bs, list);

    }



    bdrv_close(bs);

    if (bs->file != NULL) {

        bdrv_delete(bs->file);

    }



    assert(bs != bs_snapshots);

    qemu_free(bs);

}

void bdrv_delete(BlockDriverState *bs)

{

    assert(!bs->peer);



    

    if (bs->device_name[0] != '\0') {

        QTAILQ_REMOVE(&bdrv_states, bs, list);

    }



    bdrv_close(bs);

    if (bs->file != NULL) {

        bdrv_delete(bs->file);

    }



    assert(bs != bs_snapshots);

    qemu_free(bs);

}

    if (bs->device_name[0] != '\0') {         QTAILQ_REMOVE(&bdrv_states, bs, list);
void FUNC_0(BlockDriverState *VAR_0)

{

    assert(!VAR_0->peer);



    

    if (VAR_0->device_name[0] != '\0') {

        QTAILQ_REMOVE(&bdrv_states, VAR_0, list);

    }



    bdrv_close(VAR_0);

    if (VAR_0->file != NULL) {

        FUNC_0(VAR_0->file);

    }



    assert(VAR_0 != bs_snapshots);

    qemu_free(VAR_0);

}

void FUNC_0(BlockDriverState *VAR_0)
{ assert(!VAR_0->peer); if (VAR_0->device_name[0] != '\0') { QTAILQ_REMOVE(&bdrv_states, VAR_0, list); } bdrv_close(VAR_0); if (VAR_0->file != NULL) { FUNC_0(VAR_0->file); } assert(VAR_0 != bs_snapshots); qemu_free(VAR_0); }