mirror of
https://github.com/qemu/qemu.git
synced 2024-11-27 05:43:47 +08:00
block: drive_init(): Simplify interface type setting
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
a8686a9b2b
commit
2d3999fe13
12
blockdev.c
12
blockdev.c
@ -240,14 +240,6 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
|
||||
int ret;
|
||||
|
||||
translation = BIOS_ATA_TRANSLATION_AUTO;
|
||||
|
||||
if (default_to_scsi) {
|
||||
type = IF_SCSI;
|
||||
pstrcpy(devname, sizeof(devname), "scsi");
|
||||
} else {
|
||||
type = IF_IDE;
|
||||
pstrcpy(devname, sizeof(devname), "ide");
|
||||
}
|
||||
media = MEDIA_DISK;
|
||||
|
||||
/* extract parameters */
|
||||
@ -273,7 +265,11 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
|
||||
error_report("unsupported bus type '%s'", buf);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
type = default_to_scsi ? IF_SCSI : IF_IDE;
|
||||
pstrcpy(devname, sizeof(devname), if_name[type]);
|
||||
}
|
||||
|
||||
max_devs = if_max_devs[type];
|
||||
|
||||
if (cyls || heads || secs) {
|
||||
|
Loading…
Reference in New Issue
Block a user