1
0
mirror of synced 2026-02-22 14:47:18 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Axel Beckert
9a81f9ddb5 Pass a hint that further guessing may be necessary 2010-05-28 00:04:55 +02:00
Axel Beckert
e1a620237a Determine which partitions to delete (doesn't delete them yet) 2010-05-28 00:03:54 +02:00
18 changed files with 194 additions and 41 deletions

View File

@@ -1,13 +0,0 @@
KNOWN BUGS in xen-tools
Bugs to fix before a 4.2 release
--------------------------------
* xen-delete-image doesn't remove all logical volumes if --partitions is used.
See the link below for details how to reproduce. Reproducable at
least with --lvm. Thanks to Antoine Benkemoun for reporting.
http://xen-tools.org/pipermail/xen-tools-discuss/2010-May/000757.html
* xen-delete-image ignores extension setting

View File

@@ -14,7 +14,7 @@
#
TMP ?= /tmp
DIST_PREFIX = ${TMP}
VERSION = 4.2beta1
VERSION = 4.2rc1
DEBVERSION = $(shell echo $(VERSION)|sed 's/\(rc\|pre\|beta\|alpha\)/~\1/')
BASE = xen-tools
VCS = $(shell if git st > /dev/null; then echo git; \
@@ -313,4 +313,4 @@ update-modules:
# at the top of this file. Steve-Specific?
#
update-version:
perl -pi.bak -e "s/RELEASE = '[0-9]\.[0-9][^']*';/RELEASE = '${VERSION}';/g" bin/*-*[!~]
perl -pi.bak -e "s/RELEASE = '[0-9]\.[0-9][^']*';/RELEASE = '${VERSION}';/g" bin/*-*[^~]

16
TODO
View File

@@ -1,10 +1,8 @@
TODO
====
See KNOWN_BUGS for real bugs.
Minor bugs to fix and features to add before a 4.2 release
----------------------------------------------------------
Bugs to fix and Features to add before a 4.2 release
----------------------------------------------------
* xen-create-image man page overhaul:
@@ -24,12 +22,22 @@ Minor bugs to fix and features to add before a 4.2 release
in the domU, it's key fingerprint should be echo'd in a way that
can easily be grep'ed into other scripts.
* Test and support more file system types.
Actually this should be pretty simple now that the parameters are
stored in the configuration hash. The only issue is that trailing
whitespace is missing from the "make_fs_foo" option.
* xen-delete-image doesn't remove all logical volumes if --partitions is used.
See the link below for details how to reproduce. Reproducable at
least with --lvm. Thanks to Antoine Benkemoun for reporting.
http://xen-tools.org/pipermail/xen-tools-discuss/2010-May/000757.html
* xen-delete-image ignores extension setting
* xen-create-image should check all integer options on non-digits.
* Test suite should pass

View File

@@ -754,7 +754,7 @@ my $FAIL = 0;
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';

View File

@@ -130,7 +130,7 @@ $CONFIG{ 'template' } = '/etc/xen-tools/xm-nfs.tmpl';
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';
# store version number away.

View File

@@ -169,8 +169,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';
#
@@ -220,7 +219,21 @@ while ( my $name = shift )
{
if ( !xenRunning($name) )
{
deleteXenImage($name);
#
# Partition layout information values read from the
# partitions file, or constructed automatically if no
# partitions file is specified.
#
my @PARTITIONS = undef;
#
# Check for partitions to delete by reading the DomU's
# configuration file
#
my @PARTITIONS = findPartitions($host
deleteXenImage($name, @PARTITIONS);
}
else
{
@@ -449,6 +462,70 @@ sub xenRunning
}
=begin doc
Read the (usually to be deleted) DomU configuration file specified
and returns the list of used partitions found in the file.
=end doc
=cut
sub findPartitions
{
my ($hostname) = (@_);
my $file = "/etc/xen/$hostname.cfg";
if ( -e $file )
{
open( FILE, "<", $file ) or die "Cannot read file '$file' - $!";
my $line = "";
my $contents = "";
while ( defined( $line = <FILE> ) )
{
chomp $line;
if ( $line =~ s/\\$// )
{
$line .= <FILE>;
redo unless eof(FILE);
}
# Skip lines beginning with comments
next if ( $line =~ /^([ \t]*)\#/ );
# Skip blank lines
next if ( length($line) < 1 );
# Strip trailing comments.
if ( $line =~ /(.*)\#(.*)/ )
{
$line = $1;
}
$contents .= $line;
}
close(FILE);
if ($contents =~ /\ndisk\s*=\s*\[\s*(.*?)\s*\]\s*\n/) {
my $disks = $1;
my @disks = split(/\n/, $disks);
foreach (@disks) {
s/^\s*'phy:(.*),\w*,\w*',\s*$/$1/;
}
return @disks;
}
} else {
warn "Couldn't find $file. May start guessing based on further parameters.\n";
return qw(GUESSING);
}
}
=begin doc
Delete the named image, and the corresponding configuration file
@@ -460,7 +537,11 @@ sub xenRunning
sub deleteXenImage
{
my ($hostname) = (@_);
my $hostname = shift;
my @partitions = @_;
my $guessing = ($#partitions == 0 and $partitions[0] eq 'GUESSING');
#
# Collect the names of files to delete.

View File

@@ -102,7 +102,7 @@ $CONFIG{ 'prefix' } = "/etc/xen";
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';

View File

@@ -116,7 +116,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';

View File

@@ -120,7 +120,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';
#

View File

@@ -156,7 +156,7 @@ $CONFIG{ 'template' } = '/etc/xen-tools/xm.tmpl';
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';

View File

@@ -97,7 +97,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';

View File

@@ -73,7 +73,7 @@ use strict;
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';
# Init
my $mirror = '';

View File

@@ -116,7 +116,7 @@ my %CONFIG;
#
# Release number.
#
my $RELEASE = '4.2beta1';
my $RELEASE = '4.2rc1';
#

4
debian/NEWS vendored
View File

@@ -1,4 +1,4 @@
xen-tools (4.2~beta1-1) unstable; urgency=low
xen-tools (4.2~rc1-1) unstable; urgency=low
If the DomU hangs with "Waiting for root file system" despite
/dev/xvd* is used as disk device, adding "xen-blkfront" to
@@ -14,5 +14,5 @@ xen-tools (4.2~beta1-1) unstable; urgency=low
/etc/apt/sources.list (if it exists) and taking the first entry with
path ending in /debian/ there.
-- Axel Beckert <abe@debian.org> Sun, 30 May 2010 22:36:16 +0200
-- Axel Beckert <abe@debian.org> Sat, 15 May 2010 18:04:14 +0200

7
debian/changelog vendored
View File

@@ -1,8 +1,8 @@
xen-tools (4.2~beta1-1) unstable; urgency=low
xen-tools (4.2~rc1-1) UNRELEASED; urgency=low
* New maintainer and upstream authors
* Reintroduction into Debian Unstable (Closes: #566714)
* New upstream beta version
* New upstream release candidate
- Needs dependency on libfile-slurp-perl
- Supports for more recent versions of Fedora, Ubuntu and Debian
(Closes: #499477)
@@ -41,7 +41,6 @@ xen-tools (4.2~beta1-1) unstable; urgency=low
- Checks for debootstrap and cdebootstrap, uses debootstrap if both
are installed (Changed "Depends: debootstrap" to "Depends:
debootstrap | cdebootstrap" in debian/control)
- Added new files TODO and KNOWN_BUGS to debian/docs.
* Removal of /etc/bash_completion.d/xm from the package since
bash-completion ships a more elaborate version of that file. (Closes:
#566683, #550590, LP: #538917, #484098)
@@ -66,7 +65,7 @@ xen-tools (4.2~beta1-1) unstable; urgency=low
the Git repository.
* Overhauled package description
-- Axel Beckert <abe@debian.org> Sun, 30 May 2010 22:32:30 +0200
-- Axel Beckert <abe@debian.org> Mon, 17 May 2010 13:32:04 +0200
xen-tools (4.1-1) unstable; urgency=low

1
debian/copyright vendored
View File

@@ -5,7 +5,6 @@ It was downloaded from http://xen-tools.org/software/xen-tools/
Copyright 2005-2009: Steve Kemp <steve@steve.org.uk>
Copyright 2010: Axel Beckert <abe@deuxchevaux.org>
Copyright 2010: Dmitry Nedospasov <dmitry@nedos.net>
License:

3
debian/docs vendored
View File

@@ -2,5 +2,4 @@ AUTHORS
README
SUPPORT
BUGS
TODO
KNOWN_BUGS
TODO

80
t/modules.t Executable file
View File

@@ -0,0 +1,80 @@
#!/usr/bin/perl -w -I..
#
# Test that all the Perl modules we require are available.
#
# This list is automatically generated by modules.sh
#
# Steve
# --
#
use Test::More qw( no_plan );
BEGIN{ use_ok( 'Carp' ); }
require_ok( 'Carp' );
BEGIN{ use_ok( 'Config' ); }
require_ok( 'Config' );
BEGIN{ use_ok( 'Digest::MD5' ); }
require_ok( 'Digest::MD5' );
BEGIN{ use_ok( 'English' ); }
require_ok( 'English' );
BEGIN{ use_ok( 'Env' ); }
require_ok( 'Env' );
BEGIN{ use_ok( 'File::Copy' ); }
require_ok( 'File::Copy' );
BEGIN{ use_ok( 'File::Find' ); }
require_ok( 'File::Find' );
BEGIN{ use_ok( 'File::Path' ); }
require_ok( 'File::Path' );
BEGIN{ use_ok( 'File::Slurp' ); }
require_ok( 'File::Slurp' );
BEGIN{ use_ok( 'File::Spec' ); }
require_ok( 'File::Spec' );
BEGIN{ use_ok( 'File::Temp' ); }
require_ok( 'File::Temp' );
BEGIN{ use_ok( 'Getopt::Long' ); }
require_ok( 'Getopt::Long' );
BEGIN{ use_ok( 'Pod::Usage' ); }
require_ok( 'Pod::Usage' );
BEGIN{ use_ok( 'strict' ); }
require_ok( 'strict' );
BEGIN{ use_ok( 'Test::More' ); }
require_ok( 'Test::More' );
BEGIN{ use_ok( 'Text::Template' ); }
require_ok( 'Text::Template' );
BEGIN{ use_ok( 'warnings' ); }
require_ok( 'warnings' );