From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bei1E-0004FM-Jp for qemu-devel@nongnu.org; Tue, 30 Aug 2016 08:19:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bei1A-0006r6-Gy for qemu-devel@nongnu.org; Tue, 30 Aug 2016 08:19:56 -0400 References: <1472457138-23386-1-git-send-email-ronyweng@synology.com> <7e0e5c6b-dab7-7b87-2f4d-e07c3b64cef5@redhat.com> <8737lma27c.fsf@dusky.pond.sub.org> From: Paolo Bonzini Message-ID: <96cebc60-089a-df39-583d-1b7f4c22bfa8@redhat.com> Date: Tue, 30 Aug 2016 14:19:47 +0200 MIME-Version: 1.0 In-Reply-To: <8737lma27c.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Chage disk serial length from 20 to 36 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: ronyweng@synology.com, qemu-devel@nongnu.org, qemu-stable@nongnu.org On 30/08/2016 14:08, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 29/08/2016 09:52, ronyweng@synology.com wrote: >>> From: ronyweng >>> >>> Openstack Cinder assigns volume a 36 characters uuid as serial. >>> Qemu will shrinks the uuid to 20 characters, >>> missmatch with original uuid. >>> >>> Signed-off-by: Rony Weng >>> --- >>> hw/scsi/scsi-disk.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c >>> index 836a155..0e1bb68 100644 >>> --- a/hw/scsi/scsi-disk.c >>> +++ b/hw/scsi/scsi-disk.c >>> @@ -599,8 +599,8 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) >>> } >>> >>> l = strlen(s->serial); >>> - if (l > 20) { >>> - l = 20; >>> + if (l > 36) { >>> + l = 36; >>> } >>> >>> DPRINTF("Inquiry EVPD[Serial number] " >>> >> >> Cc: qemu-stable@nongnu.org >> >> Thanks, queued for 2.8 and 2.7.1 >> >> Paolo > > Pointing to the applicable SCSI spec chapter & verse in the commit > message would be nice. As is, 36 looks as arbitrary as 20. There is no limit in the SCSI spec. 20 was copy-pasted from virtio-blk which in turn was copy-pasted from ATA. So 36 is even more arbitrary, but bumping it up too much might cause issues (e.g. who knows there's no off-by-one somewhere if I make it 252, so that 256 is the maximum amount of returned data). Thanks, Paolo