aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-07-11 15:08:38 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-17 16:48:32 +0200
commit577d0a38070d1d6c4c7fab5c2054380770b1ec6b (patch)
tree7769c027534444446c62113c40f2392b8e79e111 /hw
parent911525dba9ecc21f97b05c0f09bf9319a9de3a7d (diff)
blockdev: Don't limit DriveInfo serial to 20 characters
All current users (IDE, SCSI and virtio-blk) happen to share this 20 characters limit. Still, it should be left to device models. They already enforce their limits. They have to, as the DriveInfo limit only affects legacy -drive serial=..., not the qdev properties. usb-storage, which doesn't limit serial number length, also uses DriveInfo for -usbdevice. But that doesn't provide access to DriveInfo serial. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block-common.c2
-rw-r--r--hw/ide/core.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/hw/block-common.c b/hw/block-common.c
index 036334b1ec..0a0542a650 100644
--- a/hw/block-common.c
+++ b/hw/block-common.c
@@ -17,7 +17,7 @@ void blkconf_serial(BlockConf *conf, char **serial)
if (!*serial) {
/* try to fall back to value set with legacy -drive serial=... */
dinfo = drive_get_by_blockdev(conf->bs);
- if (*dinfo->serial) {
+ if (dinfo->serial) {
*serial = g_strdup(dinfo->serial);
}
}
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 58a454fde5..5378fc39fe 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2095,9 +2095,9 @@ void ide_init2_with_non_qdev_drives(IDEBus *bus, DriveInfo *hd0,
trans = hd_bios_chs_auto_trans(cyls, heads, secs);
}
if (ide_init_drive(&bus->ifs[i], dinfo->bdrv,
- dinfo->media_cd ? IDE_CD : IDE_HD, NULL,
- *dinfo->serial ? dinfo->serial : NULL,
- NULL, 0, cyls, heads, secs, trans) < 0) {
+ dinfo->media_cd ? IDE_CD : IDE_HD,
+ NULL, dinfo->serial, NULL, 0,
+ cyls, heads, secs, trans) < 0) {
error_report("Can't set up IDE drive %s", dinfo->id);
exit(1);
}