[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 12/23] tools/xl: Print domain capabilities with verbose


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Thu, 6 Mar 2025 17:03:32 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u5QzHpUS/M4+Ej+uoZdfWGBbOum8MFaCVgkFfNvjpZI=; b=O1RpEQEogXejU97OBOdMxGK9X+5NceV1ObfC/5N15vaOflLUInXfr2QjylM7ALrtlEL3LZpFQJgAtAy8aKURnoAAYs38bBQE2ZwbaD4MwUKUXRn4u4XpgAB9zu6CZZbo3KDzT5Y+Sxxb3XkKIHkUO1gd2l0WtNQpEGEiLwIXGn27FUsW73zG4IOWa8g9yHt+5MsBqo0eUsxY0jPbQz8OHK24Stok5NwRXUnnlO6CkkS83aBo23hXBBRHZ1o7633V5KNMT0LnZHQav993wUebvdtjc1sq38XIycXi2yHSSm2vBmmKRGvJoqZRqYMZHfDmz0s176DfVrj4zrT+Bb3tCg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=igBb/rNrJJtTj1OVw/FAjL+qntAwp/wMHNGkLxU36W0poKfz8Li5/B3WvTJ2UnE/7zdUV9yViiewLHaf8Tds4oH0R5cKRy48SJhesxYe4dUir50kx5HEgjKZYmUFdU5lw28ptdChd37K3zcPbE/WlT0lpFGbtQn1qlvgCs+l/+GG1+uSc+e0OZ8jYiLJA+GdBeVd+NjIcrD1+KS0jrwODlGD7nAsUOcSrEiWDGhOMji8beJ1Xw6/nxfXS7tKuLzNZfKP8QTvZZx/4TAhlW1X+3r9tjVqBoLyaFhyKtQUmZ9olWApidzqPPO+XoU0nEjp1FekSy648/kA6JRx9ViC1A==
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Thu, 06 Mar 2025 22:04:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Capabilities are show like this (long lines trimmed):

xl list --verbose
Name          Security Label      Capabilities
Domain-0                   - hardware xenstore
dom0less-1                 -                 -
dom0less-2                 - privileged

Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
 docs/man/xl.1.pod.in |  3 ++-
 tools/xl/xl_info.c   | 24 +++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index fe38724b2b..8e253180a7 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -313,7 +313,8 @@ Also displays the security labels.
 
 =item B<-v>, B<--verbose>
 
-Also displays the domain UUIDs, the shutdown reason and security labels.
+Also displays the domain UUIDs, the shutdown reason, security labels,
+and capabilities.
 
 =item B<-c>, B<--cpupool>
 
diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c
index 72e87eac46..3e3a793e12 100644
--- a/tools/xl/xl_info.c
+++ b/tools/xl/xl_info.c
@@ -384,7 +384,7 @@ static void list_domains(bool verbose, bool context, bool 
claim, bool numa,
     libxl_physinfo_init(&physinfo);
 
     printf("Name                                        ID   Mem 
VCPUs\tState\tTime(s)");
-    if (verbose) printf("   UUID                            
Reason-Code\tSecurity Label");
+    if (verbose) printf("   UUID                            
Reason-Code\tSecurity Label      Capabilities");
     if (context && !verbose) printf("   Security Label");
     if (claim) printf("  Claimed");
     if (cpupool) printf("         Cpupool");
@@ -443,6 +443,28 @@ static void list_domains(bool verbose, bool context, bool 
claim, bool numa,
             putchar(' ');
             print_bitmap(nodemap.map, physinfo.nr_nodes, stdout);
         }
+        if (verbose) {
+            bool cap = false;
+
+            if ( info[i].privileged )
+            {
+                cap = true;
+                printf(" privileged");
+            }
+            if ( info[i].hardware )
+            {
+                cap = true;
+                printf(" hardware");
+            }
+            if ( info[i].never_stop )
+            {
+                cap = true;
+                printf(" xenstore");
+            }
+            if ( !cap )
+                printf(" %17s", "-");
+        }
+
         putchar('\n');
     }
 
-- 
2.48.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.