Statistics
| Branch: | Revision:

root / block / iscsi.c @ feature-archipelago

History | View | Annotate | Download (42.6 kB)

# Date Author Comment
d9738fd2 02/22/2014 04:59 pm Peter Lieven

block/iscsi: fix segfault if writesame fails

commit fa6252b0 introduced a segfault because it tries
to read iTask.task->sense after iTask.task has been
freed.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>

837c3901 02/22/2014 11:02 am Peter Lieven

block/iscsi: fix deadlock on scsi check condition

the retry logic was broken because the complete status
of the task structure was not reset. this resulted in
an infinite loop retrying the command over and over.

CC:
Signed-off-by: Peter Lieven <>...

24d3bd67 02/22/2014 11:02 am Peter Lieven

block/iscsi: query for supported VPD pages

this patch ensures that we only query for block provisioning and
block limits vpd pages if they are advertised. It also cleans
up the inquiry code and eliminates some redundant code.

Signed-off-by: Peter Lieven <>...

35cb1748 02/21/2014 10:02 pm Paolo Bonzini

iscsi: fix indentation

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

f2917853 02/21/2014 10:02 pm Paolo Bonzini

iscsi: correctly propagate errors in iscsi_open

Before:
$ ./qemu-io-old
qemu-io-old> open -r -o file.driver=iscsi,file.filename=foo
Failed to parse URL : foo
qemu-io-old: can't open device (null): Could not open 'foo': Invalid argument

After:...

4c0c9bbe 02/20/2014 02:10 pm Peter Maydell

Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging

  • remotes/qmp-unstable/queue/qmp:
    monitor: Add object_add class argument completion.
    monitor: Add object_del id argument completion.
    monitor: Add device_add device argument completion....
84d18f06 02/17/2014 06:57 pm Markus Armbruster

Use error_is_set() only when necessary

error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out. Unnecessarily hard for
optimizers, static checkers, and human readers. Dumb it down to
obvious.

Gets rid of several dozen Coverity false positives....

28f106af 02/14/2014 02:38 pm Jeff Cody

block: Add notes to iSCSI's .bdrv_open and .bdrv_reopen_prepare

iSCSI currently does not need to do any actions to support the
current usage of bdrv_reopen(). However, it is important to note
a couple of things: 1.) A connection will not be re-established to...

5d259fc7 02/09/2014 10:12 am Peter Lieven

block/iscsi: always fill bs->bl.opt_transfer_length

the opt_transfer_length has nothing to do with logical
block provisioning stuff so always copy it from
the block limits VPD page.

Reported-By: Benoit Canet <>
Signed-off-by: Peter Lieven <>...

e9f526ab 01/25/2014 01:50 am Anthony Liguori

Merge remote-tracking branch 'bonzini/scsi-next' into staging

  • bonzini/scsi-next:
    scsi: Support TEST UNIT READY in the dummy LUN0
    block: add .bdrv_reopen_prepare() stub for iscsi
    virtio-scsi: Prevent assertion on missed events
    virtio-scsi: Cleanup of I/Os that never started...
2c9880c4 01/24/2014 06:40 pm Paolo Bonzini

iscsi: Set bs->request_alignment

The iSCSI backend already gets the block size from the READ CAPACITY
command it sends. Save it so that the generic block layer gets it
too.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>...

d34682cd 01/24/2014 06:40 pm Kevin Wolf

block: Move initialisation of BlockLimits to bdrv_refresh_limits()

This function separates filling the BlockLimits from bdrv_open(), which
allows it to call it from other operations which may change the limits
(e.g. modifications to the backing file chain or bdrv_reopen)...

92397116 01/22/2014 01:07 pm Peter Lieven

block/iscsi: return -ENOMEM if an async call fails immediately

if an async libiscsi call fails directly it can only be due
to an out of memory condition. All other errors are returned
through the callback.

Signed-off-by: Peter Lieven <>
Reviewed-by: Ronnie Sahlberg <>...

dc6afb99 01/15/2014 11:44 am Jeff Cody

block: add .bdrv_reopen_prepare() stub for iscsi

To suppport reopen(), the .bdrv_reopen_prepare() stub must exist.
iSCSI does not have anything that needs to be done to support reopen,
so we can just implement the _prepare() stub.

Signed-off-by: Jeff Cody <>...

133fe774 01/14/2014 04:10 am Edgar E. Iglesias

Merge remote branch 'luiz/queue/qmp' into qmpq

  • luiz/queue/qmp:
    migration: qmp_migrate(): keep working after syntax error
    qerror: Remove assert_no_error()
    qemu-option: Remove qemu_opts_create_nofail
    target-i386: Remove assert_no_error usage
    hw: Remove assert_no_error usages...
eedc1a5d 01/10/2014 09:05 pm Anthony Liguori

Merge remote-tracking branch 'bonzini/scsi-next' into staging

  • bonzini/scsi-next:
    scsi-disk: add UNMAP limits to block limits VPD page
    block/iscsi: use a bh to schedule co reentrance

Message-id: ...

87ea75d5 01/06/2014 10:02 pm Peter Crosthwaite

qemu-option: Remove qemu_opts_create_nofail

This is a boiler-plate _nofail variant of qemu_opts_create. Remove and
use error_abort in call sites.

null/0 arguments needs to be added for the id and fail_if_exists fields
in affected callsites due to argument inconsistency between the normal and...

219c2521 12/20/2013 10:11 am Stefan Weil

block/iscsi: Fix compilation for libiscsi 1.4.0 (API change)

Function iscsi_read10_task got additional parameters starting with version
libiscsi 1.5.0.

libiscsi 1.4.0 is still widely used (Debian wheezy, jessie and other Linux
distributions currently provide packages for QEMU which use it), so we...

8b9dfe90 12/16/2013 12:25 pm Peter Lieven

block/iscsi: use a bh to schedule co reentrance

this fixes a potential segfault and performance regression.

If the coroutine is reentered directly in the iscsi_co_generic_cb
iscsi_process_{read,write} are interrupted and reentered any
time later. One the one hand this could happen after an iscsi_close...

063c3378 12/09/2013 12:28 pm Peter Lieven

block/iscsi: introduce bdrv_co_{readv, writev, flush_to_disk}

this converts read, write and flush functions from aio to coroutines
eliminating almost 200 lines of code.

The requirement for libiscsi is bumped to version 1.4.0 which was
released in may 2012....

1c0704a5 12/05/2013 12:45 pm Peter Lieven

block/iscsi: set bdi->cluster_size

this patch aims to set bdi->cluster_size to the internal page size
of the iscsi target so that enabled callers can align requests
properly.

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Peter Lieven <>...

7572ddc8 12/05/2013 12:45 pm Peter Lieven

block/iscsi: set bs->bl.opt_transfer_length

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

4b52498e 12/03/2013 04:26 pm Peter Lieven

block/iscsi: remove .bdrv_has_zero_init

since commit 3ac21627 the default value changed to 0.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

2af8a1a7 12/03/2013 04:26 pm Peter Lieven

block/iscsi: updated copyright

added myself to reflect recent work on the iscsi block driver.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

fa6252b0 12/03/2013 04:26 pm Paolo Bonzini

block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP

The current check is right for MAY_UNMAP=1. For MAY_UNMAP=0, just
try and fall back to regular writes as soon as a WRITE SAME command
fails.

Signed-off-by: Paolo Bonzini <>...

ba6c5919 11/28/2013 11:30 am Peter Lieven

iscsi: set limits in BlockDriverState

Reviewed-by: Eric Blake <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

01a6a238 11/28/2013 11:30 am Peter Lieven

iscsi: simplify iscsi_co_discard

now that bdrv_co_discard can handle limits we do not need
the request split logic here anymore.

Reviewed-by: Eric Blake <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

d4cd9615 11/28/2013 11:30 am Peter Lieven

iscsi: add bdrv_co_write_zeroes

Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

186d4f2b 11/28/2013 11:30 am Peter Lieven

block/iscsi: add .bdrv_get_info

Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

73f395fa 10/26/2013 12:01 pm Stefan Weil

misc: New spelling fixes in comments

compatiblity -> compatibility
continously -> continuously
existance -> existence
usefull -> useful
shoudl -> should

Signed-off-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

24c7608a 10/09/2013 11:43 am Peter Lieven

block/iscsi: reenable iscsi_co_get_block_status

Commit f35c934a accidently disabled iscsi_co_get_block_status for all
libiscsi versions. Its not possible to check for enumeration constants
in the C preprocessor. This patch changes the check to the preprocessor...

030be321 09/25/2013 05:21 pm Benoît Canet

block: introduce BlockDriver.bdrv_needs_filename to enable some drivers.

Some drivers will have driver specifics options but no filename.
This new bool allow the block layer to treat them correctly.

The .bdrv_needs_filename is set in drivers not having .bdrv_parse_filename and...

f3ca508f 09/23/2013 07:52 pm Anthony Liguori

Merge remote-tracking branch 'bonzini/scsi-next' into staging

  1. By Hervé Poussineau (5) and Stefan Weil (1)
  2. Via Paolo Bonzini
    • bonzini/scsi-next:
      block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi
      lsi: add 53C810 variant
      lsi: remove todo...
f35c934a 09/18/2013 02:28 am Stefan Weil

block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi

Debian wheezy includes libiscsi-dev 1.4.0 which does not provide
SCSI_PROVISIONING_TYPE_DEALLOCATED. Drop iscsi_co_get_block_status
in this case to allow compilation without errors....

5dc11192 09/17/2013 05:51 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

  1. By Max Reitz (16) and others
  2. Via Kevin Wolf
    • kwolf/for-anthony: (33 commits)
      qemu-iotests: Fix test 038
      block: Assert validity of BdrvActionOps
      qemu-iotests: Cleanup test image in test number 007...
65f3e339 09/12/2013 02:14 pm Peter Lieven

iscsi: split discard requests in multiple parts

Replace .bdrv_aio_discard with .bdrv_co_discard so that discard
requests can be split in multiple parts, each for a small amount
of sectors.

This is useful because we expose a generic API with no limit
on the amount of sectors that can be unmapped in one request....

d5124c00 09/12/2013 11:12 am Max Reitz

bdrv: Use "Error" for creating images

Add an Error ** parameter to BlockDriver.bdrv_create to allow more
specific error messages.

Signed-off-by: Max Reitz <>

015a1036 09/12/2013 11:12 am Max Reitz

bdrv: Use "Error" for opening images

Add an Error ** parameter to BlockDriver.bdrv_open and
BlockDriver.bdrv_file_open to allow more specific error messages.

Signed-off-by: Max Reitz <>

5accc840 09/12/2013 09:46 am Paolo Bonzini

scsi: prefer UUID to VM name for the initiator name

The UUID is unique even across multiple hosts, thus it is
better than a VM name even if it is less user-friendly.

Signed-off-by: Paolo Bonzini <>

f18a7cbb 09/12/2013 09:46 am Peter Lieven

iscsi: add logical block provisioning information to iscsilun

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>

54a5c1d5 09/12/2013 09:46 am Peter Lieven

iscsi: add .bdrv_get_block_status

this patch adds a coroutine for .bdrv_co_block_status as well as
a generic framework that can be used to build coroutines in block/iscsi.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>

13c91cb7 09/06/2013 04:25 pm Fam Zheng

iscsi: use bdrv_new() instead of stack structure

BlockDriverState structure needs bdrv_new() to initialize refcnt, don't
allocate a local structure variable and memset to 0, becasue with coming
refcnt implementation, bdrv_unref will crash if bs->refcnt not...

4f6fd349 09/06/2013 04:25 pm Fam Zheng

block: make bdrv_delete() static

Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no
longer public and should be called by bdrv_unref() if refcnt is
decreased to 0.

This is an identical change because effectively, there's no multiple
reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets...

bc72ad67 08/22/2013 08:14 pm Alex Bligh

aio / timers: Switch entire codebase to the new timer API

This is an autogenerated patch using scripts/switch-timer-api.

Switch the entire code base to using the new timer API.

Note this patch may introduce some line length issues.

Signed-off-by: Alex Bligh <>...

70ecdc6e 08/19/2013 04:52 pm Stefan Hajnoczi

block/iscsi: drop iscsi_process_flush()

.io_flush() is no longer called so drop iscsi_process_flush().

Signed-off-by: Stefan Hajnoczi <>

f2e5dca4 08/19/2013 04:52 pm Stefan Hajnoczi

aio: drop io_flush argument

The .io_flush() handler no longer exists and has no users. Drop the
io_flush argument to aio_set_fd_handler() and related functions.

The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no
longer used and are dropped too....

f5075224 08/02/2013 05:02 pm Richard W.M. Jones

block/iscsi.c: Fix printf format error.

The error on armv7hl was:

block/iscsi.c: In function ‘is_request_lun_aligned’:
block/iscsi.c:251:26: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int64_t’ [-Werror=format=]
iscsilun->block_size, sector_num, nb_sectors);...

7e4d5a9f 07/17/2013 06:01 pm Peter Lieven

iscsi: remove support for misaligned nb_sectors in aio_readv

this hask is not working (anymore). support for misaligned offsets should
be handled at the block layer.

Signed-off-by: Peter Lieven <>
Cc:
Signed-off-by: Paolo Bonzini <>

91bea4e2 07/17/2013 06:01 pm Peter Lieven

iscsi: assert that sectors are aligned to LUN blocksize

if the blocksize of an iSCSI LUN is bigger than the BDRV_SECTOR_SIZE
it is possible that sector_num or nb_sectors are not correctly
aligned.

to avoid corruption we fail requests which are misaligned....

0777b5dd 07/17/2013 06:01 pm Peter Lieven

iscsi: factor out sector conversions

Reviewed-by: Kevin Wolf <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>

d3bda7bc 07/17/2013 06:00 pm Peter Lieven

iscsi: fix -ENOSPC in iscsi_create()

the -ENOPSC case did not work due to the missing goto.

Reported-by: Kevin Wolf <>
Signed-off-by: Peter Lieven <>
Cc:
Signed-off-by: Paolo Bonzini <>

0a53f010 07/17/2013 06:00 pm Ronnie Sahlberg

Fix iSCSI crash on SG_IO with an iovector

Don't assume that SG_IO is always invoked with a simple buffer,
check the iovec_count and if it is >= 1 then we need to pass an array
of iovectors to libiscsi instead of just a plain buffer.

Signed-off-by: Ronnie Sahlberg <>...

f0d2a4d4 06/18/2013 01:43 pm Paolo Bonzini

iscsi: simplify freeing of tasks

Always free them in the iscsi_aio_*_acb functions and remove the
checks in their callers. Remove ifs when the task struct was
previously dereferenced (spotted by Coverity).

Cc:
Signed-off-by: Paolo Bonzini <>

1288844e 06/18/2013 01:43 pm Paolo Bonzini

iscsi: reorganize iscsi_readcapacity_sync

Avoid the goto, and use the same retry logic for the 10- and 16-
byte versions.

Cc:
Signed-off-by: Paolo Bonzini <>

56d1b4d2 04/22/2013 12:34 pm Kevin Wolf

block: Remove filename parameter from .bdrv_file_open()

It is unused now in all block drivers.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

60beb341 04/22/2013 11:27 am Kevin Wolf

iscsi: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

Signed-off-by: Kevin Wolf <>...

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

787e4a85 03/22/2013 06:51 pm Kevin Wolf

block: Add options QDict to bdrv_file_open() prototypes

The new parameter is unused yet.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

cb1b83e7 03/05/2013 06:51 pm Peter Lieven

iscsi: add iscsi_truncate support

this patch adds iscsi_truncate which effectively allows for
online resizing of iscsi volumes. for this to work you have
to resize the volume on your storage and then call
block_resize command in qemu which will issue a
readcapacity16 to update the capacity....

1dde716e 03/05/2013 06:51 pm Peter Lieven

iscsi: retry read, write, flush and unmap on unit attention check conditions

the storage might return a check condition status for various reasons.
(e.g. bus reset, capacity change, thin-provisioning info etc.)

currently all these informative status responses lead to an I/O error...

4790b03d 01/24/2013 04:37 pm Paolo Bonzini

iscsi: do not leak acb->buf when commands are aborted

acb->buf is freed in the WRITE callback, but this may not
get called at all when commands are aborted. Add another
free in the ABORT TASK callback, which requires setting acb->buf
to NULL everywhere....

7371d56f 01/24/2013 04:37 pm Peter Lieven

iscsi: add support for iovectors

This patch adds support for directly passing the iovec
array from QEMUIOVector if libiscsi supports it (1.8.0
or newer).

Signed-off-by: Peter Lieven <>
[Preserve the improvements from commit 4cc841b, iscsi: partly...

177f7fc6 01/23/2013 05:08 pm Anthony Liguori

Merge remote-tracking branch 'bonzini/scsi-next' into staging

  1. By Peter Lieven (3) and others
  2. Via Paolo Bonzini
    • bonzini/scsi-next:
      scsi: Drop useless null test in scsi_unit_attention()
      lsi: use qbus_reset_all to reset SCSI bus
      scsi: fix segfault with 0-byte disk...
de8864e5 01/22/2013 04:07 pm Peter Lieven

iscsi: add iscsi_create support

This patch adds support for bdrv_create. This allows e.g.
to use qemu-img to convert from any supported device to
an iscsi backed storage as destination.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>

4cc841b5 01/22/2013 04:07 pm Peter Lieven

iscsi: partly avoid iovec linearization in iscsi_aio_writev

libiscsi expects all write16 data in a linear buffer. If the
iovec only contains one buffer we can skip the linearization
step as well as the additional malloc/free and pass the
buffer directly....

5b5d34ec 01/22/2013 04:07 pm Peter Lieven

iscsi: add support for iSCSI NOPs [v2]

This patch will send NOP-Out PDUs every 5 seconds to the iSCSI target.
If a consecutive number of NOP-In replies fail a reconnect is initiated.
iSCSI NOPs help to ensure that the connection to the target is still operational....

4d454574 01/12/2013 06:17 pm Paolo Bonzini

qemu-option: move standard option definitions out of qemu-config.c

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

737e150e 12/19/2012 09:31 am Paolo Bonzini

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

077805fa 12/19/2012 09:29 am Paolo Bonzini

janitor: do not rely on indirect inclusions of or from qemu-char.h

Various header files rely on qemu-char.h including qemu-config.h or
main-loop.h, but they really do not need qemu-char.h at all (particularly
interesting is the case of the block layer!). Clean this up, and also...

f807ecd5 11/28/2012 01:51 pm Peter Lieven

iscsi: do not assume device is zero initialized

Without any complex checks we can't assume that an
iscsi target is initialized to zero.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>

e829b0bb 11/28/2012 01:50 pm Peter Lieven

iscsi: fix deadlock during login

If the connection is interrupted before the first login is successfully
completed qemu-kvm is waiting forever in qemu_aio_wait().

This is fixed by performing an sync login to the target. If the
connection breaks after the first successful login errors are...

8da1e18b 11/28/2012 01:46 pm Peter Lieven

iscsi: fix segfault in url parsing

If an invalid URL is specified iscsi_get_error(iscsi) is called
with iscsi == NULL.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>

d7331bed 11/14/2012 07:19 pm Stefan Hajnoczi

aio: rename AIOPool to AIOCBInfo

Now that AIOPool no longer keeps a freelist, it isn't really a "pool"
anymore. Rename it to AIOCBInfo and make it const since it no longer
needs to be modified.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

444dbc38 09/26/2012 12:06 am Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

  • kwolf/for-anthony:
    block: remove keep_read_only flag from BlockDriverState struct
    block: convert bdrv_commit() to use bdrv_reopen()
    block: vpc image file reopen
    block: vdi image file reopen...
39c9fb95 09/24/2012 04:15 pm Jeff Cody

block: do not parse BDRV_O_CACHE_WB in block drivers

Block drivers should ignore BDRV_O_CACHE_WB in .bdrv_open flags,
and in the bs->open_flags.

This patch removes the code, leaving the behaviour behind as if
BDRV_O_CACHE_WB was set.

Signed-off-by: Jeff Cody <>...

40a13ca8 09/21/2012 05:12 pm Ronnie Sahlberg

iSCSI: We dont need to explicitely call qemu_notify_event() any more

We no longer need to explicitely call qemu_notify_event() any more
since this is now done automatically any time the filehandles we listen
to change.

Signed-off-by: Ronnie Sahlberg <>...

f1a12821 09/21/2012 05:05 pm Ronnie Sahlberg

iSCSI: We need to support SG_IO also from iscsi_ioctl()

We need to support SG_IO from the synchronous iscsi_ioctl() since
scsi-block uses this to do an INQ to the device to discover its properties
This patch makes scsi-block work with iscsi.

Signed-off-by: Ronnie Sahlberg <>...

135b9088 08/28/2012 03:50 pm Ronnie Sahlberg

iscsi: Set number of blocks to 0 for blank CDROM devices

The number of blocks of the device is used to compute the device size
in bdrv_getlength()/iscsi_getlength().
For MMC devices, the ReturnedLogicalBlockAddress in the READCAPACITY10
has a special meaning when it is 0....

27cbd828 08/20/2012 04:58 pm Paolo Bonzini

iscsi: move iscsi_schedule_bh and iscsi_readv_writev_bh_cb

Put these functions at the beginning, to avoid forward references
in the next patches.

Signed-off-by: Paolo Bonzini <>

cfb3f506 08/20/2012 04:58 pm Paolo Bonzini

iscsi: simplify iscsi_schedule_bh

It is always used with the same callback, remove the argument. And
its return value is never used, assume allocation succeeds.

Signed-off-by: Paolo Bonzini <>

1bd075f2 08/20/2012 04:58 pm Paolo Bonzini

iscsi: fix races between task completion and abort

This patch fixes two main issues with block/iscsi.c:

1) iscsi_task_mgmt_abort_task_async calls iscsi_scsi_task_cancel which
was also directly called in iscsi_aio_cancel

2) a race between task completion and task abortion could happen cause...

b2090919 08/20/2012 04:50 pm Paolo Bonzini

Revert "iscsi: Fix NULL dereferences / races between task completion and abort"

This reverts commit 64e69e80920d82df3fa679bc41b13770d2f99360. The commit
returned immediately from iscsi_aio_cancel, risking corruption in case the
following happens:

guest                  qemu                 target...
64e69e80 08/15/2012 02:16 pm Stefan Priebe

iscsi: Fix NULL dereferences / races between task completion and abort

Signed-off-by: Stefan Priebe <>
Acked-by: Ronnie Sahlberg <>
Signed-off-by: Kevin Wolf <>

31459f46 08/09/2012 04:04 pm Ronnie Sahlberg

iscsi: Pick default initiator-name based on the name of the VM

This patch updates the iscsi layer to automatically pick a 'unique'
initiator-name based on the name of the vm in case the user has not set
an explicit iqn-name to use.

Create a new function qemu_get_vm_name() that returns the name of the VM,...

b93c94f7 08/08/2012 03:51 pm Paolo Bonzini

iscsi: do not leak initiator_name

The argument of iscsi_create_context is never freed by libiscsi,
which in fact calls strdup on it. Avoid a leak.

Signed-off-by: Paolo Bonzini <>

f2ef4a6d 08/08/2012 03:51 pm Paolo Bonzini

iscsi: reorganize code for parse_initiator_name

Merge the occurrences of the "iqn.2008-11.org.linux-kvm" string
to avoid duplication.

Signed-off-by: Paolo Bonzini <>

23797df3 07/09/2012 08:35 pm Anthony Liguori

Merge remote-tracking branch 'mjt/mjt-iov2' into staging

  • mjt/mjt-iov2:
    rewrite iov_send_recv() and move it to iov.c
    cleanup qemu_co_sendv(), qemu_co_recvv() and friends
    export iov_send_recv() and use it in iov_send() and iov_recv()
    rename qemu_sendv to iov_send, change proto and move declarations to iov.h...
98392453 07/02/2012 11:18 am Ronnie Sahlberg

ISCSI: Add SCSI passthrough via scsi-generic to libiscsi

Update iscsi to allow passthrough of SG_IO scsi commands when the iscsi
device is forced to be scsi-generic.

Implement both bdrv_ioctl() and bdrv_aio_ioctl() in the iscsi backend,
emulate the SG_IO ioctl and pass the SCSI commands across to the...

622695a4 07/02/2012 11:18 am Ronnie Sahlberg

ISCSI: force use of sg for SMC and SSC devices

If the device we open is a SMC or SSC device, then force the use of sg. We
dont have any medium changer or tape emulation so only passthrough via
real sg or scsi-generic via iscsi would work anyway.

Forcing sg also makes qemu skip trying to read from the device to guess...

d5e6b161 06/11/2012 10:12 pm Michael Tokarev

change qemu_iovec_to_buf() to match other to,from_buf functions

It now allows specifying offset within qiov to start from and
amount of bytes to copy. Actual implementation is just a call
to iov_to_buf().

Signed-off-by: Michael Tokarev <>

f4dfa67f 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: Switch to using READ16/WRITE16 for I/O to the LUN

This allows using LUNs bigger than 2TB. Keep using READ10 for other
device types such as MMC.

Signed-off-by: Ronnie Sahlberg <>

6bcd1346 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: Only call READCAPACITY16 for SBC devices, use READCAPACITY10 for MMC

Signed-off-by: Ronnie Sahlberg <>

c7b4a952 05/28/2012 03:04 pm Paolo Bonzini

ISCSI: change num_blocks to 64-bit

Signed-off-by: Paolo Bonzini <>

dbfff6d7 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: get device type at connection time

This is needed to avoid READ CAPACITY for MMC devices.

Signed-off-by: Ronnie Sahlberg <>
Signed-off-by: Paolo Bonzini <>

c9b9f682 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: redo how we set up the events

Call qemu_notify_event() after updating events. Otherwise, If we add
an event for -is-writeable but the socket is already writeable there
may be a delay before the event callback is actually triggered.

Those delays would in particular hurt performance during BIOS boot and...

fa6acb0c 05/04/2012 11:39 am Ronnie Sahlberg

ISCSI: Add support for thin-provisioning via discard/UNMAP and bigger LUNs

Update the configure test for libiscsi support to detect version 1.3
or later. Version 1.3 of libiscsi provides both READCAPACITY16 as well
as UNMAP commands.

Update the iscsi block layer to use READCAPACITY16 to detect the size of...

bafbd6a1 04/19/2012 05:37 pm Paolo Bonzini

aio: remove process_queue callback and qemu_aio_process_queue

Both unused after the previous patch.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

f9dadc98 02/09/2012 05:17 pm Ronnie Sahlberg

iSCSI: add configuration variables for iSCSI

This patch adds configuration variables for iSCSI to set
initiator-name to use when logging in to the target,
which type of header-digest to negotiate with the target
and username and password for CHAP authentication....

c589b249 10/28/2011 08:25 pm Ronnie Sahlberg

iSCSI block driver

This provides built-in support for iSCSI to QEMU.

This has the advantage that the iSCSI devices need not be made visible to the host, which is useful if you have very many virtual machines and very many iscsi devices.
It also has the benefit that non-root users of QEMU can access iSCSI devices across the network without requiring root privilege on the host....