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>
This commit is contained in:
Markus Armbruster 2012-07-11 15:08:38 +02:00 committed by Kevin Wolf
parent 911525dba9
commit 577d0a3807
4 changed files with 6 additions and 10 deletions

View file

@ -536,9 +536,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
dinfo->trans = translation;
dinfo->opts = opts;
dinfo->refcount = 1;
if (serial) {
pstrcpy(dinfo->serial, sizeof(dinfo->serial), serial);
}
dinfo->serial = serial;
QTAILQ_INSERT_TAIL(&drives, dinfo, next);
bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error);