Blame SOURCES/0008-libmultipath-add-vend_id-to-get_vpd_sgio.patch

b6d9ac
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b6d9ac
From: Benjamin Marzinski <bmarzins@redhat.com>
b6d9ac
Date: Fri, 1 Nov 2019 12:35:47 -0500
b6d9ac
Subject: [PATCH] libmultipath: add vend_id to get_vpd_sgio
b6d9ac
b6d9ac
This tells multipath how it should decode vendor specific pages. It will
b6d9ac
be used by a future patch.
b6d9ac
b6d9ac
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
b6d9ac
---
b6d9ac
 libmultipath/discovery.c |  4 ++--
b6d9ac
 libmultipath/discovery.h |  2 +-
b6d9ac
 libmultipath/propsel.c   |  2 +-
b6d9ac
 tests/vpd.c              | 10 +++++-----
b6d9ac
 4 files changed, 9 insertions(+), 9 deletions(-)
b6d9ac
b6d9ac
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
b6d9ac
index 3c72a80a..1d79cbae 100644
b6d9ac
--- a/libmultipath/discovery.c
b6d9ac
+++ b/libmultipath/discovery.c
b6d9ac
@@ -1135,7 +1135,7 @@ get_vpd_sysfs (struct udev_device *parent, int pg, char * str, int maxlen)
b6d9ac
 }
b6d9ac
 
b6d9ac
 int
b6d9ac
-get_vpd_sgio (int fd, int pg, char * str, int maxlen)
b6d9ac
+get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen)
b6d9ac
 {
b6d9ac
 	int len, buff_len;
b6d9ac
 	unsigned char buff[4096];
b6d9ac
@@ -1810,7 +1810,7 @@ static ssize_t uid_fallback(struct path *pp, int path_state,
b6d9ac
 		if (len < 0 && path_state == PATH_UP) {
b6d9ac
 			condlog(1, "%s: failed to get sysfs uid: %s",
b6d9ac
 				pp->dev, strerror(-len));
b6d9ac
-			len = get_vpd_sgio(pp->fd, 0x83, pp->wwid,
b6d9ac
+			len = get_vpd_sgio(pp->fd, 0x83, 0, pp->wwid,
b6d9ac
 					   WWID_SIZE);
b6d9ac
 			*origin = "sgio";
b6d9ac
 		}
b6d9ac
diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h
b6d9ac
index 8d04c2af..2f2fd9eb 100644
b6d9ac
--- a/libmultipath/discovery.h
b6d9ac
+++ b/libmultipath/discovery.h
b6d9ac
@@ -35,7 +35,7 @@ int path_get_tpgs(struct path *pp); /* This function never returns TPGS_UNDEF */
b6d9ac
 int do_tur (char *);
b6d9ac
 int path_offline (struct path *);
b6d9ac
 int get_state (struct path * pp, struct config * conf, int daemon, int state);
b6d9ac
-int get_vpd_sgio (int fd, int pg, char * str, int maxlen);
b6d9ac
+int get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen);
b6d9ac
 int pathinfo (struct path * pp, struct config * conf, int mask);
b6d9ac
 int alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
b6d9ac
 			      const char *wwid, int flag, struct path **pp_ptr);
b6d9ac
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
b6d9ac
index 27e8d68a..b5b5b89f 100644
b6d9ac
--- a/libmultipath/propsel.c
b6d9ac
+++ b/libmultipath/propsel.c
b6d9ac
@@ -490,7 +490,7 @@ check_rdac(struct path * pp)
b6d9ac
 	if (__do_set_from_hwe(checker_name, pp, checker_name) &&
b6d9ac
 	    strcmp(checker_name, RDAC))
b6d9ac
 		return 0;
b6d9ac
-	len = get_vpd_sgio(pp->fd, 0xC9, buff, 44);
b6d9ac
+	len = get_vpd_sgio(pp->fd, 0xC9, 0, buff, 44);
b6d9ac
 	if (len <= 0)
b6d9ac
 		return 0;
b6d9ac
 	return !(memcmp(buff + 4, "vac1", 4));
b6d9ac
diff --git a/tests/vpd.c b/tests/vpd.c
b6d9ac
index 4dbce010..02d6e0bb 100644
b6d9ac
--- a/tests/vpd.c
b6d9ac
+++ b/tests/vpd.c
b6d9ac
@@ -431,7 +431,7 @@ static void test_vpd_vnd_ ## len ## _ ## wlen(void **state)             \
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
 	will_return(__wrap_ioctl, n);					\
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
b6d9ac
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
b6d9ac
 	assert_correct_wwid("test_vpd_vnd_" #len "_" #wlen,		\
b6d9ac
 			    exp_len, ret, '1', 0, false,		\
b6d9ac
 			    exp_subst, vt->wwid);			\
b6d9ac
@@ -463,7 +463,7 @@ static void test_vpd_str_ ## typ ## _ ## len ## _ ## wlen(void **state) \
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
 	will_return(__wrap_ioctl, n);					\
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
b6d9ac
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
b6d9ac
 	assert_correct_wwid("test_vpd_str_" #typ "_" #len "_" #wlen,	\
b6d9ac
 			    exp_len, ret, byte0[type], 0,		\
b6d9ac
 			    type != STR_IQN,				\
b6d9ac
@@ -502,7 +502,7 @@ static void test_vpd_naa_ ## naa ## _ ## wlen(void **state)             \
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
 	will_return(__wrap_ioctl, n);					\
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
b6d9ac
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
b6d9ac
 	assert_correct_wwid("test_vpd_naa_" #naa "_" #wlen,		\
b6d9ac
 			    exp_len, ret, '3', '0' + naa, true,		\
b6d9ac
 			    test_id, vt->wwid);				\
b6d9ac
@@ -530,7 +530,7 @@ static void test_vpd_eui_ ## len ## _ ## wlen ## _ ## sml(void **state)	\
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
 	will_return(__wrap_ioctl, n);					\
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
b6d9ac
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
b6d9ac
 	assert_correct_wwid("test_vpd_eui_" #len "_" #wlen "_" #sml,	\
b6d9ac
 			    exp_len, ret, '2', 0, true,			\
b6d9ac
 			    test_id, vt->wwid);				\
b6d9ac
@@ -557,7 +557,7 @@ static void test_vpd80_ ## size ## _ ## len ## _ ## wlen(void **state)  \
b6d9ac
 			 size, len);					\
b6d9ac
 	will_return(__wrap_ioctl, n);					\
b6d9ac
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
b6d9ac
-	ret = get_vpd_sgio(10, 0x80, vt->wwid, wlen);			\
b6d9ac
+	ret = get_vpd_sgio(10, 0x80, 0, vt->wwid, wlen);		\
b6d9ac
 	assert_correct_wwid("test_vpd80_" #size "_" #len "_" #wlen,	\
b6d9ac
 			    exp_len, ret, 0, 0, false,			\
b6d9ac
 			    input, vt->wwid);				\
b6d9ac
-- 
b6d9ac
2.17.2
b6d9ac