bool bdrv_is_first_non_filter(BlockDriverState *candidate)

{

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;



    /* walk down the bs forest recursively */

    while ((it = bdrv_next(it, &bs)) != NULL) {

        bool perm;



        /* try to recurse in this top level bs */

        perm = bdrv_recurse_is_first_non_filter(bs, candidate);



        /* candidate is the first non filter */

        if (perm) {

            return true;

        }

    }



    return false;

}

bool bdrv_is_first_non_filter(BlockDriverState *candidate)

{

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;



    

    while ((it = bdrv_next(it, &bs)) != NULL) {

        bool perm;



        

        perm = bdrv_recurse_is_first_non_filter(bs, candidate);



        

        if (perm) {

            return true;

        }

    }



    return false;

}

    BdrvNextIterator *it = NULL;     while ((it = bdrv_next(it, &bs)) != NULL) {     BdrvNextIterator *it = NULL;     while ((it = bdrv_next(it, &bs)) != NULL) {     while ((it = bdrv_next(it, &bs)) != NULL) {     BdrvNextIterator *it = NULL;     while ((it = bdrv_next(it, &bs)) != NULL) {     BlockDriverState *bs;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;
bool FUNC_0(BlockDriverState *candidate)

{

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;



    

    while ((it = bdrv_next(it, &bs)) != NULL) {

        bool perm;



        

        perm = bdrv_recurse_is_first_non_filter(bs, candidate);



        

        if (perm) {

            return true;

        }

    }



    return false;

}

bool FUNC_0(BlockDriverState *candidate)
{ BlockDriverState *bs; BdrvNextIterator *it = NULL; while ((it = bdrv_next(it, &bs)) != NULL) { bool perm; perm = bdrv_recurse_is_first_non_filter(bs, candidate); if (perm) { return true; } } return false; }