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

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