int qemu_fsdev_add(QemuOpts *opts)

{

    int i;

    struct FsDriverListEntry *fsle;

    const char *fsdev_id = qemu_opts_id(opts);

    const char *fsdriver = qemu_opt_get(opts, "fsdriver");

    const char *writeout = qemu_opt_get(opts, "writeout");

    bool ro = qemu_opt_get_bool(opts, "readonly", 0);



    if (!fsdev_id) {

        fprintf(stderr, "fsdev: No id specified\n");

        return -1;

    }



    if (fsdriver) {

        for (i = 0; i < ARRAY_SIZE(FsDrivers); i++) {

            if (strcmp(FsDrivers[i].name, fsdriver) == 0) {

                break;

            }

        }



        if (i == ARRAY_SIZE(FsDrivers)) {

            fprintf(stderr, "fsdev: fsdriver %s not found\n", fsdriver);

            return -1;

        }

    } else {

        fprintf(stderr, "fsdev: No fsdriver specified\n");

        return -1;

    }



    fsle = g_malloc0(sizeof(*fsle));

    fsle->fse.fsdev_id = g_strdup(fsdev_id);

    fsle->fse.ops = FsDrivers[i].ops;

    if (writeout) {

        if (!strcmp(writeout, "immediate")) {

            fsle->fse.export_flags |= V9FS_IMMEDIATE_WRITEOUT;

        }

    }

    if (ro) {

        fsle->fse.export_flags |= V9FS_RDONLY;

    } else {

        fsle->fse.export_flags &= ~V9FS_RDONLY;

    }



    if (fsle->fse.ops->parse_opts) {

        if (fsle->fse.ops->parse_opts(opts, &fsle->fse)) {



            return -1;

        }

    }



    QTAILQ_INSERT_TAIL(&fsdriver_entries, fsle, next);

    return 0;

}
int qemu_fsdev_add(QemuOpts *opts)

{

    int i;

    struct FsDriverListEntry *fsle;

    const char *fsdev_id = qemu_opts_id(opts);

    const char *fsdriver = qemu_opt_get(opts, "fsdriver");

    const char *writeout = qemu_opt_get(opts, "writeout");

    bool ro = qemu_opt_get_bool(opts, "readonly", 0);



    if (!fsdev_id) {

        fprintf(stderr, "fsdev: No id specified\n");

        return -1;

    }



    if (fsdriver) {

        for (i = 0; i < ARRAY_SIZE(FsDrivers); i++) {

            if (strcmp(FsDrivers[i].name, fsdriver) == 0) {

                break;

            }

        }



        if (i == ARRAY_SIZE(FsDrivers)) {

            fprintf(stderr, "fsdev: fsdriver %s not found\n", fsdriver);

            return -1;

        }

    } else {

        fprintf(stderr, "fsdev: No fsdriver specified\n");

        return -1;

    }



    fsle = g_malloc0(sizeof(*fsle));

    fsle->fse.fsdev_id = g_strdup(fsdev_id);

    fsle->fse.ops = FsDrivers[i].ops;

    if (writeout) {

        if (!strcmp(writeout, "immediate")) {

            fsle->fse.export_flags |= V9FS_IMMEDIATE_WRITEOUT;

        }

    }

    if (ro) {

        fsle->fse.export_flags |= V9FS_RDONLY;

    } else {

        fsle->fse.export_flags &= ~V9FS_RDONLY;

    }



    if (fsle->fse.ops->parse_opts) {

        if (fsle->fse.ops->parse_opts(opts, &fsle->fse)) {



            return -1;

        }

    }



    QTAILQ_INSERT_TAIL(&fsdriver_entries, fsle, next);

    return 0;

}
int FUNC_0(QemuOpts *VAR_0)

{

    int VAR_1;

    struct FsDriverListEntry *VAR_2;

    const char *VAR_3 = qemu_opts_id(VAR_0);

    const char *VAR_4 = qemu_opt_get(VAR_0, "VAR_4");

    const char *VAR_5 = qemu_opt_get(VAR_0, "VAR_5");

    bool ro = qemu_opt_get_bool(VAR_0, "readonly", 0);



    if (!VAR_3) {

        fprintf(stderr, "fsdev: No id specified\n");

        return -1;

    }



    if (VAR_4) {

        for (VAR_1 = 0; VAR_1 < ARRAY_SIZE(FsDrivers); VAR_1++) {

            if (strcmp(FsDrivers[VAR_1].name, VAR_4) == 0) {

                break;

            }

        }



        if (VAR_1 == ARRAY_SIZE(FsDrivers)) {

            fprintf(stderr, "fsdev: VAR_4 %s not found\n", VAR_4);

            return -1;

        }

    } else {

        fprintf(stderr, "fsdev: No VAR_4 specified\n");

        return -1;

    }



    VAR_2 = g_malloc0(sizeof(*VAR_2));

    VAR_2->fse.VAR_3 = g_strdup(VAR_3);

    VAR_2->fse.ops = FsDrivers[VAR_1].ops;

    if (VAR_5) {

        if (!strcmp(VAR_5, "immediate")) {

            VAR_2->fse.export_flags |= V9FS_IMMEDIATE_WRITEOUT;

        }

    }

    if (ro) {

        VAR_2->fse.export_flags |= V9FS_RDONLY;

    } else {

        VAR_2->fse.export_flags &= ~V9FS_RDONLY;

    }



    if (VAR_2->fse.ops->parse_opts) {

        if (VAR_2->fse.ops->parse_opts(VAR_0, &VAR_2->fse)) {



            return -1;

        }

    }



    QTAILQ_INSERT_TAIL(&fsdriver_entries, VAR_2, next);

    return 0;

}
int FUNC_0(QemuOpts *VAR_0)
{ int VAR_1; struct FsDriverListEntry *VAR_2; const char *VAR_3 = qemu_opts_id(VAR_0); const char *VAR_4 = qemu_opt_get(VAR_0, "VAR_4"); const char *VAR_5 = qemu_opt_get(VAR_0, "VAR_5"); bool ro = qemu_opt_get_bool(VAR_0, "readonly", 0); if (!VAR_3) { fprintf(stderr, "fsdev: No id specified\n"); return -1; } if (VAR_4) { for (VAR_1 = 0; VAR_1 < ARRAY_SIZE(FsDrivers); VAR_1++) { if (strcmp(FsDrivers[VAR_1].name, VAR_4) == 0) { break; } } if (VAR_1 == ARRAY_SIZE(FsDrivers)) { fprintf(stderr, "fsdev: VAR_4 %s not found\n", VAR_4); return -1; } } else { fprintf(stderr, "fsdev: No VAR_4 specified\n"); return -1; } VAR_2 = g_malloc0(sizeof(*VAR_2)); VAR_2->fse.VAR_3 = g_strdup(VAR_3); VAR_2->fse.ops = FsDrivers[VAR_1].ops; if (VAR_5) { if (!strcmp(VAR_5, "immediate")) { VAR_2->fse.export_flags |= V9FS_IMMEDIATE_WRITEOUT; } } if (ro) { VAR_2->fse.export_flags |= V9FS_RDONLY; } else { VAR_2->fse.export_flags &= ~V9FS_RDONLY; } if (VAR_2->fse.ops->parse_opts) { if (VAR_2->fse.ops->parse_opts(VAR_0, &VAR_2->fse)) { return -1; } } QTAILQ_INSERT_TAIL(&fsdriver_entries, VAR_2, next); return 0; }