From 1df7ef41dadf5df439d0f50c1b93312ccb42d1a8 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Tue, 3 Aug 2010 17:19:24 +0200 Subject: [PATCH] xen-delete-image also needs at least one of --evms, --lvm, or --dir. This led to strange error messages from xen-delete-image if an installation failed because they looked like coming from xen-create-image. xen-delete-image now explicitly states that the error was on the deletion of the image. not on its creation. (Closes: #513138) --- bin/xen-create-image | 20 +++++++++++++++++--- bin/xen-delete-image | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index 1c0675e..1800df8 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -4345,9 +4345,24 @@ sub END $CONFIG{ 'verbose' } && logprint("Removing failed install: $CONFIG{'hostname'}\n"); - $CONFIG{ 'hostname' } && - system("xen-delete-image --hostname=$CONFIG{'hostname'}"); + if ($CONFIG{ 'hostname' }) { + my $options = ''; + if ($CONFIG{ 'lvm' }) { + $options = "--lvm=$CONFIG{'lvm'}" + } elsif ($CONFIG{ 'evms' }) { + $options = "--evms=$CONFIG{'evms'}" + } elsif ($CONFIG{ 'dir' }) { + $options = "--dir=$CONFIG{'dir'}" + } + if ($options) { + system('xen-delete-image', $options, + "--hostname=$CONFIG{'hostname'}"); + } else { + die "Assertion that either --dir, --lvm, or --dir are given". + " failed.\nThis is probably a bug, please report it."; + } + } } elsif ( $FAIL == 0 ) { # # Assume success @@ -4373,4 +4388,3 @@ sub END logprint("\n"); } } - diff --git a/bin/xen-delete-image b/bin/xen-delete-image index 5d830aa..74fe293 100755 --- a/bin/xen-delete-image +++ b/bin/xen-delete-image @@ -413,7 +413,7 @@ sub checkArguments # if ( $count != 1 ) { - print "Please select one and only one of the installation methods:\n"; + print "Please select one and only one of the installation methods to delete the DomU:\n"; print " --dir\n"; print " --evms\n"; print " --lvm\n"; -- 2.39.5