mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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:
parent
911525dba9
commit
577d0a3807
4 changed files with 6 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue