From fa6acb0c2ff3f256fb5f2fede4768b27374b03ca Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 24 Apr 2012 16:29:04 +1000 Subject: ISCSI: Add support for thin-provisioning via discard/UNMAP and bigger LUNs Update the configure test for libiscsi support to detect version 1.3 or later. Version 1.3 of libiscsi provides both READCAPACITY16 as well as UNMAP commands. Update the iscsi block layer to use READCAPACITY16 to detect the size of the LUN instead of READCAPACITY10. This allows support for LUNs larger than 2TB. Update to implement bdrv_aio_discard() using the UNMAP command. This allows us to use thin-provisioned LUNs from TGTD and other iSCSI targets that support thin-provisioning. Signed-off-by: Ronnie Sahlberg [squashed in subsequent patch from Ronnie to fix off-by-one in LBA count] Signed-off-by: Paolo Bonzini --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 0111774cb0..0e3615be07 100755 --- a/configure +++ b/configure @@ -2546,10 +2546,13 @@ fi ########################################## # Do we have libiscsi +# We check for iscsi_unmap_sync() to make sure we have a +# recent enough version of libiscsi. if test "$libiscsi" != "no" ; then cat > $TMPC << EOF +#include #include -int main(void) { iscsi_create_context(""); return 0; } +int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } EOF if compile_prog "-Werror" "-liscsi" ; then libiscsi="yes" -- cgit v1.2.3