static int mon_init_func(QemuOpts *opts, void *opaque)

{

    CharDriverState *chr;

    const char *chardev;

    const char *mode;

    int flags;



    mode = qemu_opt_get(opts, "mode");

    if (mode == NULL) {

        mode = "readline";

    }

    if (strcmp(mode, "readline") == 0) {

        flags = MONITOR_USE_READLINE;

    } else if (strcmp(mode, "control") == 0) {

        flags = MONITOR_USE_CONTROL;

    } else {

        fprintf(stderr, "unknown monitor mode \"%s\"\n", mode);

        exit(1);

    }



    if (qemu_opt_get_bool(opts, "pretty", 0))

        flags |= MONITOR_USE_PRETTY;



    if (qemu_opt_get_bool(opts, "default", 0))

        flags |= MONITOR_IS_DEFAULT;



    chardev = qemu_opt_get(opts, "chardev");

    chr = qemu_chr_find(chardev);

    if (chr == NULL) {

        fprintf(stderr, "chardev \"%s\" not found\n", chardev);

        exit(1);

    }




    monitor_init(chr, flags);

    return 0;

}
static int mon_init_func(QemuOpts *opts, void *opaque)

{

    CharDriverState *chr;

    const char *chardev;

    const char *mode;

    int flags;



    mode = qemu_opt_get(opts, "mode");

    if (mode == NULL) {

        mode = "readline";

    }

    if (strcmp(mode, "readline") == 0) {

        flags = MONITOR_USE_READLINE;

    } else if (strcmp(mode, "control") == 0) {

        flags = MONITOR_USE_CONTROL;

    } else {

        fprintf(stderr, "unknown monitor mode \"%s\"\n", mode);

        exit(1);

    }



    if (qemu_opt_get_bool(opts, "pretty", 0))

        flags |= MONITOR_USE_PRETTY;



    if (qemu_opt_get_bool(opts, "default", 0))

        flags |= MONITOR_IS_DEFAULT;



    chardev = qemu_opt_get(opts, "chardev");

    chr = qemu_chr_find(chardev);

    if (chr == NULL) {

        fprintf(stderr, "chardev \"%s\" not found\n", chardev);

        exit(1);

    }




    monitor_init(chr, flags);

    return 0;

}
static int FUNC_0(QemuOpts *VAR_0, void *VAR_1)

{

    CharDriverState *chr;

    const char *VAR_2;

    const char *VAR_3;

    int VAR_4;



    VAR_3 = qemu_opt_get(VAR_0, "VAR_3");

    if (VAR_3 == NULL) {

        VAR_3 = "readline";

    }

    if (strcmp(VAR_3, "readline") == 0) {

        VAR_4 = MONITOR_USE_READLINE;

    } else if (strcmp(VAR_3, "control") == 0) {

        VAR_4 = MONITOR_USE_CONTROL;

    } else {

        fprintf(stderr, "unknown monitor VAR_3 \"%s\"\n", VAR_3);

        exit(1);

    }



    if (qemu_opt_get_bool(VAR_0, "pretty", 0))

        VAR_4 |= MONITOR_USE_PRETTY;



    if (qemu_opt_get_bool(VAR_0, "default", 0))

        VAR_4 |= MONITOR_IS_DEFAULT;



    VAR_2 = qemu_opt_get(VAR_0, "VAR_2");

    chr = qemu_chr_find(VAR_2);

    if (chr == NULL) {

        fprintf(stderr, "VAR_2 \"%s\" not found\n", VAR_2);

        exit(1);

    }




    monitor_init(chr, VAR_4);

    return 0;

}
static int FUNC_0(QemuOpts *VAR_0, void *VAR_1)
{ CharDriverState *chr; const char *VAR_2; const char *VAR_3; int VAR_4; VAR_3 = qemu_opt_get(VAR_0, "VAR_3"); if (VAR_3 == NULL) { VAR_3 = "readline"; } if (strcmp(VAR_3, "readline") == 0) { VAR_4 = MONITOR_USE_READLINE; } else if (strcmp(VAR_3, "control") == 0) { VAR_4 = MONITOR_USE_CONTROL; } else { fprintf(stderr, "unknown monitor VAR_3 \"%s\"\n", VAR_3); exit(1); } if (qemu_opt_get_bool(VAR_0, "pretty", 0))
VAR_4 |= MONITOR_USE_PRETTY; if (qemu_opt_get_bool(VAR_0, "default", 0))
VAR_4 |= MONITOR_IS_DEFAULT; VAR_2 = qemu_opt_get(VAR_0, "VAR_2"); chr = qemu_chr_find(VAR_2); if (chr == NULL) { fprintf(stderr, "VAR_2 \"%s\" not found\n", VAR_2); exit(1); } monitor_init(chr, VAR_4); return 0; }