2006-02-16 18:05:09 by steve
Add command line support for --volume - but exit and say it isnt' supported.
This commit is contained in:
@@ -15,6 +15,7 @@ xen-delete-image - Delete previously created Xen instances.
|
||||
|
||||
General options:
|
||||
--dir Specify the output directory where images were previously saved.
|
||||
--volume Specify the LVM volume to use.
|
||||
|
||||
Testing options:
|
||||
--test Don't complain if we're not invoked by root.
|
||||
@@ -41,6 +42,9 @@ Don not complain, or exit, if the script is not executed by the root user.
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=item B<--volume>
|
||||
Specify the LVM volume where images were previously saved.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -75,7 +79,7 @@ Show the version number and exit.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-delete-image,v 1.23 2006-02-06 12:44:19 steve Exp $
|
||||
$Id: xen-delete-image,v 1.24 2006-02-16 18:05:09 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -130,6 +134,25 @@ if ( -e "/etc/xen-tools/xen-tools.conf" )
|
||||
#
|
||||
parseCommandLineArguments();
|
||||
|
||||
#
|
||||
# Make sure we have either a volume, or a root.
|
||||
#
|
||||
if ( $CONFIG{'volume'} && $CONFIG{'dir'} )
|
||||
{
|
||||
print "Please only use a volume or a directory name - not both\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Volumes are not supported yet :(
|
||||
#
|
||||
if ( $CONFIG{'volume'} )
|
||||
{
|
||||
print "LVM Volumes are not supported yet\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Abort if non-root user.
|
||||
@@ -147,6 +170,7 @@ E_O_ROOT
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Loop over the supplied arguments, and attempt to delete each
|
||||
# image.
|
||||
@@ -239,6 +263,7 @@ sub parseCommandLineArguments
|
||||
#
|
||||
GetOptions(
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"volume=s", \$CONFIG{'volume'},
|
||||
"test", \$CONFIG{'test'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL,
|
||||
@@ -251,7 +276,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.23 $';
|
||||
my $REVISION = '$Revision: 1.24 $';
|
||||
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ xen-duplicate-image - Duplicate an existing Xen instance.
|
||||
General options:
|
||||
--boot Boot the cloned image after creating it.
|
||||
--dir Specify where the output images should go.
|
||||
--volume Specify the LVM volume where images are to go.
|
||||
|
||||
Networking options:
|
||||
--dhcp Setup the image to get its networking details via DHCP
|
||||
@@ -66,6 +67,9 @@ Specify the virtual instance that we should copy.
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=item B<--volume>
|
||||
Specify the LVM volume where images are to go
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -114,7 +118,7 @@ Show the version number and exit.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-duplicate-image,v 1.22 2006-02-06 12:44:19 steve Exp $
|
||||
$Id: xen-duplicate-image,v 1.23 2006-02-16 18:05:09 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -434,6 +438,7 @@ sub parseCommandLineArguments
|
||||
"gateway=s", \$CONFIG{'gateway'},
|
||||
"netmask=s", \$CONFIG{'netmask'},
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"volume=s", \$CONFIG{'volume'},
|
||||
"kernel=s", \$CONFIG{'kernel'},
|
||||
"dhcp", \$CONFIG{'dhcp'},
|
||||
"help", \$HELP,
|
||||
@@ -447,7 +452,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.22 $';
|
||||
my $REVISION = '$Revision: 1.23 $';
|
||||
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
@@ -497,6 +502,27 @@ EOF
|
||||
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Make sure we have either a volume, or a root.
|
||||
#
|
||||
if ( $CONFIG{'volume'} && $CONFIG{'dir'} )
|
||||
{
|
||||
print "Please only use a volume or a directory name - not both\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Volumes are not supported yet :(
|
||||
#
|
||||
if ( $CONFIG{'volume'} )
|
||||
{
|
||||
print "LVM Volumes are not supported yet\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if (!defined( $CONFIG{'dir'} ) )
|
||||
{
|
||||
print<<EOF
|
||||
|
||||
@@ -16,6 +16,7 @@ xen-list-images - List all the created and configured Xen images.
|
||||
|
||||
General Options:
|
||||
--dir Specify where the output images are located.
|
||||
--volume Specify the LVM volume where images are located.
|
||||
|
||||
Testing options:
|
||||
--test List an image even if there is no configuration file in /etc/xen
|
||||
@@ -39,6 +40,9 @@ This flag causes an image to be listed even if the configuration file in /etc/xe
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=item B<--volume>
|
||||
Specify the LVM volume where images are located
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -90,7 +94,7 @@ Show the version number and exit.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-list-images,v 1.19 2006-02-06 12:44:19 steve Exp $
|
||||
$Id: xen-list-images,v 1.20 2006-02-16 18:05:09 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -144,6 +148,25 @@ if ( -e "/etc/xen-tools/xen-tools.conf" )
|
||||
#
|
||||
parseCommandLineArguments();
|
||||
|
||||
#
|
||||
# Make sure we have either a volume, or a root.
|
||||
#
|
||||
if ( $CONFIG{'volume'} && $CONFIG{'dir'} )
|
||||
{
|
||||
print "Please only use a volume or a directory name - not both\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Volumes are not supported yet :(
|
||||
#
|
||||
if ( $CONFIG{'volume'} )
|
||||
{
|
||||
print "LVM Volumes are not supported yet\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
@@ -284,6 +307,7 @@ sub parseCommandLineArguments
|
||||
#
|
||||
GetOptions(
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"volume=s", \$CONFIG{'volume'},
|
||||
"test", \$CONFIG{'test'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL,
|
||||
@@ -296,7 +320,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.19 $';
|
||||
my $REVISION = '$Revision: 1.20 $';
|
||||
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@ xen-update-image - Update the software installed upon offline Xen images.
|
||||
|
||||
General Options:
|
||||
--dir Specify the directory which contains the image(s).
|
||||
--volume Specify the LVM volume which contains the image(s).
|
||||
|
||||
=cut
|
||||
|
||||
@@ -36,6 +37,8 @@ Read the manual
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=item B<--volume>
|
||||
Specify the LVM volume where images are located.
|
||||
|
||||
=back
|
||||
|
||||
@@ -80,7 +83,7 @@ Show the version number and exit.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-update-image,v 1.19 2006-02-06 12:44:19 steve Exp $
|
||||
$Id: xen-update-image,v 1.20 2006-02-16 18:05:09 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -134,6 +137,26 @@ if ( -e "/etc/xen-tools/xen-tools.conf" )
|
||||
parseCommandLineArguments();
|
||||
|
||||
|
||||
#
|
||||
# Make sure we have either a volume, or a root.
|
||||
#
|
||||
if ( $CONFIG{'volume'} && $CONFIG{'dir'} )
|
||||
{
|
||||
print "Please only use a volume or a directory name - not both\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Volumes are not supported yet :(
|
||||
#
|
||||
if ( $CONFIG{'volume'} )
|
||||
{
|
||||
print "LVM Volumes are not supported yet\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Abort if non-root user.
|
||||
#
|
||||
@@ -292,6 +315,7 @@ sub parseCommandLineArguments
|
||||
#
|
||||
GetOptions(
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"volume=s", \$CONFIG{'volume'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION
|
||||
@@ -302,7 +326,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.19 $';
|
||||
my $REVISION = '$Revision: 1.20 $';
|
||||
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user