]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
xen-delete-image also needs at least one of --evms, --lvm, or --dir.
authorAxel Beckert <abe@deuxchevaux.org>
Tue, 3 Aug 2010 15:19:24 +0000 (17:19 +0200)
committerAxel Beckert <abe@deuxchevaux.org>
Tue, 3 Aug 2010 15:19:24 +0000 (17:19 +0200)
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
bin/xen-delete-image

index 1c0675e6550fdc0eda21f266627932b9409399eb..1800df8d4555ddaa9d4978f789dc19bd463436ee 100755 (executable)
@@ -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");
     }
 }
-
index 5d830aacd069f8e992c8ae438bfb3eb895142482..74fe2936c5f6d726b99790fff932fcd72020ae34 100755 (executable)
@@ -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";