Support Xen xl toolstack elsewhere than xen-create-image
This commit is contained in:
parent
76fbd23423
commit
ea23c79431
@ -171,9 +171,6 @@ Bugs to fix and features to add for 5.0
|
||||
|
||||
* Make used Xen toolstack configurable, i.e. via --xen-toolstack=xl
|
||||
|
||||
* Support Xen xl toolstack elsewhere than xen-create-image. Needs code
|
||||
deduplication as mentioned below.
|
||||
|
||||
* Code Deduplication / Refactor the code for less code duplication
|
||||
|
||||
`bin/x*` currently contain the same or similar code like e.g. in the
|
||||
|
||||
@ -221,7 +221,7 @@ E_O_ROOT
|
||||
#
|
||||
while ( my $name = shift )
|
||||
{
|
||||
if ( !xenRunning($name) )
|
||||
if ( !xenRunning($name, \%CONFIG) )
|
||||
{
|
||||
deleteXenImage($name);
|
||||
}
|
||||
@ -237,7 +237,7 @@ while ( my $name = shift )
|
||||
my $hosts = $CONFIG{ 'hostname' };
|
||||
foreach my $name (@$hosts)
|
||||
{
|
||||
if ( !xenRunning($name) )
|
||||
if ( !xenRunning($name, \%CONFIG) )
|
||||
{
|
||||
deleteXenImage($name);
|
||||
}
|
||||
|
||||
@ -405,7 +405,7 @@ EOF
|
||||
#
|
||||
# Make sure the guest isn't running
|
||||
#
|
||||
if ( xenRunning( $CONFIG{ 'hostname' } ) )
|
||||
if ( xenRunning( $CONFIG{ 'hostname' }, \%CONFIG ) )
|
||||
{
|
||||
print "The guest $CONFIG{'hostname'} appears to be running!\n";
|
||||
exit 1;
|
||||
|
||||
@ -169,7 +169,7 @@ E_O_ROOT
|
||||
#
|
||||
while ( my $name = shift )
|
||||
{
|
||||
if ( !xenRunning($name) )
|
||||
if ( !xenRunning($name, \%CONFIG) )
|
||||
{
|
||||
updateXenImage($name);
|
||||
}
|
||||
|
||||
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -11,7 +11,7 @@ xen-tools (4.3.1+dev-1) UNRELEASED; urgency=low
|
||||
- Default DomUs to use the noop scheduler (Closes: #693131)
|
||||
- Remove CVS revisions from --version output
|
||||
- Preliminary support for Debian Jessie and Ubuntu Raring
|
||||
- Preliminary support for xl toolstack (xen-create-image only so far)
|
||||
- Preliminary support for xl toolstack
|
||||
- xen-create-image: Consistently use runCommand() instead of system()
|
||||
* Add debian/gbp.conf to be able to to build xen-tools with
|
||||
git-buildpackage.
|
||||
|
||||
@ -116,14 +116,16 @@ sub readConfigurationFile ($$)
|
||||
|
||||
=cut
|
||||
|
||||
sub xenRunning ($)
|
||||
sub xenRunning ($$)
|
||||
{
|
||||
my ($hostname) = (@_);
|
||||
my ($hostname, $CONFIG) = (@_);
|
||||
|
||||
my $running = 0;
|
||||
|
||||
open( CMD, "xm list $hostname 2>/dev/null |" ) or
|
||||
die "Failed to run 'xm list $hostname'";
|
||||
die "Couldn't determine Xen toolstack" unless $CONFIG->{'xm'};
|
||||
|
||||
open( CMD, $CONFIG->{'xm'}." list $hostname 2>/dev/null |" ) or
|
||||
die "Failed to run '".$CONFIG->{'xm'}." list $hostname'";
|
||||
while (<CMD>)
|
||||
{
|
||||
my $line = $_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user