Revision a803cb8e vl.c

b/vl.c
767 767
    }
768 768
}
769 769

  
770
DriveInfo *drive_init(QemuOpts *opts, void *opaque,
771
                      int *fatal_error)
770
DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
772 771
{
773 772
    const char *buf;
774 773
    const char *file = NULL;
......
780 779
    int bus_id, unit_id;
781 780
    int cyls, heads, secs, translation;
782 781
    BlockDriver *drv = NULL;
783
    QEMUMachine *machine = opaque;
784 782
    int max_devs;
785 783
    int index;
786 784
    int ro = 0;
......
795 793

  
796 794
    translation = BIOS_ATA_TRANSLATION_AUTO;
797 795

  
798
    if (machine && machine->use_scsi) {
796
    if (default_to_scsi) {
799 797
        type = IF_SCSI;
800 798
        max_devs = MAX_SCSI_DEVS;
801 799
        pstrcpy(devname, sizeof(devname), "scsi");
......
1135 1133

  
1136 1134
static int drive_init_func(QemuOpts *opts, void *opaque)
1137 1135
{
1138
    QEMUMachine *machine = opaque;
1136
    int *use_scsi = opaque;
1139 1137
    int fatal_error = 0;
1140 1138

  
1141
    if (drive_init(opts, machine, &fatal_error) == NULL) {
1139
    if (drive_init(opts, *use_scsi, &fatal_error) == NULL) {
1142 1140
        if (fatal_error)
1143 1141
            return 1;
1144 1142
    }
......
3641 3639
    /* open the virtual block devices */
3642 3640
    if (snapshot)
3643 3641
        qemu_opts_foreach(&qemu_drive_opts, drive_enable_snapshot, NULL, 0);
3644
    if (qemu_opts_foreach(&qemu_drive_opts, drive_init_func, machine, 1) != 0)
3642
    if (qemu_opts_foreach(&qemu_drive_opts, drive_init_func, &machine->use_scsi, 1) != 0)
3645 3643
        exit(1);
3646 3644

  
3647 3645
    register_savevm_live("ram", 0, 3, NULL, ram_save_live, NULL, 

Also available in: Unified diff