[PATCH] Default to IDE when VirtIO isn't available
by Matthew Booth
Previously we used SCSI when VirtIO wasn't available. KVM's SCSI support is not
as mature as its IDE support, and SCSI isn't supported at all in RHEV.
---
lib/Sys/VirtV2V/Converter.pm | 50 +++++++++++-------
lib/Sys/VirtV2V/Converter/Linux.pm | 19 ++++---
lib/Sys/VirtV2V/GuestOS/RedHat.pm | 100 ++++++++++++++++++++----------------
3 files changed, 100 insertions(+), 69 deletions(-)
diff --git a/lib/Sys/VirtV2V/Converter.pm b/lib/Sys/VirtV2V/Converter.pm
index 71e94f7..5dc8550 100644
--- a/lib/Sys/VirtV2V/Converter.pm
+++ b/lib/Sys/VirtV2V/Converter.pm
@@ -87,7 +87,7 @@ use constant KVM_XML_NOVIRTIO => "
</os>
<devices>
<disk device='disk'>
- <target bus='scsi'/>
+ <target bus='ide'/>
</disk>
<interface type='network'>
<model type='e1000'/>
@@ -268,51 +268,65 @@ sub _unconfigure_bootloaders
}
}
+sub _suffixcmp
+{
+ my ($a, $b) = @_;
+
+ return 1 if (length($a) > length($b));
+ return -1 if (length($a) < length($b));
+
+ return 1 if ($a gt $b);
+ return -1 if ($a lt $b);
+ return 0;
+}
+
sub _configure_storage
{
my ($dom, $devices, $virtio) = @_;
- my $prefix = $virtio ? 'vd' : 'sd';
+ my $prefix = $virtio ? 'vd' : 'hd';
+
+ my @removed = ();
my $suffix = 'a';
foreach my $device (@$devices) {
my ($target) = $dom->findnodes("/domain/devices/disk[\@device='disk']/".
"target[\@dev='$device']");
- die(user_message(__x("Previously detected drive {drive} is no longer ".
- "present in domain XML: {xml}",
- drive => $device,
- xml => $dom->toString())))
+ die("Previously detected drive $device is no longer present in domain ".
+ "XML: ".$dom->toString())
unless (defined($target));
- $target->setAttribute('bus', $virtio ? 'virtio' : 'scsi');
- $target->setAttribute('dev', $prefix.$suffix);
- $suffix++; # Perl magic means 'z'++ == 'aa'
+ # Don't add more than 4 IDE disks
+ if (!$virtio && _suffixcmp($suffix, 'd') > 0) {
+ push(@removed, "$device(disk)");
+ } else {
+ $target->setAttribute('bus', $virtio ? 'virtio' : 'ide');
+ $target->setAttribute('dev', $prefix.$suffix);
+ $suffix++; # Perl magic means 'z'++ == 'aa'
+ }
}
- # Convert the first 4 CDROM drives to IDE, and remove the rest
- $suffix = 'a';
- my $i = 0;
- my @removed = ();
+ # Convert CD-ROM devices to IDE.
+ $suffix = 'a' if ($virtio);
foreach my $target
($dom->findnodes("/domain/devices/disk[\@device='cdrom']/target"))
{
- if ($i < 4) {
+ if (_suffixcmp($suffix, 'd') <= 0) {
$target->setAttribute('bus', 'ide');
$target->setAttribute('dev', "hd$suffix");
$suffix++;
} else {
- push(@removed, $target->getAttribute('dev'));
+ push(@removed, $target->getAttribute('dev')."(cdrom)");
my $disk = $target->getParentNode();
$disk->getParentNode()->removeChild($disk);
}
- $i++;
}
if (@removed > 0) {
- print user_message(__x("WARNING: Only 4 CDROM drives are supported. ".
- "The following CDROM drives have been removed: ".
+ print user_message(__x("WARNING: Only 4 IDE devices are supported. ".
+ "The following drives have been removed: ".
"{list}",
list => join(' ', @removed)));
}
diff --git a/lib/Sys/VirtV2V/Converter/Linux.pm b/lib/Sys/VirtV2V/Converter/Linux.pm
index 6f49351..3e76762 100644
--- a/lib/Sys/VirtV2V/Converter/Linux.pm
+++ b/lib/Sys/VirtV2V/Converter/Linux.pm
@@ -142,7 +142,7 @@ sub _configure_kernel_modules
# Make a note of whether we've added scsi_hostadapter
# We need this on RHEL 4/virtio because mkinitrd can't detect root on
- # virtio. For simplicity we always ensure this is set.
+ # virtio. For simplicity we always ensure this is set for virtio disks.
my $scsi_hostadapter = 0;
foreach my $module (keys(%$modules)) {
@@ -164,17 +164,22 @@ sub _configure_kernel_modules
$hvs_modules{$module} = 1;
}
- $guestos->update_kernel_module($module,
- $virtio ? "virtio_blk" : "sym53c8xx");
+ if ($virtio) {
+ $guestos->update_kernel_module($module, 'virtio_blk');
+ $scsi_hostadapter = 1;
+ }
- $scsi_hostadapter = 1;
+ # IDE doesn't need scsi_hostadapter
+ else {
+ $guestos->disable_kernel_module($module);
+ }
}
}
# Add an explicit scsi_hostadapter if it wasn't there before
- $guestos->enable_kernel_module('scsi_hostadapter',
- $virtio ? "virtio_blk" : "sym53c8xx")
- unless($scsi_hostadapter);
+ if ($virtio && !$scsi_hostadapter) {
+ $guestos->enable_kernel_module('scsi_hostadapter', 'virtio_blk');
+ }
# Warn if any old-HV specific kernel modules weren't updated
foreach my $module (keys(%hvs_modules)) {
diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
index 3f5d90a..8664c2d 100644
--- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm
+++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
@@ -964,54 +964,52 @@ sub remap_block_devices
# same names as used by the guest. However, if the guest is using libata,
# IDE drives could be renamed.
- # Look for IDE and SCSI devices in fstab for the guest
- my %guestif;
- foreach my $spec ($g->aug_match('/files/etc/fstab/*/spec')) {
- my $device = $g->aug_get($spec);
-
- next unless($device =~ m{^/dev/(sd|hd)([a-z]+)});
- $guestif{$1} ||= {};
- $guestif{$1}->{$1.$2} = 1;
+ # Modern distros use libata, and IDE devices are presented as sdX
+ my $libata = 1;
+
+ # RHEL 2, 3 and 4 didn't use libata
+ # RHEL 5 does use libata, but udev rules call IDE devices hdX anyway
+ if ($desc->{distro} eq 'rhel') {
+ if ($desc->{major_version} eq '2' ||
+ $desc->{major_version} eq '3' ||
+ $desc->{major_version} eq '4' ||
+ $desc->{major_version} eq '5')
+ {
+ $libata = 0;
+ }
}
+ # Fedora has used libata since FC7, which is long out of support. We assume
+ # that all Fedora distributions in use use libata.
+
+ if ($libata) {
+ # Look for IDE and SCSI devices in fstab for the guest
+ my %guestif;
+ foreach my $spec ($g->aug_match('/files/etc/fstab/*/spec')) {
+ my $device = $g->aug_get($spec);
+
+ next unless($device =~ m{^/dev/(sd|hd)([a-z]+)});
+ $guestif{$1} ||= {};
+ $guestif{$1}->{$1.$2} = 1;
+ }
- # If fstab contains references to sdX, these could refer to IDE or SCSI
- # devices. Need to look at the domain config for clues.
- if (exists($guestif{sd})) {
- # Look for IDE and SCSI devices from the domain definition
- my %domainif;
- foreach my $device (@$devices) {
- foreach my $type ('hd', 'sd') {
- if ($device =~ m{^$type([a-z]+)}) {
- $domainif{$type} ||= {};
- $domainif{$type}->{$device} = 1;
+ # If fstab contains references to sdX, these could refer to IDE or SCSI
+ # devices. We may need to update them.
+ if (exists($guestif{sd})) {
+ # Look for IDE and SCSI devices from the domain definition
+ my %domainif;
+ foreach my $device (@$devices) {
+ foreach my $type ('hd', 'sd') {
+ if ($device =~ m{^$type([a-z]+)}) {
+ $domainif{$type} ||= {};
+ $domainif{$type}->{$device} = 1;
+ }
}
}
- }
-
- # If domain defines both IDE and SCSI drives, and fstab contains
- # references on sdX, but not hdX, we don't know if the guest is using
- # libata or not. This means that we don't know if sdX in fstab refers
- # to hdX or sdX in the domain. Warn and assume that libata device
- # renaming is not in use.
- if (exists($domainif{hd}) && exists($domainif{sd}) &&
- !exists($guestif{hd}))
- {
- print STDERR user_message(__"WARNING: Unable to determine whether ".
- "sdX devices in /etc/fstab refer to ".
- "IDE or SCSI devices. Assuming they ".
- "refer to SCSI devices. /etc/fstab ".
- "may be incorrect after conversion if ".
- "guest uses libata.");
- }
- # If we've got only IDE devices in the domain, and only sdX devices in
- # fstab, the guest is renaming them.
- elsif (exists($domainif{hd}) && !exists($domainif{sd}) &&
- !exists($guestif{hd}))
- {
my %map;
my $letter = 'a';
+ # IDE drives are presented first
foreach my $old (sort { _drivecmp('hd', $a, $b) }
keys(%{$domainif{hd}}))
{
@@ -1019,10 +1017,16 @@ sub remap_block_devices
$letter++;
}
+ # Followed by SCSI drives
+ foreach my $old (sort { _drivecmp('sd', $a, $b) }
+ keys(%{$domainif{sd}}))
+ {
+ $map{$old} = "sd$letter";
+ $letter++;
+ }
+
map { $_ = $map{$_} } @$devices;
}
-
- # Otherwise we leave it alone
}
# We now assume that $devices contains an ordered list of device names, as
@@ -1030,8 +1034,16 @@ sub remap_block_devices
# device names.
my %map;
- # Everything will be converted to either vdX or sdX
- my $prefix = $virtio ? 'vd' : 'sd';
+ # Everything will be converted to either vdX, sdX or hdX
+ my $prefix;
+ if ($virtio) {
+ $prefix = 'vd';
+ } elsif ($libata) {
+ $prefix = 'sd';
+ } else {
+ $prefix = 'hd'
+ }
+
my $letter = 'a';
foreach my $device (@$devices) {
$map{$device} = $prefix.$letter;
--
1.6.6.1
14 years, 7 months
[PATCH] Add LocalCopy transfer method to transfer local files to a target
by Matthew Booth
Also changes command line parsing to require a pool to be specified when using
libvirt output, meaning storage will always be copied.
---
MANIFEST | 1 +
lib/Sys/VirtV2V/Connection.pm | 74 +++++++++---------
lib/Sys/VirtV2V/Connection/LibVirt.pm | 18 +++--
lib/Sys/VirtV2V/Connection/LibVirtXML.pm | 11 ++-
lib/Sys/VirtV2V/Target/LibVirt.pm | 18 ++---
lib/Sys/VirtV2V/Transfer/ESX.pm | 7 +-
lib/Sys/VirtV2V/Transfer/LocalCopy.pm | 121 ++++++++++++++++++++++++++++++
v2v/virt-v2v.pl | 7 ++-
8 files changed, 193 insertions(+), 64 deletions(-)
create mode 100644 lib/Sys/VirtV2V/Transfer/LocalCopy.pm
diff --git a/MANIFEST b/MANIFEST
index 1bc6018..d5debe1 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -15,6 +15,7 @@ lib/Sys/VirtV2V/UserMessage.pm
lib/Sys/VirtV2V/Target/LibVirt.pm
lib/Sys/VirtV2V/Target/RHEV.pm
lib/Sys/VirtV2V/Transfer/ESX.pm
+lib/Sys/VirtV2V/Transfer/LocalCopy.pm
MANIFEST This list of files
MANIFEST.SKIP
META.yml
diff --git a/lib/Sys/VirtV2V/Connection.pm b/lib/Sys/VirtV2V/Connection.pm
index 5ecc7e3..5b4ed8d 100644
--- a/lib/Sys/VirtV2V/Connection.pm
+++ b/lib/Sys/VirtV2V/Connection.pm
@@ -22,10 +22,12 @@ use warnings;
use Sys::Virt;
-use Locale::TextDomain 'virt-v2v';
-
+use Sys::VirtV2V::Transfer::ESX;
+use Sys::VirtV2V::Transfer::LocalCopy;
use Sys::VirtV2V::UserMessage qw(user_message);
+use Locale::TextDomain 'virt-v2v';
+
=pod
=head1 NAME
@@ -134,41 +136,39 @@ sub _storage_iterate
else {
my $path = $source->getValue();
- if (defined($transfer)) {
- # Die if transfer required and no output target
- die (user_message(__"No output target was specified"))
- unless (defined($target));
-
- # Fetch the remote storage
- my $vol = $transfer->transfer($self, $path, $target);
-
- # Export the new path
- $path = $vol->get_path();
-
- # Find any existing driver element.
- my ($driver) = $disk->findnodes('driver');
-
- # Create a new driver element if none exists
- unless (defined($driver)) {
- $driver =
- $disk->getOwnerDocument()->createElement("driver");
- $disk->appendChild($driver);
- }
- $driver->setAttribute('name', 'qemu');
- $driver->setAttribute('type', $vol->get_format());
-
- # Remove the @file or @dev attribute before adding a new one
- $source_e->removeAttributeNode($source);
-
- # Set @file or @dev as appropriate
- if ($vol->is_block())
- {
- $disk->setAttribute('type', 'block');
- $source_e->setAttribute('dev', $path);
- } else {
- $disk->setAttribute('type', 'file');
- $source_e->setAttribute('file', $path);
- }
+ # Die if transfer required and no output target
+ die (user_message(__"No output target was specified"))
+ unless (defined($target));
+
+ # Fetch the remote storage
+ my $vol = $transfer->transfer($self, $path, $target);
+
+ # Export the new path
+ $path = $vol->get_path();
+
+ # Find any existing driver element.
+ my ($driver) = $disk->findnodes('driver');
+
+ # Create a new driver element if none exists
+ unless (defined($driver)) {
+ $driver =
+ $disk->getOwnerDocument()->createElement("driver");
+ $disk->appendChild($driver);
+ }
+ $driver->setAttribute('name', 'qemu');
+ $driver->setAttribute('type', $vol->get_format());
+
+ # Remove the @file or @dev attribute before adding a new one
+ $source_e->removeAttributeNode($source);
+
+ # Set @file or @dev as appropriate
+ if ($vol->is_block())
+ {
+ $disk->setAttribute('type', 'block');
+ $source_e->setAttribute('dev', $path);
+ } else {
+ $disk->setAttribute('type', 'file');
+ $source_e->setAttribute('file', $path);
}
push(@paths, $path);
diff --git a/lib/Sys/VirtV2V/Connection/LibVirt.pm b/lib/Sys/VirtV2V/Connection/LibVirt.pm
index 2c289b9..43fe624 100644
--- a/lib/Sys/VirtV2V/Connection/LibVirt.pm
+++ b/lib/Sys/VirtV2V/Connection/LibVirt.pm
@@ -30,7 +30,6 @@ use XML::DOM;
use Sys::Virt;
use Sys::VirtV2V;
-use Sys::VirtV2V::Transfer::ESX;
use Sys::VirtV2V::UserMessage qw(user_message);
use Locale::TextDomain 'virt-v2v';
@@ -46,7 +45,7 @@ Sys::VirtV2V::Connection::LibVirt - Read libvirt metadata from libvirtd
use Sys::VirtV2V::Connection::LibVirt;
$conn = Sys::VirtV2V::Connection::LibVirt->new
- ("xen+ssh://xenserver.example.com/", $name, $pool);
+ ("xen+ssh://xenserver.example.com/", $name, $target);
$dom = $conn->get_dom();
=head1 DESCRIPTION
@@ -59,11 +58,10 @@ libvirt connection.
=over
-=item new(uri, name, pool)
+=item new(uri, name, target)
Create a new Sys::VirtV2V::Connection::LibVirt. Domain I<name> will be
-obtained from I<uri>. Remote storage will be copied to a new volume, which
-will be created in I<pool>.
+obtained from I<uri>. Remote storage will be create on I<target>.
=cut
@@ -71,7 +69,7 @@ sub new
{
my $class = shift;
- my ($uri, $name, $pool) = @_;
+ my ($uri, $name, $target) = @_;
my $self = {};
@@ -151,7 +149,13 @@ sub new
$transfer = "Sys::VirtV2V::Transfer::ESX";
}
- $self->_storage_iterate($transfer, $pool);
+ # Default to LocalCopy
+ # XXX: Need transfer methods for remote libvirt connections, e.g. scp
+ else {
+ $transfer = "Sys::VirtV2V::Transfer::LocalCopy";
+ }
+
+ $self->_storage_iterate($transfer, $target);
return $self;
}
diff --git a/lib/Sys/VirtV2V/Connection/LibVirtXML.pm b/lib/Sys/VirtV2V/Connection/LibVirtXML.pm
index 03b85b1..0ce07fd 100644
--- a/lib/Sys/VirtV2V/Connection/LibVirtXML.pm
+++ b/lib/Sys/VirtV2V/Connection/LibVirtXML.pm
@@ -39,7 +39,7 @@ Sys::VirtV2V::Connection::LibVirtXML - Read libvirt XML from a file
use Sys::VirtV2V::Connection::LibVirtXML;
- $conn = Sys::VirtV2V::Connection::LibVirtXML->new($path);
+ $conn = Sys::VirtV2V::Connection::LibVirtXML->new($path, $target);
$dom = $conn->get_dom();
=head1 DESCRIPTION
@@ -52,9 +52,10 @@ file.
=over
-=item new(path)
+=item new(path, target)
Create a new LibVirtXML connection. The metadata itself is read from I<path>.
+Storage will be copied to I<target>.
=cut
@@ -62,7 +63,7 @@ sub new
{
my $class = shift;
- my ($path) = @_;
+ my ($path, $target) = @_;
my $self = {};
$self->{path} = $path;
@@ -71,8 +72,8 @@ sub new
$self->_get_dom($path);
- # No transfer methods defined yet
- $self->_storage_iterate(undef, undef);
+ # Only support LocalCopy for libvirtxml
+ $self->_storage_iterate("Sys::VirtV2V::Transfer::LocalCopy", $target);
return $self;
}
diff --git a/lib/Sys/VirtV2V/Target/LibVirt.pm b/lib/Sys/VirtV2V/Target/LibVirt.pm
index 96ed513..ab95fb7 100644
--- a/lib/Sys/VirtV2V/Target/LibVirt.pm
+++ b/lib/Sys/VirtV2V/Target/LibVirt.pm
@@ -186,16 +186,14 @@ sub new
$self->{vmm} = Sys::Virt->new(auth => 1, uri => $uri);
- if (defined($poolname)) {
- eval {
- $self->{pool} = $self->{vmm}->get_storage_pool_by_name($poolname);
- };
-
- if ($@) {
- die(user_message(__x("Output pool {poolname} is not a valid ".
- "storage pool",
- poolname => $poolname)));
- }
+ eval {
+ $self->{pool} = $self->{vmm}->get_storage_pool_by_name($poolname);
+ };
+
+ if ($@) {
+ die(user_message(__x("Output pool {poolname} is not a valid ".
+ "storage pool",
+ poolname => $poolname)));
}
return $self;
diff --git a/lib/Sys/VirtV2V/Transfer/ESX.pm b/lib/Sys/VirtV2V/Transfer/ESX.pm
index 42b4326..9db28e0 100644
--- a/lib/Sys/VirtV2V/Transfer/ESX.pm
+++ b/lib/Sys/VirtV2V/Transfer/ESX.pm
@@ -120,10 +120,9 @@ sub get_volume
my $target = $self->{_v2v_target};
if ($target->volume_exists($volname)) {
print STDERR user_message(__x("WARNING: storage volume {name} ".
- "already exists in the target ".
- "pool. NOT fetching it again. ".
- "Delete the volume and retry to ".
- "download again.",
+ "already exists on the target. NOT ".
+ "fetching it again. Delete the volume ".
+ "and retry to download again.",
name => $volname));
return $target->get_volume($volname);
}
diff --git a/lib/Sys/VirtV2V/Transfer/LocalCopy.pm b/lib/Sys/VirtV2V/Transfer/LocalCopy.pm
new file mode 100644
index 0000000..814bf4a
--- /dev/null
+++ b/lib/Sys/VirtV2V/Transfer/LocalCopy.pm
@@ -0,0 +1,121 @@
+# Sys::VirtV2V::Transfer::LocalCopy
+# Copyright (C) 2010 Red Hat Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+package Sys::VirtV2V::Transfer::LocalCopy;
+
+use File::Spec;
+use File::stat;
+
+use Sys::VirtV2V::UserMessage qw(user_message);
+
+use Locale::TextDomain 'virt-v2v';
+
+=pod
+
+=head1 NAME
+
+Sys::VirtV2V::Transfer::LocalCopy - Copy a guest's local storage
+
+=head1 SYNOPSIS
+
+ use Sys::VirtV2V::Transfer::LocalCopy;
+
+ $vol = Sys::VirtV2V::Transfer::LocalCopy->transfer($conn, $path, $target);
+
+=head1 DESCRIPTION
+
+Sys::VirtV2V::Transfer::LocalCopy retrieves guest storage devices from local
+storage.
+
+=head1 METHODS
+
+=over
+
+=item transfer(conn, path, target)
+
+Transfer <path> from local storage. Storage will be created using <target>.
+
+=cut
+
+sub transfer
+{
+ my $class = shift;
+
+ my ($conn, $path, $target) = @_;
+
+ my (undef, undef, $name) = File::Spec->splitpath($path);
+
+ if ($target->volume_exists($name)) {
+ print STDERR user_message(__x("WARNING: storage volume {name} ".
+ "already exists on the target. NOT ".
+ "copying it again. Delete the volume ".
+ "and retry to copy again.",
+ name => $name));
+ return $target->get_volume($name);
+ }
+
+ my $fh;
+ open($fh, '<', $path)
+ or die(user_message(__x("Unable to open {path} for reading: {error}",
+ path => $path,
+ error => $!)));
+
+ my $st = stat($fh)
+ or die(user_message(__x("Unable to stat {path}: {error}",
+ path => $path,
+ error => $!)));
+
+ my $vol = $target->create_volume($name, $st->size);
+ $vol->open();
+
+ for (;;) {
+ my $buffer;
+ # Transfer in block chunks
+ my $in = sysread($fh, $buffer, $st->blksize);
+ die(user_message(__x("Error reading data from {path}: {error}",
+ path => $path,
+ error => $!))) if (!defined($in));
+
+ last if ($in == 0);
+
+ $vol->write($buffer);
+ }
+
+ $vol->close();
+
+ return $vol;
+}
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2010 Red Hat Inc.
+
+=head1 LICENSE
+
+Please see the file COPYING.LIB for the full license.
+
+=head1 SEE ALSO
+
+L<Sys::VirtV2V::Converter(3pm)>,
+L<virt-v2v(1)>,
+L<http://libguestfs.org/>.
+
+=cut
+
+1;
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index 351caf1..c1a4728 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -225,6 +225,11 @@ if(defined($config_file)) {
my $target;
if ($output_method eq "libvirt") {
+ pod2usage({ -message => __("You must specify an output storage pool ".
+ "when using the libvirt output method"),
+ -exitval => 1 })
+ unless (defined($output_pool));
+
$target = new Sys::VirtV2V::Target::LibVirt($output_uri, $output_pool);
}
@@ -257,7 +262,7 @@ eval {
modulename => 'libvirtxml'));
}
- $conn = Sys::VirtV2V::Connection::LibVirtXML->new($path);
+ $conn = Sys::VirtV2V::Connection::LibVirtXML->new($path, $target);
}
elsif ($input_method eq "libvirt") {
--
1.6.6.1
14 years, 7 months
Proposed change in the version numbering system
by Richard W.M. Jones
At the moment I post new versions when I feel there has been a
significant amount of work and/or time passed since the previous
release. This however does not give a good indication of the quality
of the release, for example if it includes mainly bugfixes and
stability improvements, or bleeding edge features.
Therefore I would like to propose a change to the way that libguestfs
versions are numbered. This is modeled on the old Linux kernel scheme.
Each version will be:
1.X.Y
We won't change the initial '1' unless at some point in the future we
decided to release a non-backwards-compatible libguestfs. There are
no plans to do this.
X is the "series". Even number == stable. Odd number == development.
Y increments on every release in the series.
Because I'm happy with 1.0.89, this will become the first stable
version:
1.2.0
Thus the next development versions will be:
1.3.0, 1.3.1, 1.3.2, 1.3.3, ...
During this time we will backport selected bug fixes and stability
improvements (only!) to:
1.2.1, 1.2.2, ...
At some point when sufficient new features have accrued we will decide
to make a new stable release and a new development series at the same
time:
1.4.0 (stable release)
1.5.0 (new development release)
(Note that 1.2.0, 1.4.0, .. themselves might not be stable, since they
are just a fork of a development release, but by continuing
development, finding bugs and backporting them, the 1.2, 1.4, ..
branches should stabilize over time).
I will also add branches in git at the appropriate points.
I will continue to push the latest development version into Rawhide as
quickly as possible, but for released versions of Fedora (eg. the
up-coming Fedora 13) I will stick to stable releases only.
I hope all of this makes sense. If anyone has any questions or
objections, please follow-up to this message.
Rich.
PS. Sorry that the git repo is still down. After we moved the server
we had an unexpected hardware problem, and I'm moving the server to
new hardware today.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
14 years, 7 months
The exit code makes user confused while using '-' prefixed subcommands
by Qixiang Wan
guestfish returns 0 if the commands completed without error, or 1 if there was an error.
But the rule break when we use '-' prefix subcommands:
------------------------------------
$ guestfish <<\EOF
> blabla
> EOF
blabla: unknown command
$ echo $?
1
$ guestfish <<\EOF
-blabla
EOF
blabla: unknown command
$ echo $?
0
------------------------------------
I think it should be more reasonable to make the behaviours keeping identical with the rule.
14 years, 7 months
Re: [Libguestfs] libguestfs-1.0.85-1.el5.5 - seems no KVM acceleration support included
by Richard W.M. Jones
On Wed, Mar 31, 2010 at 11:24:30PM +0300, Active Systems OÜ wrote:
[Please CC your messages to libguestfs mailing list, since the
answer may help others in future.]
> One more error popped up during building - any clues what might be wrong or how to bypass that test? It might be related to locale - Im using by default:
> LANG=et_EE.utf8
> LC_CTYPE="et_EE.utf8"
> LC_NUMERIC="et_EE.utf8"
> LC_TIME="et_EE.utf8"
> LC_COLLATE="et_EE.utf8"
> LC_MONETARY="et_EE.utf8"
> LC_MESSAGES="et_EE.utf8"
> LC_PAPER="et_EE.utf8"
> LC_NAME="et_EE.utf8"
> LC_ADDRESS="et_EE.utf8"
> LC_TELEPHONE="et_EE.utf8"
> LC_MEASUREMENT="et_EE.utf8"
> LC_IDENTIFICATION="et_EE.utf8"
> LC_ALL=
>
> Ill try to change back to en_US.
>
> Build log:
>
> PASS: test-getdtablesize
> PASS: test-getgroups
> PASS: test-getline
> test-getlogin_r.c:55: assertion failed
> /bin/sh: line 5: 7764 Aborted EXEEXT='' srcdir='.' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP' LOCALE_ZH_CN='zh_CN.GB18030' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_FR='fr_FR' LOCALE_FR_UTF8='fr_FR.UTF-8' LOCALE_JA='ja_JP' LOCALE_ZH_CN='zh_CN.GB18030' ${dir}$tst
> FAIL: test-getlogin_r
> PASS: test-gettimeofday
> PASS: test-glob
> PASS: test-hash
> PASS: test-inet_ntop
> PASS: test-inet_pton
> PASS: test-lchown
> PASS: test-lseek.sh
> PASS: test-lstat
> PASS: test-mbrtowc1.sh
> PASS: test-mbrtowc2.sh
> PASS: test-mbrtowc3.sh
> PASS: test-mbrtowc4.sh
> PASS: test-mbsinit.sh
> PASS: test-mbsrtowcs1.sh
> PASS: test-mbsrtowcs2.sh
> PASS: test-mbsrtowcs3.sh
> PASS: test-mbsrtowcs4.sh
> PASS: test-memchr
> PASS: test-memrchr
> PASS: test-mkdir
> PASS: test-netdb
> PASS: test-netinet_in
> PASS: test-open
> PASS: test-fchownat
> PASS: test-fstatat
> PASS: test-mkdirat
> PASS: test-openat
> PASS: test-unlinkat
> PASS: test-perror.sh
> PASS: test-pread.sh
> PASS: test-priv-set
> PASS: test-rawmemchr
> PASS: test-readlink
> PASS: test-rmdir
> Unconnected socket test... passed
> Connected sockets test... passed
> General socket test with fork... passed
> Pipe test... passed
> PASS: test-select
> ./test-select-in.sh: line 21: echo: write error: Broken pipe
> PASS: test-select-in.sh
> PASS: test-select-out.sh
> PASS: test-sleep
> PASS: test-snprintf
> PASS: test-sockets
> PASS: test-stat
> PASS: test-stat-time
> PASS: test-stdbool
> PASS: test-stddef
> PASS: test-stdint
> PASS: test-stdio
> PASS: test-stdlib
> PASS: test-strchrnul
> PASS: test-strerror
> PASS: test-string
> PASS: test-symlink
> PASS: test-symlinkat
> PASS: test-sys_ioctl
> PASS: test-sys_select
> PASS: test-sys_socket
> PASS: test-sys_stat
> PASS: test-sys_time
> PASS: test-sys_wait
> PASS: test-time
> PASS: test-dup-safer
> PASS: test-unistd
> PASS: test-unlink
> PASS: test-usleep
> skipping test: setting symlink time not supported on this file system
> SKIP: test-utimens
> PASS: test-vasnprintf
> PASS: test-vasprintf
> PASS: test-wchar
> PASS: test-wctype
> PASS: test-xalloc-die.sh
> ====================
> 1 of 93 tests failed
> (1 test was not run)
> ====================
> make[6]: *** [check-TESTS] Error 1
> make[6]: Leaving directory `/home/rpmbuilder/redhat/BUILD/libguestfs-1.0.85/daemon/tests'
> make[5]: *** [check-am] Error 2
> make[5]: Leaving directory `/home/rpmbuilder/redhat/BUILD/libguestfs-1.0.85/daemon/tests'
> make[4]: *** [check-recursive] Error 1
> make[4]: Leaving directory `/home/rpmbuilder/redhat/BUILD/libguestfs-1.0.85/daemon/tests'
> make[3]: *** [check] Error 2
> make[3]: Leaving directory `/home/rpmbuilder/redhat/BUILD/libguestfs-1.0.85/daemon/tests'
> make[2]: *** [check-recursive] Error 1
> make[2]: Leaving directory `/home/rpmbuilder/redhat/BUILD/libguestfs-1.0.85/daemon'
> make[1]: *** [check] Error 2
> make[1]: Leaving directory `/home/rpmbuilder/redhat/BUILD/libguestfs-1.0.85/daemon'
> make: *** [check-recursive] Error 1
> error: Bad exit status from /home/rpmbuilder/redhat/tmp/rpm-tmp.68538 (%check)
>
>
> RPM build errors:
> Bad exit status from /home/rpmbuilder/redhat/tmp/rpm-tmp.68538 (%check)
It's a gnulib bug. I'm not sure what, but you can generally skip
these, or report the bug directly to the gnulib upstream:
http://www.gnu.org/software/gnulib/
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
14 years, 7 months