[PATCH 0/2] Two part fix for virt-df on Xen (bug 538041)
This is a two-part fix for: https://bugzilla.redhat.com/show_bug.cgi?id=538041 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On 17/11/09 14:24, Richard W.M. Jones wrote:
Subject: [PATCH 1/2] virt-df: Turn errors into warnings when listing all domains.
This is a partial fix for RHBZ#538041. When listing all domains, don't die just because one domain fails, but keep trying for the rest. --- tools/virt-df | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/virt-df b/tools/virt-df index 78eb25c..6157e21 100755 --- a/tools/virt-df +++ b/tools/virt-df @@ -165,7 +165,8 @@ if (@ARGV == 0) { if (@domnames) { print_title (); foreach (@domnames) { - do_df ($_); + eval { do_df ($_); }; + warn $@ if $@; } } } else { -- 1.6.5.2
ACK. -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
On 17/11/09 14:25, Richard W.M. Jones wrote:
From dda10cd9357169d5c55d9d49e270a6202971b8c0 Mon Sep 17 00:00:00 2001 From: Richard Jones<rjones@redhat.com> Date: Tue, 17 Nov 2009 14:21:54 +0000 Subject: [PATCH 2/2] virt-df: Ignore domains which have ID 0.
This is the remainder of the fix for RHBZ#538041. Domains which have ID 0 are special domains. libvirt defines it as the "control plane OS". Only Xen and HyperV have this behaviour, and in both cases we should ignore those domains for the purposes of virt-df (user can just run "df" if they need that information for the dom0). --- tools/virt-df | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tools/virt-df b/tools/virt-df index 6157e21..81e17cd 100755 --- a/tools/virt-df +++ b/tools/virt-df @@ -160,6 +160,9 @@ 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) { -- 1.6.5.2
ACK. -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (2)
-
Matthew Booth -
Richard W.M. Jones