[PATCH 1/3] virsh: cmdList: Revert to script-friendly output for 'virsh list --uuid'

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

 



Commit 271940223c2914bf63cbec00930ce46d6eef30ba which strived to add
support to use '--uuid' in the table output of 'virsh list' went too far
and also allowed the default table view to be enabled when just '--uuid'
is specified.

This broke the script-friendly output which previously had this format:

 $ virsh list --uuid
 b6d03c07-86f8-4a57-8719-172a5d0359bb

to this script-unfriendly output:

 $ virsh list --uuid
  Id   Name   State     UUID
 -------------------------------------------------------------
  1    ha     running   b6d03c07-86f8-4a57-8719-172a5d0359bb

Using the human friendly output will still be possible by using:

 $ virsh list --table --uuid

Fixes: 271940223c2914bf63cbec00930ce46d6eef30ba
Closes: https://gitlab.com/libvirt/libvirt/-/issues/666
Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virsh-domain-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 87efd86a69..9ee9090c11 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -1857,7 +1857,7 @@ cmdList(vshControl *ctl, const vshCmd *cmd)
     VSH_EXCLUSIVE_OPTIONS("table", "name");
     VSH_EXCLUSIVE_OPTIONS("table", "id");

-    if (!optName && !optID)
+    if (!optUUID && !optName && !optID)
         optTable = true;

     if (!(list = virshDomainListCollect(ctl, flags)))
-- 
2.46.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux