From: Masatake YAMATO <yamato@redhat.com>
To: kzak@redhat.com
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 1/2] lsns: add netnsid column
Date: Tue, 21 Nov 2017 20:36:33 +0900 (JST) [thread overview]
Message-ID: <20171121.203633.949035400852899096.yamato@redhat.com> (raw)
In-Reply-To: <20171121111641.dt3vodjsuwwnna6g@ws.net.home>
So, my biggest question is "should I send an updated version of patch?" :-)
You wrote in https://marc.info/?l=util-linux-ng&m=151074416720085&w=2:
> I'm ready to do all the changes (you don't have to resend the patch).
I think you may have improved version of code.
I would like to start from it for reflecting the new comments (if I should do).
Masatake YAMATO
> On Thu, Nov 16, 2017 at 03:24:39AM +0900, Masatake YAMATO wrote:
>> By parsing this file (with libmount), we can say
>> /run/netns/UTIL-LINUX-LSNS-TEST-NS is the logical name for
>> net:[4026532562] either the mount point is created by ip command or
>> not.
>
> Nice. Yes, all you need is:
>
> tab = mnt_new_table_from_file(_PATH_PROC_MOUNTINFO);
>
> .. see for example sys-utils/fstrim.c, and mnt_fs_get_fstype() and
> mnt_fs_get_source().
>
>> "ip link show" still uses netnsid, so I think my patch still makes
>> sense. However, as you wrote, making a column for logical name,
>> is more useful. It is not limited to net namespace.
>>
>> A namespace can have more than one logical names.
>> I wonder how to print them in a column.
>
> libsmart supports multi-line cells:
>
> * use SCOLS_FL_WRAP for the column
>
> * set wrap function, for example in lsns.c: init_scols_table():
>
> cl = scols_table_new_column(tab, col->name, col->whint, flags)
>
> if (flags & SCOLS_FL_WRAP) {
> scols_column_set_wrapfunc(cl,
> scols_wrapnl_chunksize,
> scols_wrapnl_nextchunk,
> NULL);
> scols_column_set_safechars(cl, "\n");
> }
>
>
> * and in add_scols_line() where you compose output add to the table
> string where namespace names are separated by '\n', e.g. "aaa\nbbb"
>
>
> This feature should be probably disabled for --raw, maybe add --nowrap
> and in this case use "," as separator and remove SCOLS_FL_WRAP for the
> column in init_scols_table().
>
> Karel
>
> --
> Karel Zak <kzak@redhat.com>
> http://karelzak.blogspot.com
next prev parent reply other threads:[~2017-11-21 11:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 2:59 [PATCH 1/2] lsns: add netnsid column Masatake YAMATO
2017-11-15 2:59 ` [PATCH 2/2] lsns: add a case for testing " Masatake YAMATO
2017-11-15 11:09 ` [PATCH 1/2] lsns: add " Karel Zak
2017-11-15 18:24 ` Masatake YAMATO
2017-11-21 11:16 ` Karel Zak
2017-11-21 11:36 ` Masatake YAMATO [this message]
2017-11-22 9:06 ` Karel Zak
2017-11-23 17:01 ` Masatake YAMATO
2017-11-24 9:28 ` Karel Zak
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=20171121.203633.949035400852899096.yamato@redhat.com \
--to=yamato@redhat.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).