mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen-tmem-list-parse: fix ugly parse output
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 <dan.magenheimer@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com> xen-unstable changeset: 26147:3186c04af582 Backport-requested-by: Dan Magenheimer <dan.magenheimer@oracle.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
45cc0581c6
commit
86d10f2be0
1 file changed
+2
@@ -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) "
|
||||
|
||||