From fbd5ca41504fba7db2df64e17173f8ad91354f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 21 Apr 2018 02:51:31 +0200 Subject: [PATCH] tools/qvm-ls: add --kernel option for compatibility with R3.2 There was such option on Qubes 3.2, so add it here too. This is especially useful for kernel package - preun script use it to verify if given kernel isn't needed anymore. --- doc/manpages/qvm-ls.rst | 4 ++++ qubesadmin/tools/qvm_ls.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/doc/manpages/qvm-ls.rst b/doc/manpages/qvm-ls.rst index d160df8..8811825 100644 --- a/doc/manpages/qvm-ls.rst +++ b/doc/manpages/qvm-ls.rst @@ -61,6 +61,10 @@ Options Same as --format=network, for compatibility with Qubes 3.x +.. option:: --kernel, -k + + Same as --format=kernel, for compatibility with Qubes 3.x + .. option:: --verbose, -v Increase verbosity. diff --git a/qubesadmin/tools/qvm_ls.py b/qubesadmin/tools/qvm_ls.py index 4e672a9..057ad91 100644 --- a/qubesadmin/tools/qvm_ls.py +++ b/qubesadmin/tools/qvm_ls.py @@ -430,6 +430,7 @@ class Table(object): formats = { 'simple': ('name', 'state', 'class', 'label', 'template', 'netvm'), 'network': ('name', 'state', 'netvm', 'ip', 'ipback', 'gateway'), + 'kernel': ('name', 'state', 'class', 'template', 'kernel', 'kernelopts'), 'full': ('name', 'state', 'class', 'label', 'qid', 'xid', 'uuid'), # 'perf': ('name', 'state', 'cpu', 'memory'), 'disk': ('name', 'state', 'disk', @@ -551,6 +552,10 @@ def get_parser(): action='store_const', dest='format', const='network', help='Same as --format=network') + parser.add_argument('--kernel', '-k', + action='store_const', dest='format', const='kernel', + help='Same as --format=kernel') + parser.set_defaults(spinner=True) # parser.add_argument('--conf', '-c',