From: Dan Magenheimer Subject: Re: [PATCH] xen-tmem-list-parse: fix ugly parse output Date: Tue, 13 Nov 2012 16:08:26 -0800 (PST) Message-ID: <90421d4a-2b5e-49de-9c0f-e4c914980e7f@default> References: <38bc9a60-827c-41f8-a667-e08960b8c135@default> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <38bc9a60-827c-41f8-a667-e08960b8c135@default> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Ian Jackson Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Ping? (Sorry if I am being too impatient... I just saw a tmem hypervisor fix go in and it reminded me to look for this tools fix.) > -----Original Message----- > From: Dan Magenheimer > Sent: Thursday, November 01, 2012 10:43 AM > To: Ian Campbell; Ian Jackson > Cc: xen-devel@lists.xen.org > Subject: [PATCH] xen-tmem-list-parse: fix ugly parse output > > Hmmm... It appears I never posted the corrected version of this patch > so it never made it upstream. See: > > http://lists.xen.org/archives/html/xen-devel/2011-11/msg00587.html > http://lists.xen.org/archives/html/xen-devel/2011-11/msg02145.html > > It would be good if this very minor fix was also applied to 4.2 > (and, if possible, 4.1). > > Thanks, > Dan > > =================== > > The program xen-tmem-list-parse parses the output of xm/xl tmem-list > into human-readable format. A missing NULL terminator sometimes > causes garbage to be spewed where the two-letter pool type > should be output. > > Signed-off-by: Dan Magenheimer > --- > tools/misc/xen-tmem-list-parse.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c > index 977e4d3..f32b107 100644 > --- a/tools/misc/xen-tmem-list-parse.c > +++ b/tools/misc/xen-tmem-list-parse.c > @@ -243,6 +243,7 @@ void parse_pool(char *s) > unsigned long long flush_objs = parse(s,"ot"); > > parse_string(s,"PT",pool_type,2); > + pool_type[2] = '\0'; > if (pool_type[1] == 'S') > return; /* no need to repeat print data for shared pools */ > printf("domid%lu,id%lu[%s]:pgp=%llu(max=%llu) obj=%llu(%llu) " > @@ -286,6 +287,7 @@ void parse_shared_pool(char *s) > unsigned long long flush_objs = parse(s,"ot"); > > parse_string(s,"PT",pool_type,2); > + pool_type[2] = '\0'; > parse_sharers(s,"SC",buf,BUFSIZE); > printf("poolid=%lu[%s] uuid=%llx.%llx, shared-by:%s: " > "pgp=%llu(max=%llu) obj=%llu(%llu) " > -- > 1.7.1