From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] block: drive_init(): Simplify interface type setting
Date: Fri, 1 Jul 2011 10:46:12 -0300 [thread overview]
Message-ID: <1309527973-11127-2-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1309527973-11127-1-git-send-email-lcapitulino@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
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.49.g033c2
next prev parent reply other threads:[~2011-07-01 13:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-01 13:46 [Qemu-devel] [PATCH v2 0/2]: block: Small drive_init() improvements Luiz Capitulino
2011-07-01 13:46 ` Luiz Capitulino [this message]
2011-07-01 13:46 ` [Qemu-devel] [PATCH 2/2] block: drive_init(): Improve CHS setting error message Luiz Capitulino
2011-07-04 11:41 ` [Qemu-devel] [PATCH v2 0/2]: block: Small drive_init() improvements Markus Armbruster
2011-07-04 12:34 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309527973-11127-2-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).