void xen_pt_config_delete(XenPCIPassthroughState *s)

{

    struct XenPTRegGroup *reg_group, *next_grp;

    struct XenPTReg *reg, *next_reg;



    /* free MSI/MSI-X info table */

    if (s->msix) {

        xen_pt_msix_delete(s);

    }

    if (s->msi) {

        g_free(s->msi);

    }



    /* free all register group entry */

    QLIST_FOREACH_SAFE(reg_group, &s->reg_grps, entries, next_grp) {

        /* free all register entry */

        QLIST_FOREACH_SAFE(reg, &reg_group->reg_tbl_list, entries, next_reg) {

            QLIST_REMOVE(reg, entries);

            g_free(reg);

        }



        QLIST_REMOVE(reg_group, entries);

        g_free(reg_group);

    }

}

void xen_pt_config_delete(XenPCIPassthroughState *s)

{

    struct XenPTRegGroup *reg_group, *next_grp;

    struct XenPTReg *reg, *next_reg;



    

    if (s->msix) {

        xen_pt_msix_delete(s);

    }

    if (s->msi) {

        g_free(s->msi);

    }



    

    QLIST_FOREACH_SAFE(reg_group, &s->reg_grps, entries, next_grp) {

        

        QLIST_FOREACH_SAFE(reg, &reg_group->reg_tbl_list, entries, next_reg) {

            QLIST_REMOVE(reg, entries);

            g_free(reg);

        }



        QLIST_REMOVE(reg_group, entries);

        g_free(reg_group);

    }

}

void FUNC_0(XenPCIPassthroughState *VAR_0)

{

    struct XenPTRegGroup *VAR_1, *VAR_2;

    struct XenPTReg *VAR_3, *VAR_4;



    

    if (VAR_0->msix) {

        xen_pt_msix_delete(VAR_0);

    }

    if (VAR_0->msi) {

        g_free(VAR_0->msi);

    }



    

    QLIST_FOREACH_SAFE(VAR_1, &VAR_0->reg_grps, entries, VAR_2) {

        

        QLIST_FOREACH_SAFE(VAR_3, &VAR_1->reg_tbl_list, entries, VAR_4) {

            QLIST_REMOVE(VAR_3, entries);

            g_free(VAR_3);

        }



        QLIST_REMOVE(VAR_1, entries);

        g_free(VAR_1);

    }

}

void FUNC_0(XenPCIPassthroughState *VAR_0)
{ struct XenPTRegGroup *VAR_1, *VAR_2; struct XenPTReg *VAR_3, *VAR_4; if (VAR_0->msix) { xen_pt_msix_delete(VAR_0); } if (VAR_0->msi) { g_free(VAR_0->msi); } QLIST_FOREACH_SAFE(VAR_1, &VAR_0->reg_grps, entries, VAR_2) { QLIST_FOREACH_SAFE(VAR_3, &VAR_1->reg_tbl_list, entries, VAR_4) { QLIST_REMOVE(VAR_3, entries); g_free(VAR_3); } QLIST_REMOVE(VAR_1, entries); g_free(VAR_1); } }