diff options
| author | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-18 10:34:59 -0500 |
|---|---|---|
| committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-18 10:34:59 -0500 |
| commit | 0b0cb9d310edfe2b2d108f18be4f013a1e552cfd (patch) | |
| tree | 895e26169ccbcbeb7e7c40eaecb353dadd7afb21 /blockdev.c | |
| parent | df6606f4556a752d30a4eab26c626b6c34717ea8 (diff) | |
| parent | d551cd50a43b9998c7aa562db7c567f557fb58fd (diff) | |
| download | focaccia-qemu-0b0cb9d310edfe2b2d108f18be4f013a1e552cfd.tar.gz focaccia-qemu-0b0cb9d310edfe2b2d108f18be4f013a1e552cfd.zip | |
Merge remote-tracking branch 'kwolf/for-anthony' into staging
* kwolf/for-anthony: (39 commits) qemu-iotests: add 036 autoclear feature bit test qemu-iotests: add qcow2.py set-feature-bit command fdc-test: introduced qtest read_without_media fdc: fix implied seek while there is no media in drive qcow2: fix autoclear image header update xen: Don't peek behind the BlockDriverState abstraction xen: Don't change -drive if=xen device name during machine init block: Replace bdrv_get_format() by bdrv_get_format_name() qemu-img: document qed format on qemu-img man page qemu-iotests: COW with many AIO requests on the same cluster qemu-iotests: Some backing file COW tests qcow2: Fix avail_sectors in cluster allocation code qcow2: Simplify calculation for COW area at the end qcow2: always operate caches in writeback mode ide: support enable/disable write cache block: always open drivers in writeback mode block: add bdrv_set_enable_write_cache block: copy enable_write_cache in bdrv_append savevm: flush after saving vm state block: flush in writethrough mode after writes ...
Diffstat (limited to 'blockdev.c')
| -rw-r--r-- | blockdev.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/blockdev.c b/blockdev.c index 622ecba04e..9e0a72a269 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; |