From c0f1d3c53b1bdac51daa70053e9b2f3475bc2564 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sat, 28 Apr 2012 02:03:43 +0200 Subject: [PATCH] dom0/qvm-ls: show 'n/a' in disk usage for dom0 --- dom0/qvm-tools/qvm-ls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dom0/qvm-tools/qvm-ls b/dom0/qvm-tools/qvm-ls index 2d2c750b..d4e4e0ee 100755 --- a/dom0/qvm-tools/qvm-ls +++ b/dom0/qvm-tools/qvm-ls @@ -174,7 +174,10 @@ def main(): for vm in vms_to_display: data_row = {} for f in fields_to_display: - data_row[f] = str(eval(fields[f]["func"])) + if vm.qid == 0 and (f.startswith('priv-') or f.startswith('root-') or f == 'disk'): + data_row[f] = 'n/a' + else: + data_row[f] = str(eval(fields[f]["func"])) l = len(data_row[f]) if l > fields[f]["max_width"]: fields[f]["max_width"] = l