From nobody Mon Feb 9 13:08:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1609801169; cv=none; d=zohomail.com; s=zohoarc; b=dEem23CO88Rv2fjuz+WLWjm6t5xB5X1JN/j4KaHjbesilkk3n3TPjAoMwmn+nIx/b1H2rgfDf5qxDYCcYTm2eX/zmN92b7Doup5M0ViTYx/EyV7NtxZrNoInolvoQSA6u8cqZU8hOWJr4s6Qkec7ZXQPgvUlobS/2/SYcAqDEao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609801169; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=cbme4x48GIiIl7113/1JiJFDJaCokY0b9TUtox4Fv6E=; b=ThpIG1+m12J1Q0iNgvk+kwQME/c8wMWI1c8hqWyvCdbPxsgbP4KpdiSNECVWTRhHnwtY9VmLiyr9pc/H9OQmGDczD7+kEvVrOcCdJNkwNrIAowNPlGaPdSKs6SVG+lIpziAuowx8Te8TKs0aWmfdC4h9btCam7O19ZrIPb0wctI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1609801169042379.95568572036154; Mon, 4 Jan 2021 14:59:29 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.61608.108481 (Exim 4.92) (envelope-from ) id 1kwYoh-00020p-SI; Mon, 04 Jan 2021 22:59:11 +0000 Received: by outflank-mailman (output) from mailman id 61608.108481; Mon, 04 Jan 2021 22:59:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kwYoh-00020i-Ni; Mon, 04 Jan 2021 22:59:11 +0000 Received: by outflank-mailman (input) for mailman id 61608; Mon, 04 Jan 2021 22:59:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kwYjH-0000oY-Vq for xen-devel@lists.xenproject.org; Mon, 04 Jan 2021 22:53:36 +0000 Received: from mailhost.m5p.com (unknown [74.104.188.4]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 21118051-e2b3-41c1-a8c5-e610e60ebd68; Mon, 04 Jan 2021 22:53:05 +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 104MqumN071518 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 4 Jan 2021 17:53:02 -0500 (EST) (envelope-from ehem@m5p.com) Received: (from ehem@localhost) by m5p.com (8.15.2/8.15.2/Submit) id 104MqulQ071517; Mon, 4 Jan 2021 14:52:56 -0800 (PST) (envelope-from ehem) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 21118051-e2b3-41c1-a8c5-e610e60ebd68 Message-Id: <7335199fc01d8dc6bf524cd764ed8e9107066380.1608663694.git.ehem+xen@m5p.com> In-Reply-To: References: From: Elliott Mitchell To: xen-devel@lists.xenproject.org Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD Date: Sat, 19 Dec 2020 23:43:08 -0800 Subject: [WIP PATCH 16/16] WIP: tools/xl: Enhance "vm-list" command X-Spam-Status: No, score=2.1 required=10.0 tests=DATE_IN_PAST_96_XX, KHOP_HELO_FCRDNS autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mattapan.m5p.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add several features to specify output. Allow omitting potentially unneeded lines and add argument for exact line format. Signed-off-by: Elliott Mitchell --- tools/xl/xl_list.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/xl/xl_list.c b/tools/xl/xl_list.c index 58809aa10b..ef44466017 100644 --- a/tools/xl/xl_list.c +++ b/tools/xl/xl_list.c @@ -500,18 +500,28 @@ int main_list(int argc, char **argv) int main_vm_list(int argc, char **argv) { const char *formatstr =3D "%u %5i %n\n"; + bool dom0 =3D true; + bool header =3D true; int opt; static const struct option opts[] =3D { {"format", 0, 0, 'F'}, + {"no-domain0", 0, 0, '0'}, + {"no-header", 0, 0, 'H'}, }; =20 libxl_vminfo *info; int nb_vm, i; =20 - SWITCH_FOREACH_OPT(opt, "F:", opts, "vm-list", 0) { + SWITCH_FOREACH_OPT(opt, "0F:H", opts, "vm-list", 0) { + case '0': + dom0 =3D false; + break; case 'F': formatstr =3D optarg; break; + case 'H': + header =3D false; + break; } =20 info =3D libxl_list_vm(ctx, &nb_vm); @@ -521,10 +531,10 @@ int main_vm_list(int argc, char **argv) exit(EXIT_FAILURE); } =20 - format(formats_vm, formatstr, NULL); + if (header) format(formats_vm, formatstr, NULL); =20 for (i =3D 0; i < nb_vm; i++) - format(formats_vm, formatstr, info + i); + if (info[i].domid || dom0) format(formats_vm, formatstr, info + i); =20 libxl_vminfo_list_free(info, nb_vm); =20 --=20 --=20 (\___(\___(\______ --=3D> 8-) EHM <=3D-- ______/)___/)___= /) \BS ( | ehem+sigmsg@m5p.com PGP 87145445 | ) / \_CS\ | _____ -O #include O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445