Revision 4e3de9e9 vl.c

b/vl.c
701 701
    icount_adjust();
702 702
}
703 703

  
704
static void init_icount_adjust(void)
704
static void configure_icount(const char *option)
705 705
{
706
    if (!option)
707
        return;
708

  
709
    if (strcmp(option, "auto") != 0) {
710
        icount_time_shift = strtol(option, NULL, 0);
711
        use_icount = 1;
712
        return;
713
    }
714

  
715
    use_icount = 2;
716

  
717
    /* 125MIPS seems a reasonable initial guess at the guest speed.
718
       It will be corrected fairly quickly anyway.  */
719
    icount_time_shift = 3;
720

  
706 721
    /* Have both realtime and virtual time triggers for speed adjustment.
707 722
       The realtime trigger catches emulated time passing too slowly,
708 723
       the virtual time trigger catches emulated time passing too fast.
......
4854 4869
    uint32_t boot_devices_bitmap = 0;
4855 4870
    int i;
4856 4871
    int snapshot, linux_boot, net_boot;
4872
    const char *icount_option = NULL;
4857 4873
    const char *initrd_filename;
4858 4874
    const char *kernel_filename, *kernel_cmdline;
4859 4875
    char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM */
......
5618 5634
                    tb_size = 0;
5619 5635
                break;
5620 5636
            case QEMU_OPTION_icount:
5621
                use_icount = 1;
5622
                if (strcmp(optarg, "auto") == 0) {
5623
                    icount_time_shift = -1;
5624
                } else {
5625
                    icount_time_shift = strtol(optarg, NULL, 0);
5626
                }
5637
                icount_option = optarg;
5627 5638
                break;
5628 5639
            case QEMU_OPTION_incoming:
5629 5640
                incoming = optarg;
......
5870 5881
        fprintf(stderr, "could not initialize alarm timer\n");
5871 5882
        exit(1);
5872 5883
    }
5873
    if (use_icount && icount_time_shift < 0) {
5874
        use_icount = 2;
5875
        /* 125MIPS seems a reasonable initial guess at the guest speed.
5876
           It will be corrected fairly quickly anyway.  */
5877
        icount_time_shift = 3;
5878
        init_icount_adjust();
5879
    }
5884
    configure_icount(icount_option);
5880 5885

  
5881 5886
#ifdef _WIN32
5882 5887
    socket_init();

Also available in: Unified diff