Revision fd930791

b/hw/scsi-disk.c
471 471

  
472 472
        case 0x83: /* Device identification page, mandatory */
473 473
        {
474
            int max_len = 255 - 8;
475
            int id_len = strlen(bdrv_get_device_name(s->qdev.conf.bs));
474
            const char *str = s->serial ?: bdrv_get_device_name(s->qdev.conf.bs);
475
            int max_len = s->serial ? 20 : 255 - 8;
476
            int id_len = strlen(str);
476 477

  
477 478
            if (id_len > max_len) {
478 479
                id_len = max_len;
......
486 487
            outbuf[buflen++] = 0;   // reserved
487 488
            outbuf[buflen++] = id_len; // length of data following
488 489

  
489
            memcpy(outbuf+buflen, bdrv_get_device_name(s->qdev.conf.bs), id_len);
490
            memcpy(outbuf+buflen, str, id_len);
490 491
            buflen += id_len;
491 492
            break;
492 493
        }

Also available in: Unified diff