From fdcb4dbfc035653ad7d8fc8233467bac536826ef Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 13 Jun 2006 08:18:08 +0000 Subject: [PATCH] 2006-06-13 08:18:08 by steve Force the recreation of filesystem when the user choose both --force and the XFS filesystem. --- bin/xen-create-image | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index 086d7a3..73b0540 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -394,7 +394,7 @@ Install an X11 server, using VNC and XDM -- http://www.steve.org.uk/ - $Id: xen-create-image,v 1.24 2006-06-10 17:49:56 steve Exp $ + $Id: xen-create-image,v 1.25 2006-06-13 08:18:08 steve Exp $ =cut @@ -776,7 +776,7 @@ sub parseCommandLineArguments if ( $VERSION ) { - my $REVISION = '$Revision: 1.24 $'; + my $REVISION = '$Revision: 1.25 $'; if ( $REVISION =~ /1.([0-9.]+) / ) { @@ -1118,6 +1118,17 @@ sub createFilesystem exit; } + # + # Special case. + # + # If the filesystem is xfs, and the image already existed before + # so the user is using '--force' we add the '-f' flag to force + # mkfs.xfs to recreate an image rather than complaining. + # + if ( $CONFIG{'fs'} && $CONFIG{'force'} ) + { + $command .= " -f "; + } # # OK we have the command and the filesystem. Create it.