virt-df: Ignore domains which have ID 0.
[libguestfs.git] / tools / virt-df
index 78eb25c..81e17cd 100755 (executable)
@@ -160,12 +160,16 @@ if (@ARGV == 0) {
     my @doms = $conn->list_defined_domains ();
     push @doms, $conn->list_domains ();
 
+    # https://bugzilla.redhat.com/show_bug.cgi?id=538041
+    @doms = grep { $_->get_id () != 0 } @doms;
+
     my @domnames = map { $_->get_name () } @doms;
 
     if (@domnames) {
         print_title ();
         foreach (@domnames) {
-            do_df ($_);
+            eval { do_df ($_); };
+            warn $@ if $@;
         }
     }
 } else {