block/iscsi: Fix compilation for libscsi 1.4.0 (API change)
PATCH 1/1 block/iscsi: Fix compilation for libscsi 1.4.0 (API change)
Function iscsi_read10_task got additional parameters starting with version libiscsi 1.5.0.
libscsi 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.
---
block/iscsi.c | 5 ++++- configure | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-)
block/iscsi.c +4 -1
@@ -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 ; }
configure +22 -0
@@ -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
Signature · 1 line
1.7.10.4
Am 16.12.2013 um 20:37 schrieb Stefan Weil <[email protected]>:
Quoted 4 lines
Function
iscsi_read10_taskgot additional parameters starting with version libiscsi 1.5.0.libscsi 1.4.0 is still widely used (Debian wheezy, jessie and other Linux
libiscsi
Quoted 73 lines
distributions currently provide packages for QEMU which use it), so we still need support for this older API.
Signed-off-by Stefan Weil <[email protected]>---
block/iscsi.c| 5 ++++-
configure | 22 ++++++++++++++++++++++2 files changed, 26 insertions(+), 1 deletion(-)block/iscsi.c +4
-1@@ -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 ; }configure +0
-0@@ -3078,6 +3078,21 @@ EOF fifi
configure +15
-0+# 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 libmconfigure +0
-0@@ -3805,7 +3820,11 @@ echo "nss used $smartcard_nss"echo "libusb $libusb" echo "usb net redir $usb_redir" echo "GLX support $glx"configure +3
-0+if test "$libiscsi_version" = "1.4.0"; then +echo "libiscsi support $libiscsi (1.4.0)" +elseecho "libiscsi support $libiscsi"
+fi
echo "build guest agent $guest_agent"
echo "QGA VSS support $guest_agent_with_vss"
echo "seccomp support $seccomp"configure +0
-0@@ -4137,6 +4156,9 @@ fiif test "$libiscsi" = "yes" ; then
echo "CONFIG_LIBISCSI=y" >> $config_host_makconfigure +3
-0+ if test "$libiscsi_version" = "1.4.0"; then + echo "CONFIG_LIBISCSI_1_4=y" >> $config_host_mak + fifi
Quoted 4 lines
if test "$seccomp" = "yes"; then
Signature · 1 line
1.7.10.4
I missed that silent change from 1.4.0 to 1.5.0.
Thanks for the patch.
Peter