[dm-devel] [PATCH] libmultipath: Fix information not shown when first path is down.
Christophe Varoqui
christophe.varoqui at opensvc.com
Tue Oct 6 06:54:12 UTC 2015
Applied,
Thanks.
On Mon, Oct 5, 2015 at 10:19 PM, Gabriel Krisman Bertazi <
krisman at linux.vnet.ibm.com> wrote:
> vendor_id and product_id information are not shown when displaying
> multipath topology if the first path is down.
>
> 0QEMU_QEMU_HARDDISK_HELLOWORLD dm-0 , <--- Missing vendor and product
> size=10G features='0' hwhandler='0' wp=rw
> |-+- policy='service-time 0' prio=0 status=active
> | `- #:#:#:# - #:# active undef running
> `-+- policy='service-time 0' prio=0 status=enabled
> `- 2:0:1:0 sdd 8:48 active undef running
>
> This happens because we only look at the first_path when printing the
> topology. This patch looks at every slot in the path vector until we
> find one with the correct value.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman at linux.vnet.ibm.com>
> ---
> libmultipath/print.c | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/libmultipath/print.c b/libmultipath/print.c
> index 6594fee..fb2551e 100644
> --- a/libmultipath/print.c
> +++ b/libmultipath/print.c
> @@ -248,11 +248,20 @@ snprint_multipath_uuid (char * buff, size_t len,
> struct multipath * mpp)
> static int
> snprint_multipath_vpr (char * buff, size_t len, struct multipath * mpp)
> {
> - struct path * pp = first_path(mpp);
> - if (!pp)
> - return 0;
> - return snprintf(buff, len, "%s,%s",
> - pp->vendor_id, pp->product_id);
> + struct pathgroup * pgp;
> + struct path * pp;
> + int i, j;
> +
> + vector_foreach_slot(mpp->pg, pgp, i) {
> + if (!pgp)
> + continue;
> + vector_foreach_slot(pgp->paths, pp, j) {
> + if (strlen(pp->vendor_id) &&
> strlen(pp->product_id))
> + return snprintf(buff, len, "%s,%s",
> + pp->vendor_id,
> pp->product_id);
> + }
> + }
> + return snprintf(buff, len, "##,##");
> }
>
> static int
> --
> 2.1.0
>
> --
> dm-devel mailing list
> dm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20151006/614b098f/attachment.htm>
More information about the dm-devel
mailing list