Browse Source

libiscsi package update

Signed-off-by: basebuilder_pel7x64builder0 <basebuilder@powerel.org>
master
basebuilder_pel7x64builder0 6 years ago
parent
commit
ad46ed7ace
  1. 25
      SOURCES/0001-Fix-compiler-warning-error-under-gcc7.patch
  2. 43
      SOURCES/0002-Fix-another-compiler-warning.patch
  3. 114
      SOURCES/0003-Fix-32bit-build.patch
  4. 42
      SOURCES/0004-iser-Use-local-container_of-definition.patch
  5. 57
      SOURCES/0005-fix-ipv6.patch
  6. 156
      SOURCES/0006-fix-coverity-report.patch
  7. 212
      SPECS/libiscsi.spec

25
SOURCES/0001-Fix-compiler-warning-error-under-gcc7.patch

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
From: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Date: Sat, 3 Jun 2017 11:20:20 -0700
Subject: [PATCH] Fix compiler warning/error under gcc7

Gcc7 complains about falling through from the previous case to the default arm

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
(cherry picked from commit 854e37aab7d7d2093a0a6620a3257b8f2a1d405c)
---
test-tool/iscsi-support.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c
index 02367ca..ed00ce7 100644
--- a/test-tool/iscsi-support.c
+++ b/test-tool/iscsi-support.c
@@ -2930,8 +2930,6 @@ void populate_ident_tgt_desc(unsigned char *buf, struct scsi_device *dev)
tgt_desig = desig;
prev_type = desig->designator_type;
}
- default:
- continue;
}
}
if (tgt_desig == NULL) {

43
SOURCES/0002-Fix-another-compiler-warning.patch

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
From: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Date: Sat, 3 Jun 2017 11:33:51 -0700
Subject: [PATCH] Fix another compiler warning

We do need a default: arm here as the switch is not supposed to deal with
all possible values for the enum.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
(cherry picked from commit fb45f0343e3de45f2bc7516591d36c7466c2184e)
---
test-tool/iscsi-support.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c
index ed00ce7..3f860ed 100644
--- a/test-tool/iscsi-support.c
+++ b/test-tool/iscsi-support.c
@@ -2922,14 +2922,17 @@ void populate_ident_tgt_desc(unsigned char *buf, struct scsi_device *dev)
for (desig = inq_di->designators; desig; desig = desig->next) {
switch (desig->designator_type) {
- case SCSI_DESIGNATOR_TYPE_VENDOR_SPECIFIC:
- case SCSI_DESIGNATOR_TYPE_T10_VENDORT_ID:
- case SCSI_DESIGNATOR_TYPE_EUI_64:
- case SCSI_DESIGNATOR_TYPE_NAA:
- if (prev_type <= desig->designator_type) {
- tgt_desig = desig;
- prev_type = desig->designator_type;
- }
+ case SCSI_DESIGNATOR_TYPE_VENDOR_SPECIFIC:
+ case SCSI_DESIGNATOR_TYPE_T10_VENDORT_ID:
+ case SCSI_DESIGNATOR_TYPE_EUI_64:
+ case SCSI_DESIGNATOR_TYPE_NAA:
+ if (prev_type <= desig->designator_type) {
+ tgt_desig = desig;
+ prev_type = desig->designator_type;
+ }
+ continue;
+ default:
+ continue;
}
}
if (tgt_desig == NULL) {

114
SOURCES/0003-Fix-32bit-build.patch

@ -0,0 +1,114 @@ @@ -0,0 +1,114 @@
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 14 Nov 2016 17:28:31 +0100
Subject: [PATCH] Fix 32bit build.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
(cherry picked from commit a239423a0f9250dad9998152fa4b4b46accdf641)
---
lib/iser.c | 7 ++++---
test-tool/test_compareandwrite_invalid_dataout_size.c | 4 ++--
test-tool/test_writesame10_invalid_dataout_size.c | 4 ++--
test-tool/test_writesame16_invalid_dataout_size.c | 4 ++--
4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/lib/iser.c b/lib/iser.c
index ad3adb3..17832c3 100644
--- a/lib/iser.c
+++ b/lib/iser.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
+#include <inttypes.h>
#include "iscsi.h"
#include "iser-private.h"
#include "iscsi-private.h"
@@ -524,7 +525,7 @@ iser_prepare_read_cmd(struct iser_conn *iser_conn,struct iser_pdu *iser_pdu)
}
tx_desc->data_dir = DATA_READ;
- hdr->read_va = htobe64((uint64_t)tx_desc->data_buff);
+ hdr->read_va = htobe64((intptr_t)tx_desc->data_buff);
hdr->read_stag = htobe32((uint32_t)tx_desc->data_mr->rkey);
hdr->flags |= ISER_RSV;
@@ -565,7 +566,7 @@ iser_prepare_write_cmd(struct iser_conn *iser_conn, struct iser_pdu *iser_pdu)
hdr->flags |= ISER_WSV;
hdr->write_stag = htobe32((uint32_t)(tx_desc->data_mr->rkey));
- hdr->write_va = htobe64((uint64_t)(tx_desc->data_buff));
+ hdr->write_va = htobe64((intptr_t)(tx_desc->data_buff));
return 0;
}
@@ -1146,7 +1147,7 @@ static int iser_handle_wc(struct ibv_wc *wc,struct iser_conn *iser_conn)
wc->wr_id, wc->status, wc->vendor_err);
return iscsi_service_reconnect_if_loggedin(iscsi);
} else {
- iscsi_set_error(iscsi, "flush error: wr id %lx\n", wc->wr_id);
+ iscsi_set_error(iscsi, "flush error: wr id %" PRIx64 "\n", wc->wr_id);
return 0;
}
diff --git a/test-tool/test_compareandwrite_invalid_dataout_size.c b/test-tool/test_compareandwrite_invalid_dataout_size.c
index b27b4f8..76da1e0 100644
--- a/test-tool/test_compareandwrite_invalid_dataout_size.c
+++ b/test-tool/test_compareandwrite_invalid_dataout_size.c
@@ -64,7 +64,7 @@ test_compareandwrite_invalid_dataout_size(void)
logging(LOG_VERBOSE, "Check too small DataOut");
- logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%ld (4 blocks) "
+ logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%zd (4 blocks) "
"and TL == 1 ", 4 * block_size);
new_tl = 1;
@@ -74,7 +74,7 @@ test_compareandwrite_invalid_dataout_size(void)
EXPECT_STATUS_GENERIC_BAD);
logging(LOG_VERBOSE, "Check too large DataOut");
- logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%ld (4 blocks) "
+ logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%zd (4 blocks) "
"and TL == 3 ", 4 * block_size);
new_tl = 2;
diff --git a/test-tool/test_writesame10_invalid_dataout_size.c b/test-tool/test_writesame10_invalid_dataout_size.c
index f521908..119d786 100644
--- a/test-tool/test_writesame10_invalid_dataout_size.c
+++ b/test-tool/test_writesame10_invalid_dataout_size.c
@@ -41,13 +41,13 @@ test_writesame10_invalid_dataout_size(void)
memset(scratch, 0xa6, block_size);
logging(LOG_VERBOSE, "Check too small DataOut");
- logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
+ logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
block_size / 2, block_size);
WRITESAME10(sd, 0, block_size / 2, 1, 0, 1, 0, 0, scratch,
EXPECT_STATUS_GENERIC_BAD);
logging(LOG_VERBOSE, "Check too large DataOut");
- logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
+ logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
block_size * 2, block_size);
WRITESAME10(sd, 0, block_size * 2, 1, 0, 1, 0, 0, scratch,
EXPECT_STATUS_GENERIC_BAD);
diff --git a/test-tool/test_writesame16_invalid_dataout_size.c b/test-tool/test_writesame16_invalid_dataout_size.c
index 128673f..a2e22bb 100644
--- a/test-tool/test_writesame16_invalid_dataout_size.c
+++ b/test-tool/test_writesame16_invalid_dataout_size.c
@@ -41,13 +41,13 @@ test_writesame16_invalid_dataout_size(void)
memset(scratch, 0xa6, block_size);
logging(LOG_VERBOSE, "Check too small DataOut");
- logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
+ logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
block_size / 2, block_size);
WRITESAME16(sd, 0, block_size / 2, 1, 0, 1, 0, 0, scratch,
EXPECT_STATUS_GENERIC_BAD);
logging(LOG_VERBOSE, "Check too large DataOut");
- logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
+ logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
block_size * 2, block_size);
WRITESAME16(sd, 0, block_size * 2, 1, 0, 1, 0, 0, scratch,
EXPECT_STATUS_GENERIC_BAD);

42
SOURCES/0004-iser-Use-local-container_of-definition.patch

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 30 Apr 2018 18:11:05 -0400
Subject: [PATCH] iser: Use local container_of definition

The code was implicitly dependent on container_of from
inifiniband/verbs.h, however that's been removed in rdma-core
latest release:

https://github.com/linux-rdma/rdma-core/commit/ce0274acffc78ed2861a56bdc34cdd3d60c20e1f

Define container_of locally if it's not already defined

(cherry picked from commit f1feb218e2823d236569f0ca3cfad07334f2a304)
---
lib/iser.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/lib/iser.c b/lib/iser.c
index 17832c3..aa7244c 100644
--- a/lib/iser.c
+++ b/lib/iser.c
@@ -32,6 +32,20 @@
#include <semaphore.h>
#include <poll.h>
+
+#ifndef container_of
+/**
+ * container_of - cast a member of a structure out to the containing structure
+ * @ptr: the pointer to the member.
+ * @type: the type of the container struct this is embedded in.
+ * @member: the name of the member within the struct.
+ *
+ */
+#define container_of(ptr, type, member) \
+ ((type *) ((uint8_t *)(ptr) - offsetof(type, member)))
+#endif
+
+
#ifdef __linux
static int cq_handle(struct iser_conn *iser_conn);

57
SOURCES/0005-fix-ipv6.patch

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
From 179f6b33d43f26cbca133ff03fa1bacc7e8a6120 Mon Sep 17 00:00:00 2001
From: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Date: Sun, 8 Jan 2017 12:57:12 -0800
Subject: [PATCH] Fix IPV6

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>

diff --git a/lib/socket.c b/lib/socket.c
index 926e474..41b68c0 100644
--- a/lib/socket.c
+++ b/lib/socket.c
@@ -188,6 +188,20 @@ static int iscsi_tcp_connect(struct iscsi_context *iscsi, union socket_address *
int socksize;
+ switch (ai_family) {
+ case AF_INET:
+ socksize = sizeof(struct sockaddr_in);
+ break;
+ case AF_INET6:
+ socksize = sizeof(struct sockaddr_in6);
+ break;
+ default:
+ iscsi_set_error(iscsi, "Unknown address family :%d. "
+ "Only IPv4/IPv6 supported so far.",
+ ai_family);
+ return -1;
+ }
+
iscsi->fd = socket(ai_family, SOCK_STREAM, 0);
if (iscsi->fd == -1) {
iscsi_set_error(iscsi, "Failed to open iscsi socket. "
@@ -246,8 +260,6 @@ static int iscsi_tcp_connect(struct iscsi_context *iscsi, union socket_address *
ISCSI_LOG(iscsi,3,"TCP_NODELAY set to 1");
}
- socksize = sizeof(struct sockaddr_in); // Work-around for now, need to fix it
-
if (connect(iscsi->fd, &sa->sa, socksize) != 0
&& errno != EINPROGRESS) {
iscsi_set_error(iscsi, "Connect failed with errno : "
@@ -332,6 +344,7 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
case AF_INET:
socksize = sizeof(struct sockaddr_in);
memcpy(&sa.sin, ai->ai_addr, socksize);
+ sa.sin.sin_family = AF_INET;
sa.sin.sin_port = htons(port);
#ifdef HAVE_SOCK_SIN_LEN
sa.sin.sin_len = socksize;
@@ -341,6 +354,7 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
case AF_INET6:
socksize = sizeof(struct sockaddr_in6);
memcpy(&sa.sin6, ai->ai_addr, socksize);
+ sa.sin6.sin6_family = AF_INET6;
sa.sin6.sin6_port = htons(port);
#ifdef HAVE_SOCK_SIN_LEN
sa.sin6.sin6_len = socksize;

156
SOURCES/0006-fix-coverity-report.patch

@ -0,0 +1,156 @@ @@ -0,0 +1,156 @@
diff --git a/configure.ac b/configure.ac
index cf62b64..4001400 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,7 @@ AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror],
if test "$ac_cv_prog_gcc" = yes; then
WARN_CFLAGS="-Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing"
+ WARN_CFLAGS="$WARN_CFLAGS -Wno-unknown-warning-option -Wno-stringop-truncation"
if test "x$enable_werror" != "xno"; then
WARN_CFLAGS="$WARN_CFLAGS -Werror"
fi
diff --git a/lib/iser.c b/lib/iser.c
index 898d6b5..d140ad6 100644
--- a/lib/iser.c
+++ b/lib/iser.c
@@ -964,7 +964,7 @@ iser_post_recvm(struct iser_conn *iser_conn, int count)
iser_conn->post_recv_buf_count += count;
ret = ibv_post_recv(iser_conn->qp, iser_conn->rx_wr, &rx_wr_failed);
if (ret) {
- iscsi_set_error(iscsi, "ib_post_recv failed ret=%d", ret);
+ iscsi_set_error(iscsi, "posting %d rx bufs, ib_post_recv failed ret=%d", count, ret);
iser_conn->post_recv_buf_count -= count;
} else
iser_conn->rx_desc_head = my_rx_head;
@@ -1028,7 +1028,7 @@ iser_rcv_completion(struct iser_rx_desc *rx_desc,
struct iser_conn *iser_conn)
{
struct iscsi_in_pdu *in = NULL;
- int outstanding, count = 0, err;
+ int empty, err;
struct iscsi_context *iscsi = iser_conn->cma_id->context;
in = iscsi_malloc(iscsi, sizeof(*in));
@@ -1037,12 +1037,13 @@ iser_rcv_completion(struct iser_rx_desc *rx_desc,
if (iscsi->session_type == ISCSI_SESSION_NORMAL) {
if(iser_alloc_rx_descriptors(iser_conn,255)) {
iscsi_set_error(iscsi, "iser_alloc_rx_descriptors Failed\n");
- return -1;
+ err = -1;
+ goto error;
}
err = iser_post_recvm(iser_conn, ISER_MIN_POSTED_RX);
if (err) {
- iscsi_set_error(iscsi, "posting %d rx bufs err %d", count, err);
- return -1;
+ err = -1;
+ goto error;
}
}
in->hdr = (unsigned char*)rx_desc->iscsi_header;
@@ -1089,34 +1090,27 @@ iser_rcv_completion(struct iser_rx_desc *rx_desc,
ISCSI_LIST_ADD_END(&iser_conn->tx_desc, iser_pdu->desc);
nop_target:
-
/* decrementing conn->post_recv_buf_count only --after-- freeing the *
* task eliminates the need to worry on tasks which are completed in *
* parallel to the execution of iser_conn_term. So the code that waits *
* for the posted rx bufs refcount to become zero handles everything */
iser_conn->post_recv_buf_count--;
- if ((unsigned char *)rx_desc == iser_conn->login_resp_buf)
- goto receive;
-
- outstanding = iser_conn->post_recv_buf_count;
- if (outstanding + iser_conn->min_posted_rx <= iser_conn->qp_max_recv_dtos) {
- if(iser_conn->qp_max_recv_dtos - outstanding > iser_conn->min_posted_rx)
- count = iser_conn->min_posted_rx;
- else
- count = iser_conn->qp_max_recv_dtos - outstanding;
- err = iser_post_recvm(iser_conn, count);
- if (err) {
- iscsi_set_error(iscsi, "posting %d rx bufs err %d", count, err);
- return -1;
+ if ((unsigned char *)rx_desc != iser_conn->login_resp_buf) {
+ empty = iser_conn->qp_max_recv_dtos - iser_conn->post_recv_buf_count;
+ if (empty >= iser_conn->min_posted_rx) {
+ err = iser_post_recvm(iser_conn, empty);
+ if (err) {
+ err = -1;
+ goto error;
+ }
}
}
-receive:
-
err = iscsi_process_pdu(iscsi, in);
- iscsi_free(iscsi, in);
+error:
+ iscsi_free(iscsi, in);
return err;
}
diff --git a/lib/logging.c b/lib/logging.c
index be518fc..61c7440 100644
--- a/lib/logging.c
+++ b/lib/logging.c
@@ -73,9 +73,9 @@ iscsi_log_message(struct iscsi_context *iscsi, int level, const char *format, ..
}
if (iscsi->target_name[0]) {
- static char message2[1024];
+ static char message2[1282];
- snprintf(message2, 1024, "%s [%s]", message, iscsi->target_name);
+ snprintf(message2, 1282, "%s [%s]", message, iscsi->target_name);
iscsi->log_fn(level, message2);
}
else
diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c
index 5ddd709..747ce0c 100644
--- a/lib/scsi-lowlevel.c
+++ b/lib/scsi-lowlevel.c
@@ -1086,6 +1086,7 @@ scsi_maintenancein_datain_getfullsize(struct scsi_task *task)
(task_get_uint8(task, 1) & 0x80) ? 12 : 0 +
task_get_uint16(task, 2);
}
+ return -1;
default:
return -1;
}
diff --git a/lib/sync.c b/lib/sync.c
index f8a139c..0ceb0cb 100644
--- a/lib/sync.c
+++ b/lib/sync.c
@@ -88,10 +88,8 @@ iscsi_sync_cb(struct iscsi_context *iscsi _U_, int status,
{
struct iscsi_sync_state *state = private_data;
- if (state != NULL) {
- state->status = status;
- state->finished = 1;
- }
+ state->status = status;
+ state->finished = 1;
}
int
@@ -1871,11 +1869,9 @@ iscsi_discovery_cb(struct iscsi_context *iscsi _U_, int status,
}
}
- if (state != NULL) {
- state->status = status;
- state->finished = 1;
- state->ptr = dahead;
- }
+ state->status = status;
+ state->finished = 1;
+ state->ptr = dahead;
}
struct iscsi_discovery_address *

212
SPECS/libiscsi.spec

@ -1,52 +1,30 @@ @@ -1,52 +1,30 @@
Name: libiscsi
Summary: iSCSI client library
Version: 1.9.0
Release: 7%{?dist}
Version: 1.18.0
Release: 1%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: https://github.com/sahlberg/%{name}

Source: https://github.com/downloads/sahlberg/%{name}/%{name}-%{version}.tar.gz
Patch1: 0001-do-not-reconnect-if-reconnect-is-already-defered.patch
Patch2: 0002-fix-leak-of-iscsi_context-in-iscsi_reconnect.patch
Patch3: 0003-Add-ASCQ-codes-related-to-thin-provisioning.patch
Patch4: 0004-Create-safe-16-32-64-bit-accessors-for-reading-from-.patch
Patch5: 0005-fix-bug-in-md5-code.patch
Patch6: 0006-use-libgcrypt-for-MD5.patch
Patch7: 0007-URL-encoded-Targetnames.patch
Patch8: 0008-SCSI-add-a-safe-function-to-read-a-byte-from-the-dat.patch
Patch9: 0009-scsi-lowlevel-do-not-use-unsafe-pointer-casts.patch
Patch10: 0010-Add-a-cast-to-ssize_t.patch
Patch11: 0011-do-not-build-test-tool.patch
Patch12: 0012-bump-soname.patch
Patch13: 0013-disable-ld_iscsi.patch
Patch14: 0014-fix-another-aliasing-problem.patch
Patch15: 0015-fix-arm-aliasing-problem.patch
Patch16: 0016-avoid-casting-struct-sockaddr.patch
Patch18: 0018-cleanup-rename-pdu-written.patch
Patch19: 0019-fix-iovec-short-reads.patch
Patch20: 0020-iscsi_reconnect-Fix-a-use-after-free.patch
Patch21: 0021-Dont-reference-pdu-after-it-has-been-freed.patch
Patch22: 0022-lib-Make-scsi_free_scsi_task-accept-a-NULL-task-pointer.patch
Patch23: 0023-lib-Fix-a-memory-leak-in-scsi_cdb_persistent_reserve_out.patch
Patch24: 0024-reconnect-do-not-initialize-iscsi-to-old_iscsi-use-old_iscsi-if-appropriate.patch
Patch25: 0025-log-failures-typically-malloc-of-iscsi_create_context-during-reconnect.patch
Patch26: 0026-exit-after-malloc-failure-when-allocating-sense-data-blob.patch
Patch27: 0027-do-not-test-arrays-against-NULL.patch
Patch28: 0028-handle-bad-iscsi--fd-in-iscsi_service.patch
Patch29: 0029-rework-login-and-discovery-code-to-avoid-strlen-beyond-end-of-data.patch
Patch30: 0030-check-for-a-target-being-there-before-processing-TargetAddress.patch
Patch31: 0031-fix-CHAP-authentication.patch
# For bz#1266523 - iscsi-ls doesn't work if target has more than one portal
Patch32: libiscsi-Discovery-return-multiple-portals-for-the-same-disco.patch
# For bz#1266523 - iscsi-ls doesn't work if target has more than one portal
Patch33: libiscsi-iscsi-ls-skip-link-local-IPv6-addresses.patch
Source: https://github.com/sahlberg/%{name}/archive/%{version}.tar.gz

# Fix gcc7 warnings
Patch0001: 0001-Fix-compiler-warning-error-under-gcc7.patch
Patch0002: 0002-Fix-another-compiler-warning.patch
# Fix 32bit build
Patch0003: 0003-Fix-32bit-build.patch
# Fix build with latest rdma-core
# Submitted upstream: https://github.com/sahlberg/libiscsi/pull/265
Patch0004: 0004-iser-Use-local-container_of-definition.patch
Patch0005: 0005-fix-ipv6.patch
Patch0006: 0006-fix-coverity-report.patch

BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: popt-devel
#BuildRequires: CUnit-devel
BuildRequires: libgcrypt-devel
BuildRequires: rdma

%description
libiscsi is a library for attaching to iSCSI resources across
@ -62,42 +40,11 @@ a network. @@ -62,42 +40,11 @@ a network.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%autopatch -p1

%build
sh autogen.sh
%configure --libdir=%{libiscsi_libdir}
%configure --libdir=%{libiscsi_libdir} --disable-werror
make %{?_smp_mflags}

%install
@ -110,19 +57,22 @@ rm $RPM_BUILD_ROOT/%{libiscsi_libdir}/libiscsi.la @@ -110,19 +57,22 @@ rm $RPM_BUILD_ROOT/%{libiscsi_libdir}/libiscsi.la
# Remove "*.old" files
find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;

# Remove library put in /usr/bin
rm $RPM_BUILD_ROOT/%{_bindir}/ld_iscsi.so

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING LICENCE-LGPL-2.1.txt README TODO
%license COPYING LICENCE-LGPL-2.1.txt
%doc README TODO
%dir %{libiscsi_libdir}
%{libiscsi_libdir}/libiscsi.so.*
/etc/ld.so.conf.d/*
%config /etc/ld.so.conf.d/*

%package utils
Summary: iSCSI Client Utilities
Group: Applications/System
License: GPLv2+
Requires: %{name}%{?_isa} = %{version}-%{release}

@ -131,65 +81,113 @@ The libiscsi-utils package provides a set of assorted utilities to connect @@ -131,65 +81,113 @@ The libiscsi-utils package provides a set of assorted utilities to connect
to iSCSI servers without having to set up the Linux iSCSI initiator.

%files utils
%doc COPYING LICENCE-GPL-2.txt LICENCE-LGPL-2.1.txt README TODO
%license LICENCE-GPL-2.txt
%{_bindir}/iscsi-ls
%{_bindir}/iscsi-inq
%{_bindir}/iscsi-readcapacity16
%{_bindir}/iscsi-swp
%{_bindir}/iscsi-perf
#%{_bindir}/iscsi-test-cu
%{_mandir}/man1/iscsi-ls.1.gz
%{_mandir}/man1/iscsi-inq.1.gz
%{_mandir}/man1/iscsi-swp.1.gz
%{_mandir}/man1/iscsi-test-cu.1.gz

%package devel
Summary: iSCSI client development libraries
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
The libiscsi-devel package includes the header files for libiscsi.

%files devel
%defattr(-,root,root)
%doc COPYING LICENCE-LGPL-2.1.txt README TODO
%dir %{libiscsi_includedir}
%{libiscsi_includedir}/iscsi.h
%{libiscsi_includedir}/scsi-lowlevel.h
%{libiscsi_libdir}/libiscsi.so
%{_libdir}/pkgconfig/libiscsi.pc

%changelog
* Thu May 26 2016 Miroslav Rezanina <mrezanin@redhat.com> - 1.9.0-7.el7
- libiscsi-Discovery-return-multiple-portals-for-the-same-disco.patch [bz#1266523]
- libiscsi-iscsi-ls-skip-link-local-IPv6-addresses.patch [bz#1266523]
- Resolves: bz#1266523
(iscsi-ls doesn't work if target has more than one portal)
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Nov 30 2018 Paolo Bonzini <pbonzini@redhat.com> - 1.18.0-6
- Backport upstream fix for IPv6 connections
- Backport upstream fix for issues reported by coverity

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Mon Apr 30 2018 Cole Robinson <crobinso@redhat.com> - 1.18.0-4
- Fix build with newer rdma-core

* Fri Mar 23 2018 Cole Robinson <crobinso@redhat.com> - 1.18.0-3
- Fix rdma deps and don't restrict archs
- Add --disable-werror to fix gcc8 build (bz #1556044)
- Spec file cleanups (bz #1483290)

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Oct 03 2017 Paolo Bonzini <pbonzini@redhat.com> - 1.18.0-1
- Rebased to version 1.18.0
- Added patch to fix gcc7 warnings

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.9.0-6
- Mass rebuild 2014-01-24
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu Jan 16 2014 Miroslav Rezanina <mrezanin@redhat.com> - 1.9.0-5
- fix CHAP authentication (bz #1032358)
- Resolves: #1032358
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.9.0-4
- Mass rebuild 2013-12-27
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Nov 07 2013 Miroslav Rezanina <mrezanin@redhat.com> - 1.9.0-3
- Fixed issues reported by coverity (bz #1026820)
- Do not mark /etc/ld.so.conf.d/ as config (bz #1011126)
- Resolves: #1026820
- Resolves: #1011126
* Fri Jun 26 2015 Neal Gompa <ngompa13@gmail.com> - 1.15.0-1
- Rebased to version 1.15.0
- Removed patch 20 as it has been upstreamed
- Disabled patch 12 as need for revised one is in question
- Updated patch 13 to current tree
- New tool iscsi-perf

* Tue Aug 27 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.9.0-2
- Add missing patch 11
- Resolves: #979953
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Tue Aug 27 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.9.0-1
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Thu Jun 12 2014 Paolo Bonzini <pbonzini@redhat.com> - 1.11.0-1
- Rebased to version 1.11.0
- Most patches removed
- New tool iscsi-swp + manpages

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed Apr 23 2014 Tomáš Mráz <tmraz@redhat.com> - 1.9.0-5
- Rebuild for new libgcrypt

* Mon Aug 26 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.9.0-4
- Cleaned up patches 18/19 to match upstream more closely

* Mon Aug 26 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.9.0-3
- Improved patch 18 to cover write side too

* Mon Aug 26 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.9.0-2
- Add patch 18 to fix QEMU's scsi-generic mode

* Fri Aug 2 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.9.0-1
- Rebase to 1.9.0
- Cherry-pick selected patches from upstream
- Resolves: #979953

* Thu Aug 1 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.7.0-6
- Add patch 6 to properly support escaped URIs produced by libvirt

* Mon Jul 1 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.7.0-5
* Mon Jul 1 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.7.0-6
- Add patch 5 to silence strict aliasing warnings

* Wed Jun 26 2013 Andy Grover <agrover@redhat.com> - 1.7.0-5
- Add patch 4 to enable installing of iscsi-test binary

* Fri May 3 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.7.0-4
- Add patch 2 for FIPS mode
- Add patch 3 to avoid segmentation fault on iscsi-tools
@ -197,10 +195,10 @@ The libiscsi-devel package includes the header files for libiscsi. @@ -197,10 +195,10 @@ The libiscsi-devel package includes the header files for libiscsi.
* Thu Mar 7 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.7.0-3
- Correct license for libiscsi-utils, prefer %%global to %%define
- Add Requires
- Remove %clean section
- Remove percent-clean section

* Fri Feb 22 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.7.0-2
- Use %config for ld.so.conf.d file.
- Use percent-config for ld.so.conf.d file.

* Fri Feb 22 2013 Paolo Bonzini <pbonzini@redhat.com> - 1.7.0-1
- Initial version (bug 914752)

Loading…
Cancel
Save