2021-03-26 18:33:56 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
|
Date: Thu, 25 Mar 2021 13:05:10 -0500
|
|
|
|
Subject: [PATCH] RH: make parse_vpd_pg83 match scsi_id output
|
|
|
|
|
|
|
|
Red Hat sets ID_SERIAL based on the result of scsi_id, instead of using
|
|
|
|
the result of sg_inq and 55-scsi-sg3_id.rules. Make parse_vpd_pg83 match
|
|
|
|
that.
|
|
|
|
|
|
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
|
---
|
2022-03-28 20:47:01 +00:00
|
|
|
libmultipath/discovery.c | 12 ++----------
|
2021-12-13 19:09:30 +00:00
|
|
|
tests/vpd.c | 6 ++++++
|
2022-03-28 20:47:01 +00:00
|
|
|
2 files changed, 8 insertions(+), 10 deletions(-)
|
2021-03-26 18:33:56 +00:00
|
|
|
|
|
|
|
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
2022-07-13 21:51:42 +00:00
|
|
|
index 0d8a558c..0c73b754 100644
|
2021-03-26 18:33:56 +00:00
|
|
|
--- a/libmultipath/discovery.c
|
|
|
|
+++ b/libmultipath/discovery.c
|
2022-07-13 21:51:42 +00:00
|
|
|
@@ -1177,13 +1177,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
|
2022-03-28 20:47:01 +00:00
|
|
|
good_len = 8;
|
2021-03-26 18:33:56 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
- /* IEEE Extended: Prio 6 */
|
2022-03-28 20:47:01 +00:00
|
|
|
- new_prio = 6;
|
|
|
|
- good_len = 8;
|
2021-03-26 18:33:56 +00:00
|
|
|
- break;
|
|
|
|
case 3:
|
|
|
|
- /* IEEE Locally assigned: Prio 1 */
|
2022-03-28 20:47:01 +00:00
|
|
|
- new_prio = 1;
|
2021-03-26 18:33:56 +00:00
|
|
|
+ /* IEEE Extended or Locally assigned: Prio 6 */
|
2022-03-28 20:47:01 +00:00
|
|
|
+ new_prio = 6;
|
|
|
|
good_len = 8;
|
2021-03-26 18:33:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
2022-07-13 21:51:42 +00:00
|
|
|
@@ -1201,10 +1197,6 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
|
2022-03-28 20:47:01 +00:00
|
|
|
break;
|
|
|
|
case 0x8:
|
|
|
|
/* SCSI Name: Prio 3 */
|
|
|
|
- invalid = (d[3] < 4 || (memcmp(d + 4, "eui.", 4) &&
|
|
|
|
- memcmp(d + 4, "naa.", 4) &&
|
|
|
|
- memcmp(d + 4, "iqn.", 4)));
|
|
|
|
- new_prio = 3;
|
2021-03-26 18:33:56 +00:00
|
|
|
break;
|
|
|
|
case 0x1:
|
|
|
|
/* T-10 Vendor ID: Prio 2 */
|
2021-12-13 19:09:30 +00:00
|
|
|
diff --git a/tests/vpd.c b/tests/vpd.c
|
2022-03-28 20:47:01 +00:00
|
|
|
index a7d2092c..2366cfba 100644
|
2021-12-13 19:09:30 +00:00
|
|
|
--- a/tests/vpd.c
|
|
|
|
+++ b/tests/vpd.c
|
2022-03-28 20:47:01 +00:00
|
|
|
@@ -231,11 +231,13 @@ static const char * const str_prefix[] = {
|
2021-12-13 19:09:30 +00:00
|
|
|
[STR_IQN] = "iqn.",
|
|
|
|
};
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
static const char byte0[] = {
|
|
|
|
[STR_EUI] = '2',
|
|
|
|
[STR_NAA] = '3',
|
|
|
|
[STR_IQN] = '8',
|
|
|
|
};
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* create_scsi_string_desc() - create a SCSI name string descriptor.
|
2022-03-28 20:47:01 +00:00
|
|
|
@@ -766,6 +768,7 @@ make_test_vpd_naa(2, 18);
|
2021-12-13 19:09:30 +00:00
|
|
|
make_test_vpd_naa(2, 17);
|
|
|
|
make_test_vpd_naa(2, 16);
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/* SCSI Name string: EUI64, WWID size: 17 */
|
|
|
|
make_test_vpd_str(0, 20, 18)
|
|
|
|
make_test_vpd_str(0, 20, 17)
|
2022-03-28 20:47:01 +00:00
|
|
|
@@ -801,6 +804,7 @@ make_test_vpd_str(18, 20, 18)
|
2021-12-13 19:09:30 +00:00
|
|
|
make_test_vpd_str(18, 20, 17)
|
|
|
|
make_test_vpd_str(18, 20, 16)
|
|
|
|
make_test_vpd_str(18, 20, 15)
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
static int test_vpd(void)
|
|
|
|
{
|
2022-03-28 20:47:01 +00:00
|
|
|
@@ -909,6 +913,7 @@ static int test_vpd(void)
|
2021-12-13 19:09:30 +00:00
|
|
|
cmocka_unit_test(test_vpd_naa_2_18),
|
|
|
|
cmocka_unit_test(test_vpd_naa_2_17),
|
|
|
|
cmocka_unit_test(test_vpd_naa_2_16),
|
|
|
|
+/*
|
|
|
|
cmocka_unit_test(test_vpd_str_0_20_18),
|
|
|
|
cmocka_unit_test(test_vpd_str_0_20_17),
|
|
|
|
cmocka_unit_test(test_vpd_str_0_20_16),
|
2022-03-28 20:47:01 +00:00
|
|
|
@@ -933,6 +938,7 @@ static int test_vpd(void)
|
2021-12-13 19:09:30 +00:00
|
|
|
cmocka_unit_test(test_vpd_str_18_20_17),
|
|
|
|
cmocka_unit_test(test_vpd_str_18_20_16),
|
|
|
|
cmocka_unit_test(test_vpd_str_18_20_15),
|
|
|
|
+*/
|
|
|
|
};
|
|
|
|
return cmocka_run_group_tests(tests, setup, teardown);
|
|
|
|
}
|