Revision dcfb0939 vl.c

b/vl.c
2653 2653
    }
2654 2654

  
2655 2655
    if (defconfig) {
2656
        const char *fname;
2657
        FILE *fp;
2656
        int ret;
2658 2657

  
2659
        fname = CONFIG_QEMU_CONFDIR "/qemu.conf";
2660
        fp = fopen(fname, "r");
2661
        if (fp) {
2662
            if (qemu_config_parse(fp, fname) != 0) {
2663
                exit(1);
2664
            }
2665
            fclose(fp);
2658
        ret = qemu_read_config_file(CONFIG_QEMU_CONFDIR "/qemu.conf");
2659
        if (ret == -EINVAL) {
2660
            exit(1);
2666 2661
        }
2667 2662

  
2668
        fname = arch_config_name;
2669
        fp = fopen(fname, "r");
2670
        if (fp) {
2671
            if (qemu_config_parse(fp, fname) != 0) {
2672
                exit(1);
2673
            }
2674
            fclose(fp);
2663
        ret = qemu_read_config_file(arch_config_name);
2664
        if (ret == -EINVAL) {
2665
            exit(1);
2675 2666
        }
2676 2667
    }
2677 2668
    cpudef_init();
......
3327 3318
                break;
3328 3319
            case QEMU_OPTION_readconfig:
3329 3320
                {
3330
                    FILE *fp;
3331
                    fp = fopen(optarg, "r");
3332
                    if (fp == NULL) {
3333
                        fprintf(stderr, "open %s: %s\n", optarg, strerror(errno));
3321
                    int ret = qemu_read_config_file(optarg);
3322
                    if (ret < 0) {
3323
                        fprintf(stderr, "read config %s: %s\n", optarg,
3324
                            strerror(-ret));
3334 3325
                        exit(1);
3335 3326
                    }
3336
                    if (qemu_config_parse(fp, optarg) != 0) {
3337
                        exit(1);
3338
                    }
3339
                    fclose(fp);
3340 3327
                    break;
3341 3328
                }
3342 3329
            case QEMU_OPTION_writeconfig:

Also available in: Unified diff