[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 1/3] Rename HVTarget -> Converter



This is in preparation for a merge of HVSource and HVTarget.
---
 MANIFEST                                         |    4 +-
 lib/Sys/VirtV2V.pm                               |    2 +-
 lib/Sys/VirtV2V/{HVTarget.pm => Converter.pm}    |   44 +++++++++++-----------
 lib/Sys/VirtV2V/{HVTarget => Converter}/Linux.pm |   34 ++++++++--------
 lib/Sys/VirtV2V/HVSource.pm                      |    2 +-
 v2v/virt-v2v.pl                                  |    4 +-
 6 files changed, 45 insertions(+), 45 deletions(-)
 rename lib/Sys/VirtV2V/{HVTarget.pm => Converter.pm} (65%)
 rename lib/Sys/VirtV2V/{HVTarget => Converter}/Linux.pm (95%)

diff --git a/MANIFEST b/MANIFEST
index 3489ff1..8710a84 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -8,8 +8,8 @@ lib/Sys/VirtV2V/GuestOS.pm
 lib/Sys/VirtV2V/GuestOS/RedHat.pm
 lib/Sys/VirtV2V/HVSource.pm
 lib/Sys/VirtV2V/HVSource/Xen/Linux.pm
-lib/Sys/VirtV2V/HVTarget.pm
-lib/Sys/VirtV2V/HVTarget/Linux.pm
+lib/Sys/VirtV2V/Converter.pm
+lib/Sys/VirtV2V/Converter/Linux.pm
 lib/Sys/VirtV2V/MetadataReader.pm
 lib/Sys/VirtV2V/MetadataReader/LibVirt.pm
 lib/Sys/VirtV2V/MetadataReader/LibVirtXML.pm
diff --git a/lib/Sys/VirtV2V.pm b/lib/Sys/VirtV2V.pm
index 50f16d0..a8731af 100644
--- a/lib/Sys/VirtV2V.pm
+++ b/lib/Sys/VirtV2V.pm
@@ -63,7 +63,7 @@ L<virt-v2v(1)>,
 L<v2v-snapshot(1)>,
 L<Sys::VirtV2V::GuestOS(3pm)>,
 L<Sys::VirtV2V::HVSource(3pm)>,
-L<Sys::VirtV2V::HVTarget(3pm)>,
+L<Sys::VirtV2V::Converter(3pm)>,
 L<Sys::VirtV2V::MetadataReader(3pm)>,
 L<http://libguestfs.org/>
 
diff --git a/lib/Sys/VirtV2V/HVTarget.pm b/lib/Sys/VirtV2V/Converter.pm
similarity index 65%
rename from lib/Sys/VirtV2V/HVTarget.pm
rename to lib/Sys/VirtV2V/Converter.pm
index dfb6396..e78e940 100644
--- a/lib/Sys/VirtV2V/HVTarget.pm
+++ b/lib/Sys/VirtV2V/Converter.pm
@@ -1,4 +1,4 @@
-# Sys::VirtV2V::HVTarget
+# Sys::VirtV2V::Converter
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This library is free software; you can redistribute it and/or
@@ -15,13 +15,13 @@
 # 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::HVTarget;
+package Sys::VirtV2V::Converter;
 
 use strict;
 use warnings;
 
 use Module::Pluggable sub_name => 'modules',
-                      search_path => ['Sys::VirtV2V::HVTarget'],
+                      search_path => ['Sys::VirtV2V::Converter'],
                       require => 1;
 
 use Locale::TextDomain 'virt-v2v';
@@ -30,28 +30,28 @@ use Locale::TextDomain 'virt-v2v';
 
 =head1 NAME
 
-Sys::VirtV2V::HVTarget - Configure a guest to run on KVM
+Sys::VirtV2V::Converter - Convert a guest to run on KVM
 
 =head1 SYNOPSIS
 
  use Sys::VirtV2V::GuestOS;
- use Sys::VirtV2V::HVTarget;
+ use Sys::VirtV2V::Converter;
 
  my $guestos = Sys::VirtV2V::GuestOS->instantiate($g, $os);
- Sys::VirtV2V::HVTarget->configure($vmm, $guestos, $dom, $os);
+ Sys::VirtV2V::Converter->convert($vmm, $guestos, $dom, $os);
 
 =head1 DESCRIPTION
 
-Sys::VirtV2V::HVTarget instantiates an appropriate backend for the target guest
-OS, and uses it to configure the guest to run on KVM.
+Sys::VirtV2V::Converter instantiates an appropriate backend for the target guest
+OS, and uses it to convert the guest to run on KVM.
 
 =head1 METHODS
 
 =over
 
-=item Sys::VirtV2V::HVTarget->configure(vmm, guestos, dom, desc)
+=item Sys::VirtV2V::Converter->convert(vmm, guestos, dom, desc)
 
-Instantiate an appropriate backend and call configure on it.
+Instantiate an appropriate backend and call convert on it.
 
 =over
 
@@ -75,25 +75,25 @@ The OS description returned by Sys::Guestfs::Lib.
 
 =cut
 
-sub configure
+sub convert
 {
     my $class = shift;
 
     my ($vmm, $guestos, $dom, $desc) = @_;
-    carp("configure called without vmm argument") unless defined($vmm);
-    carp("configure called without guestos argument") unless defined($guestos);
-    carp("configure called without dom argument") unless defined($dom);
-    carp("configure called without desc argument") unless defined($desc);
+    carp("convert called without vmm argument") unless defined($vmm);
+    carp("convert called without guestos argument") unless defined($guestos);
+    carp("convert called without dom argument") unless defined($dom);
+    carp("convert called without desc argument") unless defined($desc);
 
-    # Find a module which can configure this guest and run it
+    # Find a module which can convert this guest and run it
     foreach my $module ($class->modules()) {
         if($module->can_handle($desc)) {
-            $module->configure($vmm, $guestos, $dom, $desc);
+            $module->convert($vmm, $guestos, $dom, $desc);
             return;
         }
     }
 
-    die(__"Unable to find a module to configure this guest");
+    die(__"Unable to find a module to convert this guest");
 }
 
 =back
@@ -114,11 +114,11 @@ An OS description as returned by Sys::Guestfs::Lib.
 
 =back
 
-=item CLASS->configure(vmm, guestos, dom, desc)
+=item CLASS->convert(vmm, guestos, dom, desc)
 
-Configure the target guest to run on KVM.
+Convert the target guest to run on KVM.
 
-can_handle() must have been checked prior to running configure().
+can_handle() must have been checked prior to running convert().
 
 =over
 
@@ -152,7 +152,7 @@ Please see the file COPYING.LIB for the full license.
 
 =head1 SEE ALSO
 
-L<Sys::VirtV2V::HVTarget::Linux(3pm)>,
+L<Sys::VirtV2V::Converter::Linux(3pm)>,
 L<Sys::VirtV2V::GuestOS(3pm)>,
 L<Sys::Guestfs::Lib(3pm)>,
 L<Sys::Virt(3pm)>,
diff --git a/lib/Sys/VirtV2V/HVTarget/Linux.pm b/lib/Sys/VirtV2V/Converter/Linux.pm
similarity index 95%
rename from lib/Sys/VirtV2V/HVTarget/Linux.pm
rename to lib/Sys/VirtV2V/Converter/Linux.pm
index dc546de..070c4f3 100644
--- a/lib/Sys/VirtV2V/HVTarget/Linux.pm
+++ b/lib/Sys/VirtV2V/Converter/Linux.pm
@@ -1,4 +1,4 @@
-# Sys::VirtV2V::HVTarget::Linux
+# Sys::VirtV2V::Converter::Linux
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This library is free software; you can redistribute it and/or
@@ -15,7 +15,7 @@
 # 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::HVTarget::Linux;
+package Sys::VirtV2V::Converter::Linux;
 
 use strict;
 use warnings;
@@ -35,20 +35,20 @@ use Carp;
 
 =head1 NAME
 
-Sys::VirtV2V::HVTarget::Linux - Configure a Linux guest to run on KVM
+Sys::VirtV2V::Converter::Linux - Convert a Linux guest to run on KVM
 
 =head1 SYNOPSIS
 
  use Sys::VirtV2V::GuestOS;
- use Sys::VirtV2V::HVTarget;
+ use Sys::VirtV2V::Converter;
 
  my $guestos = Sys::VirtV2V::GuestOS->instantiate($g, $os);
- Sys::VirtV2V::HVTarget->configure($vmm, $guestos, $dom, $os);
+ Sys::VirtV2V::Converter->convert($vmm, $guestos, $dom, $os);
 
 =head1 DESCRIPTION
 
-Sys::VirtV2V::HVTarget::Linux configures a Linux guest to use KVM. It is an
-implementation of the Sys::VirtV2V::HVTarget interface.
+Sys::VirtV2V::Converter::Linux convert a Linux guest to use KVM. It is an
+implementation of the Sys::VirtV2V::Converter interface.
 
 =head1 METHODS
 
@@ -95,9 +95,9 @@ use constant KVM_XML_NOVIRTIO => "
 </domain>
 ";
 
-=item Sys::VirtV2V::HVTarget::Linux->can_handle(desc)
+=item Sys::VirtV2V::Converter::Linux->can_handle(desc)
 
-See BACKEND INTERFACE in L<Sys::VirtV2V::HVTarget> for details.
+See BACKEND INTERFACE in L<Sys::VirtV2V::Converter> for details.
 
 =cut
 
@@ -111,21 +111,21 @@ sub can_handle
     return ($desc->{os} eq 'linux');
 }
 
-=item Sys::VirtV2V::HVTarget::Linux->configure(vmm, guestos, dom, desc)
+=item Sys::VirtV2V::Converter::Linux->convert(vmm, guestos, dom, desc)
 
-See BACKEND INTERFACE in L<Sys::VirtV2V::HVTarget> for details.
+See BACKEND INTERFACE in L<Sys::VirtV2V::Converter> for details.
 
 =cut
 
-sub configure
+sub convert
 {
     my $class = shift;
 
     my ($vmm, $guestos, $dom, $desc) = @_;
-    carp("configure called without vmm argument") unless defined($vmm);
-    carp("configure called without guestos argument") unless defined($guestos);
-    carp("configure called without dom argument") unless defined($dom);
-    carp("configure called without desc argument") unless defined($desc);
+    carp("convert called without vmm argument") unless defined($vmm);
+    carp("convert called without guestos argument") unless defined($guestos);
+    carp("convert called without dom argument") unless defined($dom);
+    carp("convert called without desc argument") unless defined($desc);
 
     # Un-configure HV specific attributes which don't require a direct
     # replacement
@@ -645,7 +645,7 @@ Please see the file COPYING.LIB for the full license.
 
 =head1 SEE ALSO
 
-L<Sys::VirtV2V::HVTarget(3pm)>,
+L<Sys::VirtV2V::Converter(3pm)>,
 L<Sys::VirtV2V(3pm)>,
 L<virt-v2v(1)>,
 L<http://libguestfs.org/>.
diff --git a/lib/Sys/VirtV2V/HVSource.pm b/lib/Sys/VirtV2V/HVSource.pm
index a9e4602..621d54b 100644
--- a/lib/Sys/VirtV2V/HVSource.pm
+++ b/lib/Sys/VirtV2V/HVSource.pm
@@ -45,7 +45,7 @@ Sys::VirtV2V::HVSource - Discover source hypervisor artifacts in a guest
 
 Sys::VirtV2V::HVSource provides a mechanism for identifying properties of a
 guest operating system which relate specifically to a particular hypervisor. It
-is used by a Sys::VirtV2V::HVTarget when reconfiguring the guest.
+is used by a Sys::VirtV2V::Converter when reconfiguring the guest.
 
 A call to any of these methods will call, and aggregate if relevant,  all
 implemented Sys::VirtV2V::HVSource backends.
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index a0f7843..9eee590 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -32,7 +32,7 @@ use Sys::Guestfs::Lib qw(open_guest get_partitions inspect_all_partitions
 
 use Sys::VirtV2V;
 use Sys::VirtV2V::GuestOS;
-use Sys::VirtV2V::HVTarget;
+use Sys::VirtV2V::Converter;
 use Sys::VirtV2V::MetadataReader;
 use Sys::VirtV2V::UserMessage qw(user_message);
 
@@ -240,7 +240,7 @@ my $os = inspect_guest($g);
 my $guestos = Sys::VirtV2V::GuestOS->instantiate($g, $os);
 
 # Modify the guest and its metadata for the target hypervisor
-Sys::VirtV2V::HVTarget->configure($vmm, $guestos, $dom, $os);
+Sys::VirtV2V::Converter->convert($vmm, $guestos, $dom, $os);
 
 $g->umount_all();
 $g->sync();
-- 
1.6.5.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]