Statistics
| Branch: | Revision:

root / block / iscsi.c @ cc84d90f

History | View | Annotate | Download (36.4 kB)

# Date Author Comment
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 <>

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....