Revision 46d4767d vl.c

b/vl.c
2537 2537
           "-s              wait gdb connection to port %d\n"
2538 2538
           "-p port         change gdb connection port\n"
2539 2539
           "-d item1,...    output log to %s (use -d ? for a list of log items)\n"
2540
           "-hdachs c,h,s   force hard disk 0 geometry (usually qemu can guess it)\n"
2540
           "-hdachs c,h,s[,t]  force hard disk 0 physical geometry and the optional BIOS\n"
2541
           "                translation (t=none or lba) (usually qemu can guess them)\n"
2541 2542
           "-L path         set the directory for the BIOS and VGA BIOS\n"
2542 2543
#ifdef USE_CODE_COPY
2543 2544
           "-no-code-copy   disable code copy acceleration\n"
......
2753 2754
    const char *hd_filename[MAX_DISKS], *fd_filename[MAX_FD];
2754 2755
    const char *kernel_filename, *kernel_cmdline;
2755 2756
    DisplayState *ds = &display_state;
2756
    int cyls, heads, secs;
2757
    int cyls, heads, secs, translation;
2757 2758
    int start_emulation = 1;
2758 2759
    uint8_t macaddr[6];
2759 2760
    int net_if_type, nb_tun_fds, tun_fds[MAX_NICS];
......
2788 2789
    kernel_cmdline = "";
2789 2790
    has_cdrom = 1;
2790 2791
    cyls = heads = secs = 0;
2792
    translation = BIOS_ATA_TRANSLATION_AUTO;
2791 2793
    pstrcpy(monitor_device, sizeof(monitor_device), "vc");
2792 2794

  
2793 2795
    pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "vc");
......
2857 2859
                    const char *p;
2858 2860
                    p = optarg;
2859 2861
                    cyls = strtol(p, (char **)&p, 0);
2862
                    if (cyls < 1 || cyls > 16383)
2863
                        goto chs_fail;
2860 2864
                    if (*p != ',')
2861 2865
                        goto chs_fail;
2862 2866
                    p++;
2863 2867
                    heads = strtol(p, (char **)&p, 0);
2868
                    if (heads < 1 || heads > 16)
2869
                        goto chs_fail;
2864 2870
                    if (*p != ',')
2865 2871
                        goto chs_fail;
2866 2872
                    p++;
2867 2873
                    secs = strtol(p, (char **)&p, 0);
2868
                    if (*p != '\0') {
2874
                    if (secs < 1 || secs > 63)
2875
                        goto chs_fail;
2876
                    if (*p == ',') {
2877
                        p++;
2878
                        if (!strcmp(p, "none"))
2879
                            translation = BIOS_ATA_TRANSLATION_NONE;
2880
                        else if (!strcmp(p, "lba"))
2881
                            translation = BIOS_ATA_TRANSLATION_LBA;
2882
                        else if (!strcmp(p, "auto"))
2883
                            translation = BIOS_ATA_TRANSLATION_AUTO;
2884
                        else
2885
                            goto chs_fail;
2886
                    } else if (*p != '\0') {
2869 2887
                    chs_fail:
2870
                        cyls = 0;
2888
                        fprintf(stderr, "qemu: invalid physical CHS format\n");
2889
                        exit(1);
2871 2890
                    }
2872 2891
                }
2873 2892
                break;
......
3230 3249
                        hd_filename[i]);
3231 3250
                exit(1);
3232 3251
            }
3233
            if (i == 0 && cyls != 0) 
3252
            if (i == 0 && cyls != 0) {
3234 3253
                bdrv_set_geometry_hint(bs_table[i], cyls, heads, secs);
3254
                bdrv_set_translation_hint(bs_table[i], translation);
3255
            }
3235 3256
        }
3236 3257
    }
3237 3258

  

Also available in: Unified diff