Skip to contentSkip to conversation

Chage disk serial length from 20 to 36

PATCH In review [email protected] 3 participants 6 messages Aug 29, 2016 – Aug 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Chage disk serial length from 20 to 36

From: ronyweng <[email protected]>

Openstack Cinder assigns volume a 36 characters uuid as serial. Qemu will shrinks the uuid to 20 characters, missmatch with original uuid.

---
 hw/scsi/scsi-disk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/scsi/scsi-disk.c +2 -2
index 836a155..0e1bb68 100644
@@ -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] "
Signature · 1 line
1.9.1
#1 lore raw
Quoted 17 lines · On 29/08/2016 09:52, [email protected] wrote:

From: ronyweng <[email protected]>

Openstack Cinder assigns volume a 36 characters uuid as serial. Qemu will shrinks the uuid to 20 characters, missmatch with original uuid.

---
 hw/scsi/scsi-disk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/scsi/scsi-disk.c +0 -0
index 836a155..0e1bb68 100644

hw/scsi/scsi-disk.c static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) · line 606

Quoted 10 lines
hw/scsi/scsi-disk.c +2 -2
@@ -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] "

Thanks, queued for 2.8 and 2.7.1

Paolo

#2 lore raw
Quoted 26 lines · Paolo Bonzini
Quoted 25 lines · On 29/08/2016 09:52, [email protected] wrote:

From: ronyweng <[email protected]>

Openstack Cinder assigns volume a 36 characters uuid as serial. Qemu will shrinks the uuid to 20 characters, missmatch with original uuid.

---
 hw/scsi/scsi-disk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/scsi/scsi-disk.c +2 -2
index 836a155..0e1bb68 100644
@@ -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;
             }
 
Quoted 8 lines

hw/scsi/scsi-disk.c static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) · line 606

Quoted 2 lines
hw/scsi/scsi-disk.c +0 -0
             DPRINTF("Inquiry EVPD[Serial number] "

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.

#3 lore raw
Quoted 33 lines · Markus Armbruster
Quoted 31 lines · Paolo Bonzini
Quoted 17 lines · On 29/08/2016 09:52, [email protected] wrote:

From: ronyweng <[email protected]>

Openstack Cinder assigns volume a 36 characters uuid as serial. Qemu will shrinks the uuid to 20 characters, missmatch with original uuid.

---
 hw/scsi/scsi-disk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/scsi/scsi-disk.c +0 -0
index 836a155..0e1bb68 100644

hw/scsi/scsi-disk.c static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) · line 606

Quoted 10 lines
hw/scsi/scsi-disk.c +2 -2
@@ -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] "
Quoted 6 lines
Quoted 3 lines

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

#4 lore raw
Quoted 38 lines · Paolo Bonzini
Quoted 37 lines · Markus Armbruster
Quoted 34 lines · Paolo Bonzini
Quoted 17 lines · On 29/08/2016 09:52, [email protected] wrote:

From: ronyweng <[email protected]>

Openstack Cinder assigns volume a 36 characters uuid as serial. Qemu will shrinks the uuid to 20 characters, missmatch with original uuid.

---
 hw/scsi/scsi-disk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/scsi/scsi-disk.c +0 -0
index 836a155..0e1bb68 100644

hw/scsi/scsi-disk.c static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf) · line 606

Quoted 10 lines
hw/scsi/scsi-disk.c +2 -2
@@ -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] "

Thanks, queued for 2.8 and 2.7.1

Paolo

Quoted 8 lines
Quoted 2 lines

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).

This paragraph would make a nice addition to the commit message :)

#5 lore raw
Quoted 6 lines · Markus Armbruster
Quoted 5 lines
Quoted 5 lines

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).

This paragraph would make a nice addition to the commit message :)

Will do!

Paolo