diff --git a/0016-iscsi-inq-handle-setting-of-debug_level-correctly.patch b/0016-iscsi-inq-handle-setting-of-debug_level-correctly.patch new file mode 100644 index 0000000000000000000000000000000000000000..baf9d23f2517022da3dfd13359a45255af238a2f --- /dev/null +++ b/0016-iscsi-inq-handle-setting-of-debug_level-correctly.patch @@ -0,0 +1,53 @@ +From 5e638532306aad854200cee86b454c15a14a0139 Mon Sep 17 00:00:00 2001 +From: Wenchao Hao +Date: Wed, 6 Apr 2022 10:28:23 +0800 +Subject: [PATCH] iscsi-inq: handle setting of debug_level correctly + +According to the man page and help info, --debug=integer can specify the +debug_level, while it would report following error: + +iscsi-inq --debug=2 +iscsi-inq: option '--debug' doesn't allow an argument + +It's because the iscsi-inq code did not handle this parameters +correctly. So here we just correct it. + +Signed-off-by: Wenchao Hao +--- + utils/iscsi-inq.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/utils/iscsi-inq.c b/utils/iscsi-inq.c +index 24016fd..54d17ca 100644 +--- a/utils/iscsi-inq.c ++++ b/utils/iscsi-inq.c +@@ -241,7 +241,7 @@ int main(int argc, char *argv[]) + static struct option long_options[] = { + {"help", no_argument, NULL, 'h'}, + {"usage", no_argument, NULL, 'u'}, +- {"debug", no_argument, NULL, 'd'}, ++ {"debug", required_argument, NULL, 'd'}, + {"initiator-name", required_argument, NULL, 'i'}, + {"evpd", required_argument, NULL, 'e'}, + {"pagecode", required_argument, NULL, 'c'}, +@@ -249,7 +249,7 @@ int main(int argc, char *argv[]) + }; + int option_index; + +- while ((c = getopt_long(argc, argv, "h?udi:e:c:", long_options, ++ while ((c = getopt_long(argc, argv, "h?ud:i:e:c:", long_options, + &option_index)) != -1) { + switch (c) { + case 'h': +@@ -260,7 +260,7 @@ int main(int argc, char *argv[]) + show_usage = 1; + break; + case 'd': +- debug = 1; ++ debug = atoi(optarg); + break; + case 'i': + initiator = optarg; +-- +2.27.0 + diff --git a/libiscsi.spec b/libiscsi.spec index d27c4e3b4f9233c753e4d7a7fd4b70d1ad671dfd..09bc51e6df8c28ab59b9c3e13706fcb2fd461f32 100644 --- a/libiscsi.spec +++ b/libiscsi.spec @@ -1,6 +1,6 @@ Name: libiscsi Version: 1.19.0 -Release: 6 +Release: 7 Summary: Client-side library to implement the iSCSI protocol Recommends: %{name}-utils License: LGPLv2+ and GPLv2+ @@ -19,8 +19,9 @@ Patch10: 0010-test-tool-CryptoEraseReserved-override-driver-queue_.patch Patch11: 0011-test-tool-OverwriteReserved-skip-unless-iSCSI.patch Patch12: 0012-test-tool-OverwriteReserved-override-driver-queue_pd.patch Patch13: 0013-test-tool-remove-unused-iscsi_queue_pdu-symbol-overl.patch -Patch14: 0014-iser-remove-__packed-from-struct-iser_cm_hdr-declaration.patch +Patch14: 0014-iser-remove-__packed-from-struct-iser_cm_hdr-declaration.patch Patch15: 0015-test-tools-use-extern-init-in-headers.patch +Patch16: 0016-iscsi-inq-handle-setting-of-debug_level-correctly.patch Source: https://github.com/sahlberg/%{name}/archive/%{version}.tar.gz @@ -122,6 +123,9 @@ This package contains utilities of %{name} to connect to iSCSI targets %{_bindir}/iscsi-test-cu %changelog +* Tue Apr 12 2022 haowenchao - 1.19.0-7 +- DESC: iscsi-inq: handle setting of debug_level correctly + * Fri Jul 30 2021 chenyanpanHW - 1.19.0-6 - DESC: delete -Sgit from %autosetup, and delete BuildRequires git