Am 08.11.2013 um 18:52 schrieb ronnie sahlberg <ronniesahlb...@gmail.com>:

> For better support for older versions of libiscsi
> I think it would be good to convert all the
> iscsi_unmap_task/iscsi_writesame*_task/iscsi_*_task   functions with
> calls to the much more genric iscsi_scsi_command_sync().
> 
> iscsi_scsi_command_sync() and iscsi_scsi_command_async() have been
> available since prior to version 1.1 and can be used to send arbitrary
> scsi opcodes to the target.
> 
> 
> iscsi_scsi_command_async() is already used instead of
> iscs_read16/write16_async() since the read16/write16 helpers were
> added to libiscsi at a much later stage and there are examples of its
> use.
> 
> 
> Using iscsi_scsi_command_[a]sync() instead of for example
> iscsi_unmap_task() would mean that you can use the UNMAP opcode
> always, regardless version of libiscsi.
> It would mean that you need to build the CDB directly inside
> block/iscsi.c but that is not hard.
> 
> 
> I.e.  change block/iscsi.c to only use iscsi_scsi_command_[a]sync()
> for all opcodes it wants to send to the target.
> 
> 
> 


Hi Ronnie,

i would prefer to use the helper functions. It makes the code much, much
easier to read.

In general you are talking about the case that we have a totally
outdated libiscsi version, but a absolutely up to date qemu version. 

If someone wants to compile a recent qemu on an old distro, this
is working, but simply not with all features enabled.

We keep basic support for read, write, flush. This works with any
libiscsi version. If someone wants to have support for write_zeroes,
discard or get_block_status he simply must use a recent libiscsi
version.

Peter


> 
> On Wed, Nov 6, 2013 at 1:16 PM, Paolo Bonzini <pbonz...@redhat.com> wrote:
>> Il 06/11/2013 20:38, Peter Lieven ha scritto:
>>> 
>>> Am 06.11.2013 um 14:09 schrieb Paolo Bonzini <pbonz...@redhat.com>:
>>> 
>>>> Il 06/11/2013 14:08, Stefan Hajnoczi ha scritto:
>>>>> Thanks, applied to my block-next tree:
>>>>> https://github.com/stefanha/qemu/commits/block-next
>>>>> 
>>>>> This will go into QEMU 1.8.  Since it's a new feature that touches core
>>>>> block layer code and several block drivers, I can't merge it into
>>>>> 1.7-rc.
>>>> 
>>>> Yay!  With these patches I can properly emulate WRITE SAME in the SCSI
>>>> layer.
>>> 
>>> Yes, you can, but only when write same is used to write zeroes. The other
>>> case is still unhandled or needs emulation.
>> 
>> WRITE SAME with UNMAP is incorrect in the current QEMU code.  Your patch
>> let me fix it so that the payload can be read back with no change, *and*
>> sectors are unmapped when possible.
>> 
>> Paolo
>> 


Reply via email to