All of lore.kernel.org
 help / color / mirror / Atom feed
* [WIP PATCH 00/16] Addition of formatting options to `xl list` subcommands
@ 2020-12-22 19:01 Elliott Mitchell
  2020-12-09 22:34 ` [WIP PATCH 14/16] WIP: tools/xl: Enhance "list" command Elliott Mitchell
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Elliott Mitchell @ 2020-12-22 19:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu, Anthony PERARD

The first 8 patches should be fairly uncontroversial, and could be
preemptively applied before the rest are ready.  They fell out as part
of trying to implement my first step; splitting a few xl subcommands off
of xl_info.c.

Found several functions in libxl which could have arguments marked const.
Reorganized the interrelated set of printf_info(),
list_domains_details(), printf_info_sexp() and printf_info_one_json().

The problem was list_domains_details() (replaced/renamed
dump_by_dominfo_list()) was best suited towards remaining in xl_info.c,
but main_list() was moved to xl_list.c.

One concern with the split, I tested which headers were actually
required.  I expected some to be required by one or the other file, and
not both.  Yet in the process I found my system didn't need <sys/stat.h>,
<sys/types.h>, nor <libxlutil.h> in *either* resultant file.  I have a
concern these headers may be needed on other's systems even though my
build didn't require them.  In fact this is a concern for most of the
headers which my system only required for one file.


The goal of this series is to drastically increase the utility of the
`xl list` subcommand.  Prior to this the limit of control was merely
enabling the output of 4 groups of extra columns.  The order of columns
couldn't be specified, nor could specific subsets be specified.  There
was also no allowance for for using null line terminators.

With this series all of this becomes possible.  Additionally for more
flexible use with scripting, it is now possible to omit the initial
header and Domain 0.

Unfortunately the output isn't *precisely* what was produced previously,
but it is very similar.

Also, some of the output columns are things which I don't have tester
for.  I'm pretty sure I've got the "context", "claimed" and
"shutdown reason" fields right, but I'm not setup to reliably produce
those states.  Thus for these three my testing is minimal, but the code
is standard enough to be confident in.

The CPU Pool and NODE Affinity fields are things I haven't played with at
all.  While I'm hopeful I adapted the code appropriately, these *need*
testing by someone with an appropriate setup.


I fully expect the last 8 patches to be partially or fully merged
together when this becomes ready.


There is one big wart.  At this revision, format_node() makes two
allocations which are lost at exit.  This isn't a big issue since they're
only allocated *once*, but certainly isn't optimal.


Elliott Mitchell (16):
  tools/libxl: Mark pointer args of many functions constant
  tools/libxl: Tiny optimization of libxl__mac_is_default()
  tools/xl: Mark libxl_domain_config * arg of printf_info_*() const
  tools/xl: Rename printf_info()/list_domains_details() to dump_by_...()
  tools/xl: Merge down debug/dry-run section of create_domain()
  tools/xl: Split list commands off of xl_info.c
  tools/xl: Sort list command options
  tools/xl: Fix potential deallocation bug
  WIP: tools/xl: Implement generalized output formatting for `xl list`
  WIP: tools/xl: Implement output format option
  WIP: tools/xl: Replace most of list_domains with use of format()
  WIP: UNTESTED: tools/xl: Replace remaining options with format()
  WIP: tools/xl: Purge list_domains()
  WIP: tools/xl: Enhance "list" command
  WIP: tools/xl: Implement output format option for "vm-list" command
  WIP: tools/xl: Enhance "vm-list" command

 tools/include/libxl_json.h        |  22 +-
 tools/libs/light/gentypes.py      |   8 +-
 tools/libs/light/libxl_cpuid.c    |   2 +-
 tools/libs/light/libxl_internal.c |   8 +-
 tools/libs/light/libxl_internal.h |  18 +-
 tools/libs/light/libxl_json.c     |  18 +-
 tools/libs/light/libxl_nocpuid.c  |   4 +-
 tools/xl/Makefile                 |   2 +-
 tools/xl/xl.h                     |  10 +-
 tools/xl/xl_cmdtable.c            |  27 +-
 tools/xl/xl_info.c                | 251 +------------
 tools/xl/xl_list.c                | 587 ++++++++++++++++++++++++++++++
 tools/xl/xl_misc.c                |   5 +-
 tools/xl/xl_sxp.c                 |   6 +-
 tools/xl/xl_vmcontrol.c           |  14 +-
 15 files changed, 684 insertions(+), 298 deletions(-)
 create mode 100644 tools/xl/xl_list.c

-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-01-04 22:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 19:01 [WIP PATCH 00/16] Addition of formatting options to `xl list` subcommands Elliott Mitchell
2020-12-09 22:34 ` [WIP PATCH 14/16] WIP: tools/xl: Enhance "list" command Elliott Mitchell
2020-12-09 22:34 ` [WIP PATCH 07/16] tools/xl: Sort list command options Elliott Mitchell
2020-12-09 22:45 ` [WIP PATCH 06/16] tools/xl: Split list commands off of xl_info.c Elliott Mitchell
2020-12-10 23:09 ` [WIP PATCH 09/16] WIP: tools/xl: Implement generalized output formatting for `xl list` Elliott Mitchell
2020-12-10 23:09 ` [WIP PATCH 10/16] WIP: tools/xl: Implement output format option Elliott Mitchell
2020-12-10 23:09 ` [WIP PATCH 08/16] tools/xl: Fix potential deallocation bug Elliott Mitchell
2020-12-12  6:18 ` [WIP PATCH 11/16] WIP: tools/xl: Replace most of list_domains with use of format() Elliott Mitchell
2020-12-13  4:42 ` [WIP PATCH 12/16] WIP: UNTESTED: tools/xl: Replace remaining options with format() Elliott Mitchell
2020-12-13  5:14 ` [WIP PATCH 13/16] WIP: tools/xl: Purge list_domains() Elliott Mitchell
2020-12-18  1:42 ` [WIP PATCH 04/16] tools/xl: Rename printf_info()/list_domains_details() to dump_by_...() Elliott Mitchell
2020-12-18  1:42 ` [WIP PATCH 05/16] tools/xl: Merge down debug/dry-run section of create_domain() Elliott Mitchell
2020-12-18 21:32 ` [WIP PATCH 03/16] tools/xl: Mark libxl_domain_config * arg of printf_info_*() const Elliott Mitchell
2020-12-18 21:37 ` [WIP PATCH 01/16] tools/libxl: Mark pointer args of many functions constant Elliott Mitchell
2020-12-18 22:45 ` [WIP PATCH 02/16] tools/libxl: Tiny optimization of libxl__mac_is_default() Elliott Mitchell
2020-12-19  7:23 ` [WIP PATCH 15/16] WIP: tools/xl: Implement output format option for "vm-list" command Elliott Mitchell
2020-12-20  7:43 ` [WIP PATCH 16/16] WIP: tools/xl: Enhance " Elliott Mitchell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.