void bdrv_close(BlockDriverState *bs)

{

    if (bs->drv) {

        if (bs->backing_hd)

            bdrv_delete(bs->backing_hd);

        bs->drv->bdrv_close(bs);

        qemu_free(bs->opaque);

#ifdef _WIN32

        if (bs->is_temporary) {

            unlink(bs->filename);

        }

#endif

        bs->opaque = NULL;

        bs->drv = NULL;



        /* call the change callback */

        bs->total_sectors = 0;

        bs->media_changed = 1;

        if (bs->change_cb)

            bs->change_cb(bs->change_opaque);

    }

}

void bdrv_close(BlockDriverState *bs)

{

    if (bs->drv) {

        if (bs->backing_hd)

            bdrv_delete(bs->backing_hd);

        bs->drv->bdrv_close(bs);

        qemu_free(bs->opaque);

#ifdef _WIN32

        if (bs->is_temporary) {

            unlink(bs->filename);

        }

#endif

        bs->opaque = NULL;

        bs->drv = NULL;



        

        bs->total_sectors = 0;

        bs->media_changed = 1;

        if (bs->change_cb)

            bs->change_cb(bs->change_opaque);

    }

}

        bs->total_sectors = 0;
void FUNC_0(BlockDriverState *VAR_0)

{

    if (VAR_0->drv) {

        if (VAR_0->backing_hd)

            bdrv_delete(VAR_0->backing_hd);

        VAR_0->drv->FUNC_0(VAR_0);

        qemu_free(VAR_0->opaque);

#ifdef _WIN32

        if (VAR_0->is_temporary) {

            unlink(VAR_0->filename);

        }

#endif

        VAR_0->opaque = NULL;

        VAR_0->drv = NULL;



        

        VAR_0->total_sectors = 0;

        VAR_0->media_changed = 1;

        if (VAR_0->change_cb)

            VAR_0->change_cb(VAR_0->change_opaque);

    }

}

void FUNC_0(BlockDriverState *VAR_0)
{ if (VAR_0->drv) { if (VAR_0->backing_hd)
bdrv_delete(VAR_0->backing_hd); VAR_0->drv->FUNC_0(VAR_0); qemu_free(VAR_0->opaque); #ifdef _WIN32
if (VAR_0->is_temporary) { unlink(VAR_0->filename); } #endif
VAR_0->opaque = NULL; VAR_0->drv = NULL; VAR_0->total_sectors = 0; VAR_0->media_changed = 1; if (VAR_0->change_cb)
VAR_0->change_cb(VAR_0->change_opaque); } }