From 8599aedd434a2843dca7fae37bd397f07a584c1a Mon Sep 17 00:00:00 2001 From: Jim Fehlig Date: Fri, 15 Dec 2017 15:28:49 -0700 Subject: [PATCH] Improve filtering of Xen domain0 in libvirt-guests The list_guests function in libvirt-guests uses 'grep -v' to filter Xen domain0 from a list of guests. If domain0 is the only item in the list, 'grep -v' returns 1, causing the 'stop' operation to fail when action is 'suspend'. Improve the filtering by using sed to remove domain0 from the list of guests. --- tools/libvirt-guests.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in index 791d9277b5..8a158cca43 100644 --- a/tools/libvirt-guests.sh.in +++ b/tools/libvirt-guests.sh.in @@ -121,7 +121,7 @@ list_guests() { return 1 fi - echo "$list" | grep -v 00000000-0000-0000-0000-000000000000 + echo "$list" | sed "/00000000-0000-0000-0000-000000000000/d" } # guest_name URI UUID