[Pkg-libvirt-commits] [libguestfs] 106/266: v2v: Pass acpi, apic, pae features through to libvirt XML output.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit 5e872dbd2e50222c68aa7c10e88709a5c7a0687f
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Aug 15 08:51:59 2014 +0100

    v2v: Pass acpi, apic, pae features through to libvirt XML output.
    
    Notes:
    
     - Drop the acpi feature for RHEL 3.  Old virt-v2v says there is
       a problem presenting ACPI to RHEL 3 guests although it is not
       specific about what this is.
    
     - Old virt-v2v does not pass features through to OVF at all.
---
 v2v/convert_linux.ml   | 10 ++++++++++
 v2v/convert_windows.ml |  1 +
 v2v/target_local.ml    |  9 ++++++++-
 v2v/types.ml           |  1 +
 v2v/types.mli          |  1 +
 5 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 18fb64f..041b40a 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -992,6 +992,13 @@ let rec convert ?(keep_serial_console = true) verbose (g : G.guestfs)
            msg
     )
 
+  and supports_acpi () =
+    (* ACPI known to cause RHEL 3 to fail. *)
+    if family = `RHEL_family && inspect.i_major_version == 3 then
+      false
+    else
+      true
+
   and remap_block_devices virtio =
     (* This function's job is to iterate over boot configuration
      * files, replacing "hda" with "vda" or whatever is appropriate.
@@ -1146,6 +1153,8 @@ let rec convert ?(keep_serial_console = true) verbose (g : G.guestfs)
     grub_remove_console ();
   );
 
+  let acpi = supports_acpi () in
+
   (*
     XXX to do from original v2v:
     configure display driver
@@ -1157,6 +1166,7 @@ let rec convert ?(keep_serial_console = true) verbose (g : G.guestfs)
   let guestcaps = {
     gcaps_block_bus = if virtio then "virtio" else "ide";
     gcaps_net_bus = if virtio then "virtio" else "e1000";
+    gcaps_acpi = acpi;
   (* XXX display *)
   } in
 
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index 626a427..a585d14 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
@@ -470,6 +470,7 @@ echo uninstalling Xen PV driver
   let guestcaps = {
     gcaps_block_bus = block_driver;
     gcaps_net_bus = net_driver;
+    gcaps_acpi = true;
     (* XXX display *)
   } in
 
diff --git a/v2v/target_local.ml b/v2v/target_local.ml
index e017d8a..68a1bfd 100644
--- a/v2v/target_local.ml
+++ b/v2v/target_local.ml
@@ -48,7 +48,14 @@ let create_metadata dir source overlays guestcaps =
   p "    <type arch='%s'>hvm</type>\n" source.s_arch;
   p "  </os>\n";
   p "  <features>\n";
-  List.iter (p "    <%s/>\n") source.s_features;
+  List.iter (
+    fun feature ->
+      if feature = "acpi" && not guestcaps.gcaps_acpi then
+        (* drop acpi if the guest doesn't support it *) ()
+      else
+        (* pass through all other features *)
+        p "    <%s/>\n" feature
+  ) source.s_features;
   p "  </features>\n";
 
   p "  <on_poweroff>destroy</on_poweroff>\n";
diff --git a/v2v/types.ml b/v2v/types.ml
index 9f8a71f..7c1c937 100644
--- a/v2v/types.ml
+++ b/v2v/types.ml
@@ -132,4 +132,5 @@ type inspect = {
 type guestcaps = {
   gcaps_block_bus : string;
   gcaps_net_bus : string;
+  gcaps_acpi : bool;
 }
diff --git a/v2v/types.mli b/v2v/types.mli
index 7479ca0..6593c90 100644
--- a/v2v/types.mli
+++ b/v2v/types.mli
@@ -101,6 +101,7 @@ type inspect = {
 type guestcaps = {
   gcaps_block_bus : string;    (** "virtio", "ide", possibly others *)
   gcaps_net_bus : string;      (** "virtio", "e1000", possibly others *)
+  gcaps_acpi : bool;           (** guest supports acpi *)
   (* XXX acpi, display *)
 }
 (** Guest capabilities after conversion.  eg. Was virtio found or installed? *)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list