* [Qemu-devel] [PATCH] block/iscsi: Fix compilation for libscsi 1.4.0 (API change)
@ 2013-12-16 19:37 Stefan Weil
2013-12-16 21:11 ` Peter Lieven
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2013-12-16 19:37 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Ronnie Sahlberg, Stefan Weil, Peter Lieven,
Stefan Hajnoczi, Paolo Bonzini
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.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
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 edfea95..2d2c2d4 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.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] block/iscsi: Fix compilation for libscsi 1.4.0 (API change)
2013-12-16 19:37 [Qemu-devel] [PATCH] block/iscsi: Fix compilation for libscsi 1.4.0 (API change) Stefan Weil
@ 2013-12-16 21:11 ` Peter Lieven
0 siblings, 0 replies; 2+ messages in thread
From: Peter Lieven @ 2013-12-16 21:11 UTC (permalink / raw)
To: Stefan Weil
Cc: Kevin Wolf, Paolo Bonzini, Stefan Hajnoczi, qemu-devel,
Ronnie Sahlberg
Am 16.12.2013 um 20:37 schrieb Stefan Weil <sw@weilnetz.de>:
> 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
libiscsi
> distributions currently provide packages for QEMU which use it), so we
> still need support for this older API.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>
> 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 edfea95..2d2c2d4 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.7.10.4
>
Reviewed-by: Peter Lieven <pl@kamp.de>
I missed that silent change from 1.4.0 to 1.5.0.
Thanks for the patch.
Peter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-16 21:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-16 19:37 [Qemu-devel] [PATCH] block/iscsi: Fix compilation for libscsi 1.4.0 (API change) Stefan Weil
2013-12-16 21:11 ` Peter Lieven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).