From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtyD8-0002w9-0Y for qemu-devel@nongnu.org; Tue, 02 Jul 2013 06:53:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtyD5-0003IQ-M1 for qemu-devel@nongnu.org; Tue, 02 Jul 2013 06:53:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtyD5-0003IB-D3 for qemu-devel@nongnu.org; Tue, 02 Jul 2013 06:53:23 -0400 Message-ID: <51D2B117.60707@redhat.com> Date: Tue, 02 Jul 2013 12:53:11 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1372338695-411-1-git-send-email-pl@kamp.de> <1372338695-411-12-git-send-email-pl@kamp.de> <20130701143504.GF20182@stefanha-thinkpad.redhat.com> <170A6CCF-17F3-494D-AA4C-1DF2993C7885@kamp.de> <20130702074417.GE6800@stefanha-thinkpad.redhat.com> <0305E297-E470-471C-995D-83BBF00C7BD4@kamp.de> <51D2AF0E.4070503@redhat.com> <3F0A3B75-9CDC-46D4-B0DB-4766CD691591@kamp.de> In-Reply-To: <3F0A3B75-9CDC-46D4-B0DB-4766CD691591@kamp.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2 11/11] iscsi: assert that sectors are aligned to LUN blocksize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, Stefan Hajnoczi , ronniesahlberg@gmail.com, qemu-devel@nongnu.org, Stefan Hajnoczi Il 02/07/2013 12:49, Peter Lieven ha scritto: > > Am 02.07.2013 um 12:44 schrieb Paolo Bonzini : > >> 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. > > This seems the more reasonable for me. Can you check what needs to be done > to get your last version of your old series ready for upstream? > > Is the exposing of a sector size > 512 byte complicated or is this something > that is already possible with IDE, Virtio-BLK, Virtio-SCSI etc.? It is possible with virtio-blk and SCSI with the logical_block_size property of virtio-blk-*, scsi-hd and scsi-disk devices. IIRC libvirt supports it, too. IDE only supports 512e/4KN (in general, not just in QEMU). Paolo > Peter >