From fcebb140020866e69e1c99361d698d1d564bc20b Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Fri, 28 Mar 2014 22:24:21 +0100 Subject: [PATCH] Drop all xend related sanity checks They cause more havoc nowadays than they help. Thanks Ian Campbell! Closes: #732456 --- bin/xen-create-image | 98 +---------------------------------------- bin/xen-delete-image | 5 +-- debian/changelog | 2 + lib/Xen/Tools/Common.pm | 5 ++- t/xen-delete-image.t | 2 +- 5 files changed, 11 insertions(+), 101 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index c52a37a..7b6d46a 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -151,9 +151,6 @@ and EVMS EXAMPLE. used the system will not have a swap entry added to its /etc/fstab file either. - --no-xen-ok Don't complain if xen seems not installed or xend is - not running. (Needed for the testsuite.) - --output=dir Specify the output directory to create the xen configuration file within. @@ -1196,95 +1193,6 @@ EOF exit 127; } } - - - # - # Test the system has a valid (network-script) + (vif-script) setup. - # - testXenConfig(); - -} - - - -=begin doc - - Test that the current Xen host has a valid network configuration, - this is designed to help newcomers to Xen. - -=end doc - -=cut - -sub testXenConfig -{ - - # wierdness. - return if ( !-d "/etc/xen" ); - - # - # Temporary hash. - # - my %cfg; - - # - # Read the configuration file. - # - open( CONFIG, "<", "/etc/xen/xend-config.sxp" ) or - fail("Failed to read /etc/xen/xend-config.sxp: $!"); - while () - { - next if ( !$_ || !length($_) ); - - # vif - if ( $_ =~ /^\(vif-script ([^)]+)/ ) - { - $cfg{ 'vif-script' } = $1; - } - - # network - if ( $_ =~ /^\(network-script ([^)]+)/ ) - { - $cfg{ 'network-script' } = $1; - } - } - close(CONFIG); - - if ( !defined( $cfg{ 'network-script' } ) || - !defined( $cfg{ 'vif-script' } ) ) - { - print <{'xm'}; + unless ($CONFIG->{'xm'}) { + warn "Couldn't determine Xen toolstack, skipping check for running DomUs."; + return 0; + } open( CMD, $CONFIG->{'xm'}." list $hostname 2>/dev/null |" ) or fail_with_config("Failed to run '".$CONFIG->{'xm'}." list $hostname'", $CONFIG); diff --git a/t/xen-delete-image.t b/t/xen-delete-image.t index 4166966..e234687 100755 --- a/t/xen-delete-image.t +++ b/t/xen-delete-image.t @@ -75,7 +75,7 @@ close( IMAGE ); # So we need to run the deletion script and verify the images # are removed correctly. # -my $log = `perl -I./lib -I../lib ./bin/xen-delete-image --test --verbose --no-xen-ok --dir=$dir $hostname`; +my $log = `perl -I./lib -I../lib ./bin/xen-delete-image --test --verbose --dir=$dir $hostname`; ok ( $? == 0, 'Calling xen-delete-image returned exit code 0' ); print $log;