[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/8] block: drive_init(): Simplify interface type se
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 5/8] block: drive_init(): Simplify interface type setting |
Date: |
Wed, 6 Jul 2011 16:21:26 +0200 |
From: Luiz Capitulino <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 7d579d6..470be71 100644
--- a/blockdev.c
+++ b/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) {
--
1.7.6
- [Qemu-devel] [PULL 0/8] Block patches, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 1/8] Documentation: Remove outdated host_device note, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 2/8] qemu-img: Add cache command line option, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 3/8] block/raw-posix: Linux compat-ioctl warning workaround, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 4/8] virtio-blk: Turn drive serial into a qdev property, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 5/8] block: drive_init(): Simplify interface type setting,
Kevin Wolf <=
- [Qemu-devel] [PATCH 6/8] block: drive_init(): Improve CHS setting error message, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 7/8] ide: Ignore reads during PIO in and writes during PIO out, Kevin Wolf, 2011/07/06
- [Qemu-devel] [PATCH 8/8] ide: Initialise buffers with zeros, Kevin Wolf, 2011/07/06
- Re: [Qemu-devel] [PULL 0/8] Block patches, Kevin Wolf, 2011/07/12
- Re: [Qemu-devel] [PULL 0/8] Block patches, Anthony Liguori, 2011/07/12