All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Martin Wilck <Martin.Wilck@suse.com>
Subject: [PATCH v2 09/17] libmultipath: add vend_id to get_vpd_sgio
Date: Wed,  5 Feb 2020 12:58:12 -0600	[thread overview]
Message-ID: <1580929100-32572-10-git-send-email-bmarzins@redhat.com> (raw)
In-Reply-To: <1580929100-32572-1-git-send-email-bmarzins@redhat.com>

This tells multipath how it should decode vendor specific pages. It will
be used by a future patch.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/discovery.c |  4 ++--
 libmultipath/discovery.h |  2 +-
 libmultipath/propsel.c   |  2 +-
 tests/vpd.c              | 10 +++++-----
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 3c72a80a..1d79cbae 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1135,7 +1135,7 @@ get_vpd_sysfs (struct udev_device *parent, int pg, char * str, int maxlen)
 }
 
 int
-get_vpd_sgio (int fd, int pg, char * str, int maxlen)
+get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen)
 {
 	int len, buff_len;
 	unsigned char buff[4096];
@@ -1810,7 +1810,7 @@ static ssize_t uid_fallback(struct path *pp, int path_state,
 		if (len < 0 && path_state == PATH_UP) {
 			condlog(1, "%s: failed to get sysfs uid: %s",
 				pp->dev, strerror(-len));
-			len = get_vpd_sgio(pp->fd, 0x83, pp->wwid,
+			len = get_vpd_sgio(pp->fd, 0x83, 0, pp->wwid,
 					   WWID_SIZE);
 			*origin = "sgio";
 		}
diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h
index 8d04c2af..2f2fd9eb 100644
--- a/libmultipath/discovery.h
+++ b/libmultipath/discovery.h
@@ -35,7 +35,7 @@ int path_get_tpgs(struct path *pp); /* This function never returns TPGS_UNDEF */
 int do_tur (char *);
 int path_offline (struct path *);
 int get_state (struct path * pp, struct config * conf, int daemon, int state);
-int get_vpd_sgio (int fd, int pg, char * str, int maxlen);
+int get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen);
 int pathinfo (struct path * pp, struct config * conf, int mask);
 int alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
 			      const char *wwid, int flag, struct path **pp_ptr);
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index 27e8d68a..b5b5b89f 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -490,7 +490,7 @@ check_rdac(struct path * pp)
 	if (__do_set_from_hwe(checker_name, pp, checker_name) &&
 	    strcmp(checker_name, RDAC))
 		return 0;
-	len = get_vpd_sgio(pp->fd, 0xC9, buff, 44);
+	len = get_vpd_sgio(pp->fd, 0xC9, 0, buff, 44);
 	if (len <= 0)
 		return 0;
 	return !(memcmp(buff + 4, "vac1", 4));
diff --git a/tests/vpd.c b/tests/vpd.c
index 1e653ed4..0331c487 100644
--- a/tests/vpd.c
+++ b/tests/vpd.c
@@ -429,7 +429,7 @@ static void test_vpd_vnd_ ## len ## _ ## wlen(void **state)             \
 	free(exp_wwid);							\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_vnd_" #len "_" #wlen,		\
 			    exp_len, ret, '1', 0, false,		\
 			    exp_subst, vt->wwid);			\
@@ -459,7 +459,7 @@ static void test_vpd_str_ ## typ ## _ ## len ## _ ## wlen(void **state) \
 		exp_len = wlen - 1;					\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_str_" #typ "_" #len "_" #wlen,	\
 			    exp_len, ret, byte0[type], 0,		\
 			    type != STR_IQN,				\
@@ -496,7 +496,7 @@ static void test_vpd_naa_ ## naa ## _ ## wlen(void **state)             \
 			 3, naa, 0);					\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_naa_" #naa "_" #wlen,		\
 			    exp_len, ret, '3', '0' + naa, true,		\
 			    test_id, vt->wwid);				\
@@ -527,7 +527,7 @@ static void test_vpd_eui_ ## len ## _ ## wlen ## _ ## sml(void **state)	\
 	}								\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_eui_" #len "_" #wlen "_" #sml,	\
 			    exp_len, ret, '2', 0, true,			\
 			    test_id, vt->wwid);				\
@@ -554,7 +554,7 @@ static void test_vpd80_ ## size ## _ ## len ## _ ## wlen(void **state)  \
 			 size, len);					\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x80, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x80, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd80_" #size "_" #len "_" #wlen,	\
 			    exp_len, ret, 0, 0, false,			\
 			    input, vt->wwid);				\
-- 
2.17.2

  parent reply	other threads:[~2020-02-05 18:58 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 18:58 [PATCH v2 00/17] Multipath patch dump Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 01/17] multipathd: warn when configuration has been changed Benjamin Marzinski
2020-02-10 14:22   ` Martin Wilck
2020-02-05 18:58 ` [PATCH v2 02/17] multipathd: staticify uxlsnr variables/functions Benjamin Marzinski
2020-02-10 14:24   ` Martin Wilck
2020-02-05 18:58 ` [PATCH v2 03/17] libmultipath: fix leak in foreign code Benjamin Marzinski
2020-02-11  9:36   ` Martin Wilck
2020-02-11 22:47     ` Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 04/17] Fix leak in mpathpersist Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 05/17] libmultipath: remove unused path->prio_args Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 06/17] libmultipath: constify get_unaligned_be* Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 07/17] libmultipath: add missing hwe mpe variable merges Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 08/17] libmultipath: fix sgio_get_vpd looping Benjamin Marzinski
2020-02-10 14:35   ` Martin Wilck
2020-02-05 18:58 ` Benjamin Marzinski [this message]
2020-02-05 18:58 ` [PATCH v2 10/17] libmultipath: add code to get vendor specific vpd data Benjamin Marzinski
2020-02-10 14:49   ` Martin Wilck
2020-02-10 20:49     ` Benjamin Marzinski
2020-02-11  8:09       ` Martin Wilck
2020-02-11  8:39   ` Martin Wilck
2020-02-05 18:58 ` [PATCH v2 11/17] libmultipath: change how the checker async is set Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 12/17] libmultipath: change failed path prio timeout Benjamin Marzinski
2020-02-10 14:51   ` Martin Wilck
2020-02-05 18:58 ` [PATCH v2 13/17] multipathd: add new paths under vecs lock Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 14/17] libmultipath: add new checker class functions Benjamin Marzinski
2020-02-05 18:58 ` [PATCH v2 15/17] libmultipath: make directio checker share io contexts Benjamin Marzinski
2020-02-10 17:08   ` Martin Wilck
2020-02-10 23:15     ` Benjamin Marzinski
2020-02-11  8:38       ` Martin Wilck
2020-02-11 22:21         ` Benjamin Marzinski
2020-02-11  8:42   ` Martin Wilck
2020-02-05 18:58 ` [PATCH v2 16/17] tests: add directio unit tests Benjamin Marzinski
2020-02-10 17:23   ` Martin Wilck
2020-02-05 18:58 ` [PATCH v2 17/17] tests: make directio tests able to work on a real device Benjamin Marzinski
2020-02-10 17:27   ` Martin Wilck
2020-02-11  8:45 ` [PATCH v2 00/17] Multipath patch dump Martin Wilck
2020-02-11 10:18   ` Martin Wilck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1580929100-32572-10-git-send-email-bmarzins@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=Martin.Wilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.