Revision a803cb8e
b/hw/device-hotplug.c | ||
---|---|---|
38 | 38 |
if (!opts) |
39 | 39 |
return NULL; |
40 | 40 |
|
41 |
dinfo = drive_init(opts, current_machine, &fatal_error); |
|
41 |
dinfo = drive_init(opts, current_machine->use_scsi, &fatal_error);
|
|
42 | 42 |
if (!dinfo) { |
43 | 43 |
qemu_opts_del(opts); |
44 | 44 |
return NULL; |
b/hw/usb-msd.c | ||
---|---|---|
584 | 584 |
qemu_opt_set(opts, "if", "none"); |
585 | 585 |
|
586 | 586 |
/* create host drive */ |
587 |
dinfo = drive_init(opts, NULL, &fatal_error);
|
|
587 |
dinfo = drive_init(opts, 0, &fatal_error);
|
|
588 | 588 |
if (!dinfo) { |
589 | 589 |
qemu_opts_del(opts); |
590 | 590 |
return NULL; |
b/sysemu.h | ||
---|---|---|
191 | 191 |
BlockDriverState *qdev_init_bdrv(DeviceState *dev, BlockInterfaceType type); |
192 | 192 |
|
193 | 193 |
extern QemuOpts *drive_add(const char *file, const char *fmt, ...); |
194 |
extern DriveInfo *drive_init(QemuOpts *arg, void *machine, int *fatal_error); |
|
194 |
extern DriveInfo *drive_init(QemuOpts *arg, int default_to_scsi, |
|
195 |
int *fatal_error); |
|
195 | 196 |
|
196 | 197 |
/* device-hotplug */ |
197 | 198 |
|
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