From 577d0a38070d1d6c4c7fab5c2054380770b1ec6b Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 11 Jul 2012 15:08:38 +0200 Subject: 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 Signed-off-by: Kevin Wolf --- blockdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index 5f8677ef05..3d7501565d 100644 --- a/blockdev.c +++ b/blockdev.c @@ -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); -- cgit v1.2.1