<div dir="ltr">Applied,<div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 5, 2015 at 10:19 PM, Gabriel Krisman Bertazi <span dir="ltr"><<a href="mailto:krisman@linux.vnet.ibm.com" target="_blank">krisman@linux.vnet.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">vendor_id and product_id information are not shown when displaying<br>
multipath topology if the first path is down.<br>
<br>
0QEMU_QEMU_HARDDISK_HELLOWORLD dm-0 , <--- Missing vendor and product<br>
size=10G features='0' hwhandler='0' wp=rw<br>
|-+- policy='service-time 0' prio=0 status=active<br>
| `- #:#:#:# - #:# active undef running<br>
`-+- policy='service-time 0' prio=0 status=enabled<br>
`- 2:0:1:0 sdd 8:48 active undef running<br>
<br>
This happens because we only look at the first_path when printing the<br>
topology. This patch looks at every slot in the path vector until we<br>
find one with the correct value.<br>
<br>
Signed-off-by: Gabriel Krisman Bertazi <<a href="mailto:krisman@linux.vnet.ibm.com">krisman@linux.vnet.ibm.com</a>><br>
---<br>
libmultipath/print.c | 19 ++++++++++++++-----<br>
1 file changed, 14 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/libmultipath/print.c b/libmultipath/print.c<br>
index 6594fee..fb2551e 100644<br>
--- a/libmultipath/print.c<br>
+++ b/libmultipath/print.c<br>
@@ -248,11 +248,20 @@ snprint_multipath_uuid (char * buff, size_t len, struct multipath * mpp)<br>
static int<br>
snprint_multipath_vpr (char * buff, size_t len, struct multipath * mpp)<br>
{<br>
- struct path * pp = first_path(mpp);<br>
- if (!pp)<br>
- return 0;<br>
- return snprintf(buff, len, "%s,%s",<br>
- pp->vendor_id, pp->product_id);<br>
+ struct pathgroup * pgp;<br>
+ struct path * pp;<br>
+ int i, j;<br>
+<br>
+ vector_foreach_slot(mpp->pg, pgp, i) {<br>
+ if (!pgp)<br>
+ continue;<br>
+ vector_foreach_slot(pgp->paths, pp, j) {<br>
+ if (strlen(pp->vendor_id) && strlen(pp->product_id))<br>
+ return snprintf(buff, len, "%s,%s",<br>
+ pp->vendor_id, pp->product_id);<br>
+ }<br>
+ }<br>
+ return snprintf(buff, len, "##,##");<br>
}<br>
<br>
static int<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a><br>
</font></span></blockquote></div><br></div>