mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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.
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>
When using authentication, the password can optionally be set with
LIBISCSI_CHAP_PASSWORD="password" to avoid it showing up in the process list
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
committed by
Kevin Wolf
parent
b5a12aa204
commit
c589b24972
@@ -36,6 +36,7 @@ block-nested-y += qed-check.o
|
||||
block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o
|
||||
block-nested-$(CONFIG_WIN32) += raw-win32.o
|
||||
block-nested-$(CONFIG_POSIX) += raw-posix.o
|
||||
block-nested-$(CONFIG_LIBISCSI) += iscsi.o
|
||||
block-nested-$(CONFIG_CURL) += curl.o
|
||||
block-nested-$(CONFIG_RBD) += rbd.o
|
||||
|
||||
|
||||
+591
File diff suppressed because it is too large
Load Diff
@@ -182,6 +182,7 @@ usb_redir=""
|
||||
opengl=""
|
||||
zlib="yes"
|
||||
guest_agent="yes"
|
||||
libiscsi=""
|
||||
|
||||
# parse CC options first
|
||||
for opt do
|
||||
@@ -657,6 +658,10 @@ for opt do
|
||||
;;
|
||||
--enable-spice) spice="yes"
|
||||
;;
|
||||
--disable-libiscsi) libiscsi="no"
|
||||
;;
|
||||
--enable-libiscsi) libiscsi="yes"
|
||||
;;
|
||||
--enable-profiler) profiler="yes"
|
||||
;;
|
||||
--enable-cocoa)
|
||||
@@ -1046,6 +1051,8 @@ echo " Default:trace-<pid>"
|
||||
echo " --disable-spice disable spice"
|
||||
echo " --enable-spice enable spice"
|
||||
echo " --enable-rbd enable building the rados block device (rbd)"
|
||||
echo " --disable-libiscsi disable iscsi support"
|
||||
echo " --enable-libiscsi enable iscsi support"
|
||||
echo " --disable-smartcard disable smartcard support"
|
||||
echo " --enable-smartcard enable smartcard support"
|
||||
echo " --disable-smartcard-nss disable smartcard nss support"
|
||||
@@ -2334,6 +2341,25 @@ if compile_prog "" "" ; then
|
||||
bswap_h=yes
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# Do we have libiscsi
|
||||
if test "$libiscsi" != "no" ; then
|
||||
cat > $TMPC << EOF
|
||||
#include <iscsi/iscsi.h>
|
||||
int main(void) { iscsi_create_context(""); return 0; }
|
||||
EOF
|
||||
if compile_prog "-Werror" "-liscsi" ; then
|
||||
libiscsi="yes"
|
||||
LIBS="$LIBS -liscsi"
|
||||
else
|
||||
if test "$libiscsi" = "yes" ; then
|
||||
feature_not_found "libiscsi"
|
||||
fi
|
||||
libiscsi="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
##########################################
|
||||
# Do we need librt
|
||||
cat > $TMPC <<EOF
|
||||
@@ -2744,6 +2770,7 @@ echo "xfsctl support $xfs"
|
||||
echo "nss used $smartcard_nss"
|
||||
echo "usb net redir $usb_redir"
|
||||
echo "OpenGL support $opengl"
|
||||
echo "libiscsi support $libiscsi"
|
||||
echo "build guest agent $guest_agent"
|
||||
|
||||
if test "$sdl_too_old" = "yes"; then
|
||||
@@ -3042,6 +3069,10 @@ if test "$opengl" = "yes" ; then
|
||||
echo "CONFIG_OPENGL=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
if test "$libiscsi" = "yes" ; then
|
||||
echo "CONFIG_LIBISCSI=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
# XXX: suppress that
|
||||
if [ "$bsd" = "yes" ] ; then
|
||||
echo "CONFIG_BSD=y" >> $config_host_mak
|
||||
|
||||
@@ -505,6 +505,12 @@ escc_sunkbd_event_out(int ch) "Translated keycode %2.2x"
|
||||
escc_kbd_command(int val) "Command %d"
|
||||
escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=%01x"
|
||||
|
||||
# block/iscsi.c
|
||||
iscsi_aio_write10_cb(void *iscsi, int status, void *acb, int canceled) "iscsi %p status %d acb %p canceled %d"
|
||||
iscsi_aio_writev(void *iscsi, int64_t sector_num, int nb_sectors, void *opaque, void *acb) "iscsi %p sector_num %"PRId64" nb_sectors %d opaque %p acb %p"
|
||||
iscsi_aio_read10_cb(void *iscsi, int status, void *acb, int canceled) "iscsi %p status %d acb %p canceled %d"
|
||||
iscsi_aio_readv(void *iscsi, int64_t sector_num, int nb_sectors, void *opaque, void *acb) "iscsi %p sector_num %"PRId64" nb_sectors %d opaque %p acb %p"
|
||||
|
||||
# hw/esp.c
|
||||
esp_raise_irq(void) "Raise IRQ"
|
||||
esp_lower_irq(void) "Lower IRQ"
|
||||
|
||||
Reference in New Issue
Block a user