static int monitor_parse(const char *devname)

{

    static int index = 0;

    char label[32];



    if (strcmp(devname, "none") == 0)

        return 0;

    if (index == MAX_MONITOR_DEVICES) {

        fprintf(stderr, "qemu: too many monitor devices\n");

        exit(1);

    }

    if (index == 0) {

        snprintf(label, sizeof(label), "monitor");

    } else {

        snprintf(label, sizeof(label), "monitor%d", index);

    }

    monitor_hds[index] = qemu_chr_open(label, devname, NULL);

    if (!monitor_hds[index]) {

        fprintf(stderr, "qemu: could not open monitor device '%s'\n",

                devname);

        return -1;

    }

    index++;

    return 0;

}

static int monitor_parse(const char *devname)

{

    static int index = 0;

    char label[32];



    if (strcmp(devname, "none") == 0)

        return 0;

    if (index == MAX_MONITOR_DEVICES) {

        fprintf(stderr, "qemu: too many monitor devices\n");

        exit(1);

    }

    if (index == 0) {

        snprintf(label, sizeof(label), "monitor");

    } else {

        snprintf(label, sizeof(label), "monitor%d", index);

    }

    monitor_hds[index] = qemu_chr_open(label, devname, NULL);

    if (!monitor_hds[index]) {

        fprintf(stderr, "qemu: could not open monitor device '%s'\n",

                devname);

        return -1;

    }

    index++;

    return 0;

}

static int FUNC_0(const char *VAR_0)

{

    static int VAR_1 = 0;

    char VAR_2[32];



    if (strcmp(VAR_0, "none") == 0)

        return 0;

    if (VAR_1 == MAX_MONITOR_DEVICES) {

        fprintf(stderr, "qemu: too many monitor devices\n");

        exit(1);

    }

    if (VAR_1 == 0) {

        snprintf(VAR_2, sizeof(VAR_2), "monitor");

    } else {

        snprintf(VAR_2, sizeof(VAR_2), "monitor%d", VAR_1);

    }

    monitor_hds[VAR_1] = qemu_chr_open(VAR_2, VAR_0, NULL);

    if (!monitor_hds[VAR_1]) {

        fprintf(stderr, "qemu: could not open monitor device '%s'\n",

                VAR_0);

        return -1;

    }

    VAR_1++;

    return 0;

}

static int FUNC_0(const char *VAR_0)
{ static int VAR_1 = 0; char VAR_2[32]; if (strcmp(VAR_0, "none") == 0)
return 0; if (VAR_1 == MAX_MONITOR_DEVICES) { fprintf(stderr, "qemu: too many monitor devices\n"); exit(1); } if (VAR_1 == 0) { snprintf(VAR_2, sizeof(VAR_2), "monitor"); } else { snprintf(VAR_2, sizeof(VAR_2), "monitor%d", VAR_1); } monitor_hds[VAR_1] = qemu_chr_open(VAR_2, VAR_0, NULL); if (!monitor_hds[VAR_1]) { fprintf(stderr, "qemu: could not open monitor device '%s'\n",
VAR_0); return -1; } VAR_1++; return 0; }