int select_watchdog(const char *p)

{

    WatchdogTimerModel *model;

    QemuOpts *opts;



    /* -watchdog ? lists available devices and exits cleanly. */

    if (strcmp(p, "?") == 0) {

        LIST_FOREACH(model, &watchdog_list, entry) {

            fprintf(stderr, "\t%s\t%s\n",

                     model->wdt_name, model->wdt_description);

        }

        return 2;

    }



    LIST_FOREACH(model, &watchdog_list, entry) {

        if (strcasecmp(model->wdt_name, p) == 0) {

            /* add the device */

            opts = qemu_opts_create(&qemu_device_opts, NULL, 0);

            qemu_opt_set(opts, "driver", p);

            return 0;

        }

    }



    fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n");

    LIST_FOREACH(model, &watchdog_list, entry) {

        fprintf(stderr, "\t%s\t%s\n",

                 model->wdt_name, model->wdt_description);

    }

    return 1;

}

int select_watchdog(const char *p)

{

    WatchdogTimerModel *model;

    QemuOpts *opts;



    

    if (strcmp(p, "?") == 0) {

        LIST_FOREACH(model, &watchdog_list, entry) {

            fprintf(stderr, "\t%s\t%s\n",

                     model->wdt_name, model->wdt_description);

        }

        return 2;

    }



    LIST_FOREACH(model, &watchdog_list, entry) {

        if (strcasecmp(model->wdt_name, p) == 0) {

            

            opts = qemu_opts_create(&qemu_device_opts, NULL, 0);

            qemu_opt_set(opts, "driver", p);

            return 0;

        }

    }



    fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n");

    LIST_FOREACH(model, &watchdog_list, entry) {

        fprintf(stderr, "\t%s\t%s\n",

                 model->wdt_name, model->wdt_description);

    }

    return 1;

}

int FUNC_0(const char *VAR_0)

{

    WatchdogTimerModel *model;

    QemuOpts *opts;



    

    if (strcmp(VAR_0, "?") == 0) {

        LIST_FOREACH(model, &watchdog_list, entry) {

            fprintf(stderr, "\t%s\t%s\n",

                     model->wdt_name, model->wdt_description);

        }

        return 2;

    }



    LIST_FOREACH(model, &watchdog_list, entry) {

        if (strcasecmp(model->wdt_name, VAR_0) == 0) {

            

            opts = qemu_opts_create(&qemu_device_opts, NULL, 0);

            qemu_opt_set(opts, "driver", VAR_0);

            return 0;

        }

    }



    fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n");

    LIST_FOREACH(model, &watchdog_list, entry) {

        fprintf(stderr, "\t%s\t%s\n",

                 model->wdt_name, model->wdt_description);

    }

    return 1;

}

int FUNC_0(const char *VAR_0)
{ WatchdogTimerModel *model; QemuOpts *opts; if (strcmp(VAR_0, "?") == 0) { LIST_FOREACH(model, &watchdog_list, entry) { fprintf(stderr, "\t%s\t%s\n",
model->wdt_name, model->wdt_description); } return 2; } LIST_FOREACH(model, &watchdog_list, entry) { if (strcasecmp(model->wdt_name, VAR_0) == 0) { opts = qemu_opts_create(&qemu_device_opts, NULL, 0); qemu_opt_set(opts, "driver", VAR_0); return 0; } } fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n"); LIST_FOREACH(model, &watchdog_list, entry) { fprintf(stderr, "\t%s\t%s\n",
model->wdt_name, model->wdt_description); } return 1; }