[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/39] block: Simplify how drive_init() computes def
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 14/39] block: Simplify how drive_init() computes default ID |
Date: |
Fri, 15 Jun 2012 15:33:14 +0200 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 622ecba..9e0a72a 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -278,7 +278,6 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
{
const char *buf;
const char *file = NULL;
- char devname[128];
const char *serial;
const char *mediastr = "";
BlockInterfaceType type;
@@ -318,7 +317,6 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
serial = qemu_opt_get(opts, "serial");
if ((buf = qemu_opt_get(opts, "if")) != NULL) {
- pstrcpy(devname, sizeof(devname), buf);
for (type = 0; type < IF_COUNT && strcmp(buf, if_name[type]); type++)
;
if (type == IF_COUNT) {
@@ -327,7 +325,6 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
}
} else {
type = default_to_scsi ? IF_SCSI : IF_IDE;
- pstrcpy(devname, sizeof(devname), if_name[type]);
}
max_devs = if_max_devs[type];
@@ -523,10 +520,10 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd";
if (max_devs)
snprintf(dinfo->id, 32, "%s%i%s%i",
- devname, bus_id, mediastr, unit_id);
+ if_name[type], bus_id, mediastr, unit_id);
else
snprintf(dinfo->id, 32, "%s%s%i",
- devname, mediastr, unit_id);
+ if_name[type], mediastr, unit_id);
}
dinfo->bdrv = bdrv_new(dinfo->id);
dinfo->devaddr = devaddr;
--
1.7.6.5
- [Qemu-devel] [PATCH 08/39] Un-inline fdctrl_init_isa(), (continued)
- [Qemu-devel] [PATCH 08/39] Un-inline fdctrl_init_isa(), Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 05/39] stream: move is_allocated_above to block.c, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 09/39] qemu-img check -r for repairing images, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 06/39] stream: move rate limiting to a separate header file, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 01/39] qcow2: remove a line of unnecessary code, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 07/39] xtensa_lx60: add missing #include "blockdev.h", Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 04/39] stream: tweak usage of bdrv_co_is_allocated, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 12/39] rbd: hook up cache options, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 11/39] qcow2: Support for fixing refcount inconsistencies, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 13/39] sheepdog: add coroutine_fn markers to coroutine functions, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 14/39] block: Simplify how drive_init() computes default ID,
Kevin Wolf <=
- [Qemu-devel] [PATCH 17/39] scsi-disk: Don't peek behind the BlockDriverState abstraction, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 10/39] qemu-img check: Print fixed clusters and recheck, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 16/39] block: New bdrv_get_flags(), Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 15/39] Prevent disk data loss when closing qemu, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 21/39] savevm: flush after saving vm state, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 18/39] qemu-iotests: fill streaming test image with data, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 22/39] block: copy enable_write_cache in bdrv_append, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 23/39] block: add bdrv_set_enable_write_cache, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 19/39] qemu-iotests: start vms in qtest mode, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 25/39] ide: support enable/disable write cache, Kevin Wolf, 2012/06/15