On Fri, 04/24 13:07, Paolo Bonzini wrote:
>
>
> On 24/04/2015 12:53, Fam Zheng wrote:
> > + const uint8_t write_same_cdb[] = { 0x41, 0x00, 0x00, 0x00,
> > + 0x00, 0x01, 0x02 };
>
> The array size should be CDB_SIZE and there's 3 missing bytes in the
> 10-byte WRITE SAME CDB.
>
> byte 0: WRITE SAME opcode
> byte 1: all zeros, ok
> byte 2...5: LBA = 1, ok
> byte 6: GROUP NUMBER = 2?
>
> Did you mean 0x00, 0x00, 0x02, 0x00?
>
> It probably works because scsi-disk ignores bytes 6 and 9, and bytes 7-8
> are some nonzero value from the stack, but it would break when changing
> the array size to CDB_SIZE.
You're right!
Fam
>
> Otherwise looks good.
>
> Thanks for writing the tests!
>
> Paolo
>