On Sat, Dec 25, 2010 at 11:44 PM, Ronnie Sahlberg <ronniesahlb...@gmail.com> wrote: > This patch adds a new block driver : block.iscsi.c > This driver interfaces with the multiplatform posix library > for iscsi initiator/client access to iscsi devices hosted at > git://github.com/sahlberg/libiscsi.git > > The patch adds the driver to interface with the iscsi library. > It also updated the configure script to > * by default, probe is libiscsi is available and if so, build > qemu against libiscsi. > * --enable-libiscsi > Force a build against libiscsi. If libiscsi is not available > the build will fail. > * --disable-libiscsi > Do not link against libiscsi, even if it is available. > > When linked with libiscsi, qemu gains support to access iscsi resources > such as disks and cdrom directly, without having to make the devices visible > to the host. > > You can specify devices using a iscsi url of the form : > iscsi://[<username>%<password>@]<host>[:<port]/<target-iqn-name>/<lun> > > Example: > -drive file=iscsi://10.1.1.1:3260/iqn.ronnie.test/1 > > -cdrom iscsi://10.1.1.1:3260/iqn.ronnie.test/2 > > Version 2: > Changes from Blue Swirl's suggestions > - Change naming of structures and typedefs to match coding style > - Use CONFIG_ISCSI in the makefile to conditionally compile iscsi.c > - Missing spaces added around operators > - Use uint8_t instead of unsigned char for buffer pointer > - Use a temporary variable for the result of long functions, to move them > out from the if(...) expressions. Making the code easier to read. > - Create a function sector_qemu2lun() and use it instead of performing > the same conversion explicitely at several palces in the code. > - Use the name opaque instead of private_data > - Use memset() instead of bzero() > > Other changes > - Use the common library function to parse the iSCSI URL > - Add support for CHAP authentication > > Signed-off-by: Ronnie Sahlberg <ronniesahlb...@gmail.com> > --- > Makefile.objs | 1 + > block/iscsi.c | 518 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > configure | 31 ++++ > 3 files changed, 550 insertions(+), 0 deletions(-) > create mode 100644 block/iscsi.c
Mixed tabs and spaces. QEMU uses spaces only with 4-space indentation. Hopefully real feedback soon, I'm playing with this patch, libiscsi, and tgtd :). Stefan