static void iscsi_close(BlockDriverState *bs)

{

    IscsiLun *iscsilun = bs->opaque;

    struct iscsi_context *iscsi = iscsilun->iscsi;



    iscsi_detach_aio_context(bs);

    if (iscsi_is_logged_in(iscsi)) {

        iscsi_logout_sync(iscsi);

    }

    iscsi_destroy_context(iscsi);

    g_free(iscsilun->zeroblock);

    g_free(iscsilun->allocationmap);

    memset(iscsilun, 0, sizeof(IscsiLun));

}

static void iscsi_close(BlockDriverState *bs)

{

    IscsiLun *iscsilun = bs->opaque;

    struct iscsi_context *iscsi = iscsilun->iscsi;



    iscsi_detach_aio_context(bs);

    if (iscsi_is_logged_in(iscsi)) {

        iscsi_logout_sync(iscsi);

    }

    iscsi_destroy_context(iscsi);

    g_free(iscsilun->zeroblock);

    g_free(iscsilun->allocationmap);

    memset(iscsilun, 0, sizeof(IscsiLun));

}

static void FUNC_0(BlockDriverState *VAR_0)

{

    IscsiLun *iscsilun = VAR_0->opaque;

    struct iscsi_context *VAR_1 = iscsilun->VAR_1;



    iscsi_detach_aio_context(VAR_0);

    if (iscsi_is_logged_in(VAR_1)) {

        iscsi_logout_sync(VAR_1);

    }

    iscsi_destroy_context(VAR_1);

    g_free(iscsilun->zeroblock);

    g_free(iscsilun->allocationmap);

    memset(iscsilun, 0, sizeof(IscsiLun));

}

static void FUNC_0(BlockDriverState *VAR_0)
{ IscsiLun *iscsilun = VAR_0->opaque; struct iscsi_context *VAR_1 = iscsilun->VAR_1; iscsi_detach_aio_context(VAR_0); if (iscsi_is_logged_in(VAR_1)) { iscsi_logout_sync(VAR_1); } iscsi_destroy_context(VAR_1); g_free(iscsilun->zeroblock); g_free(iscsilun->allocationmap); memset(iscsilun, 0, sizeof(IscsiLun)); }