[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] block: drive_init(): Simplify interface type se
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 2/3] block: drive_init(): Simplify interface type setting |
Date: |
Thu, 30 Jun 2011 15:33:02 -0300 |
Signed-off-by: Luiz Capitulino <address@hidden>
---
blockdev.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 27bf68a..0a90ae8 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -241,13 +241,6 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
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 +266,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) {
--
1.7.6.49.g033c2