2007-04-03 00:20:43 by steve
1. Only add the auto-start link for domains which are booted if not present. 2. When deleting images remove the auto-start link.
This commit is contained in:
@@ -564,7 +564,7 @@ Install an X11 server, using VNC and XDM
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-create-image,v 1.146 2007-04-03 00:14:47 steve Exp $
|
||||
$Id: xen-create-image,v 1.147 2007-04-03 00:20:43 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -866,9 +866,13 @@ if ( $CONFIG{'boot'} )
|
||||
|
||||
#
|
||||
# If there is an /etc/xen/auto directory then link
|
||||
# in the domain so that it will automatically restart.
|
||||
# in the domain so that it will automatically restart, if it isn't
|
||||
# already present.
|
||||
#
|
||||
if ( -d "/etc/xen/auto" )
|
||||
# (Will be present if this is overwriting a previous image, for example.)
|
||||
#
|
||||
if ( ( -d "/etc/xen/auto" ) &&
|
||||
( ! -e "/etc/xen/auto/$CONFIG{'hostname'}.cfg" ) )
|
||||
{
|
||||
logprint( "Creating auto-start symlink\n" );
|
||||
|
||||
@@ -1219,7 +1223,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.146 $';
|
||||
my $REVISION = '$Revision: 1.147 $';
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
$REVISION = $1;
|
||||
|
||||
@@ -136,7 +136,7 @@ Show the version number and exit.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-delete-image,v 1.31 2007-04-01 12:32:46 steve Exp $
|
||||
$Id: xen-delete-image,v 1.32 2007-04-03 00:20:43 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -335,7 +335,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.31 $';
|
||||
my $REVISION = '$Revision: 1.32 $';
|
||||
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
@@ -407,6 +407,15 @@ sub deleteXenImage
|
||||
{
|
||||
my ($hostname) = ( @_ );
|
||||
|
||||
#
|
||||
# Delete the Xen auto-start file if it exists.
|
||||
#
|
||||
if ( -e "/etc/xen/auto/$hostname.cfg" )
|
||||
{
|
||||
$CONFIG{'verbose'} && print "Removing /etc/xen/auto/$hostname.cfg\n";
|
||||
unlink("/etc/xen/auto/$hostname.cfg" )
|
||||
}
|
||||
|
||||
#
|
||||
# Delete the Xen configuration file if it exists.
|
||||
#
|
||||
@@ -416,7 +425,6 @@ sub deleteXenImage
|
||||
unlink("/etc/xen/$hostname.cfg" )
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# If we're working on disk images remove them.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user