static void build_guest_fsinfo_for_virtual_device(char const *syspath,

                                                  GuestFilesystemInfo *fs,

                                                  Error **errp)

{

    DIR *dir;

    char *dirpath;

    struct dirent entry, *result;



    dirpath = g_strdup_printf("%s/slaves", syspath);

    dir = opendir(dirpath);

    if (!dir) {

        error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath);

        g_free(dirpath);

        return;

    }

    g_free(dirpath);



    for (;;) {

        if (readdir_r(dir, &entry, &result) != 0) {

            error_setg_errno(errp, errno, "readdir_r(\"%s\")", dirpath);

            break;

        }

        if (!result) {

            break;

        }



        if (entry.d_type == DT_LNK) {

            g_debug(" slave device '%s'", entry.d_name);

            dirpath = g_strdup_printf("%s/slaves/%s", syspath, entry.d_name);

            build_guest_fsinfo_for_device(dirpath, fs, errp);

            g_free(dirpath);



            if (*errp) {

                break;

            }

        }

    }



    closedir(dir);

}

static void build_guest_fsinfo_for_virtual_device(char const *syspath,

                                                  GuestFilesystemInfo *fs,

                                                  Error **errp)

{

    DIR *dir;

    char *dirpath;

    struct dirent entry, *result;



    dirpath = g_strdup_printf("%s/slaves", syspath);

    dir = opendir(dirpath);

    if (!dir) {

        error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath);

        g_free(dirpath);

        return;

    }

    g_free(dirpath);



    for (;;) {

        if (readdir_r(dir, &entry, &result) != 0) {

            error_setg_errno(errp, errno, "readdir_r(\"%s\")", dirpath);

            break;

        }

        if (!result) {

            break;

        }



        if (entry.d_type == DT_LNK) {

            g_debug(" slave device '%s'", entry.d_name);

            dirpath = g_strdup_printf("%s/slaves/%s", syspath, entry.d_name);

            build_guest_fsinfo_for_device(dirpath, fs, errp);

            g_free(dirpath);



            if (*errp) {

                break;

            }

        }

    }



    closedir(dir);

}

    struct dirent entry, *result;     g_free(dirpath);         if (readdir_r(dir, &entry, &result) != 0) {             error_setg_errno(errp, errno, "readdir_r(\"%s\")", dirpath);             break;         if (!result) {         if (entry.d_type == DT_LNK) {             g_debug(" slave device '%s'", entry.d_name);             dirpath = g_strdup_printf("%s/slaves/%s", syspath, entry.d_name);             build_guest_fsinfo_for_device(dirpath, fs, errp);             g_free(dirpath);
static void FUNC_0(char const *VAR_0,

                                                  GuestFilesystemInfo *VAR_1,

                                                  Error **VAR_2)

{

    DIR *dir;

    char *VAR_3;

    struct dirent VAR_4, *VAR_5;



    VAR_3 = g_strdup_printf("%s/slaves", VAR_0);

    dir = opendir(VAR_3);

    if (!dir) {

        error_setg_errno(VAR_2, errno, "opendir(\"%s\")", VAR_3);

        g_free(VAR_3);

        return;

    }

    g_free(VAR_3);



    for (;;) {

        if (readdir_r(dir, &VAR_4, &VAR_5) != 0) {

            error_setg_errno(VAR_2, errno, "readdir_r(\"%s\")", VAR_3);

            break;

        }

        if (!VAR_5) {

            break;

        }



        if (VAR_4.d_type == DT_LNK) {

            g_debug(" slave device '%s'", VAR_4.d_name);

            VAR_3 = g_strdup_printf("%s/slaves/%s", VAR_0, VAR_4.d_name);

            build_guest_fsinfo_for_device(VAR_3, VAR_1, VAR_2);

            g_free(VAR_3);



            if (*VAR_2) {

                break;

            }

        }

    }



    closedir(dir);

}

static void FUNC_0(char const *VAR_0,
GuestFilesystemInfo *VAR_1,
Error **VAR_2)
{ DIR *dir; char *VAR_3; struct dirent VAR_4, *VAR_5; VAR_3 = g_strdup_printf("%s/slaves", VAR_0); dir = opendir(VAR_3); if (!dir) { error_setg_errno(VAR_2, errno, "opendir(\"%s\")", VAR_3); g_free(VAR_3); return; } g_free(VAR_3); for (;;) { if (readdir_r(dir, &VAR_4, &VAR_5) != 0) { error_setg_errno(VAR_2, errno, "readdir_r(\"%s\")", VAR_3); break; } if (!VAR_5) { break; } if (VAR_4.d_type == DT_LNK) { g_debug(" slave device '%s'", VAR_4.d_name); VAR_3 = g_strdup_printf("%s/slaves/%s", VAR_0, VAR_4.d_name); build_guest_fsinfo_for_device(VAR_3, VAR_1, VAR_2); g_free(VAR_3); if (*VAR_2) { break; } } } closedir(dir); }