[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/18] block/iscsi: Fix compilation for libiscsi 1.4.
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 07/18] block/iscsi: Fix compilation for libiscsi 1.4.0 (API change) |
Date: |
Fri, 20 Dec 2013 16:46:45 +0100 |
From: Stefan Weil <address@hidden>
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
still need support for this older API.
Reviewed-by: Peter Lieven <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/iscsi.c | 5 ++++-
configure | 22 ++++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index fa69408..294b2c6 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -359,7 +359,10 @@ retry:
default:
iTask.task = iscsi_read10_task(iscsilun->iscsi, iscsilun->lun, lba,
num_sectors * iscsilun->block_size,
- iscsilun->block_size, 0, 0, 0, 0, 0,
+ iscsilun->block_size,
+#if !defined(CONFIG_LIBISCSI_1_4) /* API change from 1.4.0 to 1.5.0 */
+ 0, 0, 0, 0, 0,
+#endif
iscsi_co_generic_cb, &iTask);
break;
}
diff --git a/configure b/configure
index 07b6be3..d97556c 100755
--- a/configure
+++ b/configure
@@ -3078,6 +3078,21 @@ EOF
fi
fi
+# We also need to know the API version because there was an
+# API change from 1.4.0 to 1.5.0.
+if test "$libiscsi" = "yes"; then
+ cat >$TMPC <<EOF
+#include <iscsi/iscsi.h>
+int main(void)
+{
+ iscsi_read10_task(0, 0, 0, 0, 0, 0, 0);
+ return 0;
+}
+EOF
+ if compile_prog "" "-liscsi"; then
+ libiscsi_version="1.4.0"
+ fi
+fi
##########################################
# Do we need libm
@@ -3805,7 +3820,11 @@ echo "nss used $smartcard_nss"
echo "libusb $libusb"
echo "usb net redir $usb_redir"
echo "GLX support $glx"
+if test "$libiscsi_version" = "1.4.0"; then
+echo "libiscsi support $libiscsi (1.4.0)"
+else
echo "libiscsi support $libiscsi"
+fi
echo "build guest agent $guest_agent"
echo "QGA VSS support $guest_agent_with_vss"
echo "seccomp support $seccomp"
@@ -4137,6 +4156,9 @@ fi
if test "$libiscsi" = "yes" ; then
echo "CONFIG_LIBISCSI=y" >> $config_host_mak
+ if test "$libiscsi_version" = "1.4.0"; then
+ echo "CONFIG_LIBISCSI_1_4=y" >> $config_host_mak
+ fi
fi
if test "$seccomp" = "yes"; then
--
1.8.4.2
- [Qemu-devel] [PULL 00/18] Block patches, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 01/18] sheepdog: fix dynamic grow for running qcow2 format, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 02/18] vring: create a common function to parse descriptors, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 03/18] vring: factor common code for error exits, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 04/18] dataplane: change vring API to use VirtQueueElement, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 05/18] dataplane: replace hostmem with memory_region_find, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 07/18] block/iscsi: Fix compilation for libiscsi 1.4.0 (API change),
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 06/18] qapi-schema: fix QEMU 1.8 references, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 08/18] block: vhdx - improve error message, and .bdrv_check implementation, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 09/18] docs: updated qemu-img man page and qemu-doc to reflect VHDX support., Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 10/18] vmdk: Check VMFS extent line field number, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 11/18] vmdk: Allow vmdk_create to work with protocol, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 12/18] qemu-iotests: drop duplicate virtio-blk initialization failure, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 13/18] mirror: Don't close target, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 14/18] mirror: Move base to MirrorBlockJob, Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 15/18] block: Add commit_active_start(), Stefan Hajnoczi, 2013/12/20
- [Qemu-devel] [PULL 16/18] commit: Support commit active layer, Stefan Hajnoczi, 2013/12/20