qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv2 11/11] iscsi: assert that sectors are aligned


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCHv2 11/11] iscsi: assert that sectors are aligned to LUN blocksize
Date: Tue, 02 Jul 2013 12:44:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

Il 02/07/2013 10:28, Peter Lieven ha scritto:
>> I agree that it's better to emit an error than to corrupt the disk.  I'm
>> just trying to understand what needs to be done on top of this to make 4
>> KB LUNs work.
> 
> Reading is quite easy, you just have to have a wrapper that is reading an 
> aligned
> portion of sectors around the original request and then extracting what was 
> requested.
> Writing is very complicated. Requests have to be serialized, 
> Read-Modify-Write for
> unaligned write requests. Paolo had all this prepared already.
> 
> I wonder if it would be enough to have the block size of the host/iSCSI 
> device propagated
> to the guest drivers and read 4K (or the protocol block size bytes) when 
> probing the MBR.

No, propagating the size of the device is only correct if we're doing
SCSI passthrough (-device scsi-block) and in that case we're doing it
already.

For emulation, the choices are:

1) manually set the logical_block_size of the disk to 4096 (which means
the disk cannot be used as a boot disk, at least with BIOS; I don't know
about UEFI);

2) do 512e/4KN as in my patches.  You would still need to expose a 4K
physical_sector_size to be precise, but it is just an optimization.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]