From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DATE_IN_PAST_96_XX, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A289DC433DB for ; Mon, 4 Jan 2021 22:50:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5139A2072E for ; Mon, 4 Jan 2021 22:50:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5139A2072E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=m5p.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.61516.108337 (Exim 4.92) (envelope-from ) id 1kwYfm-0008AW-CL; Mon, 04 Jan 2021 22:49:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 61516.108337; Mon, 04 Jan 2021 22:49:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kwYfm-0008AP-8C; Mon, 04 Jan 2021 22:49:58 +0000 Received: by outflank-mailman (input) for mailman id 61516; Mon, 04 Jan 2021 22:49:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kwYfl-0008AK-9t for xen-devel@lists.xenproject.org; Mon, 04 Jan 2021 22:49:57 +0000 Received: from mailhost.m5p.com (unknown [74.104.188.4]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5ddd7041-16bb-4727-8f76-744f2411eb11; Mon, 04 Jan 2021 22:49:56 +0000 (UTC) Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7]) by mailhost.m5p.com (8.15.2/8.15.2) with ESMTPS id 104MnjqH071384 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 4 Jan 2021 17:49:51 -0500 (EST) (envelope-from ehem@m5p.com) Received: (from ehem@localhost) by m5p.com (8.15.2/8.15.2/Submit) id 104MnjLA071383; Mon, 4 Jan 2021 14:49:45 -0800 (PST) (envelope-from ehem) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5ddd7041-16bb-4727-8f76-744f2411eb11 Message-Id: From: Elliott Mitchell To: xen-devel@lists.xenproject.org Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD Date: Tue, 22 Dec 2020 11:01:34 -0800 Subject: [WIP PATCH 00/16] Addition of formatting options to `xl list` subcommands 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 , , nor 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 O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445