On Wed, Nov 07, 2018 at 12:53:20PM +0100, Tomáš Golembiovský wrote:
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
v2v/convert_linux.ml | 2 ++
v2v/windows_virtio.ml | 30 ++++++++++++++++++++++++++++++
v2v/windows_virtio.mli | 4 ++++
3 files changed, 36 insertions(+)
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index e8c64ac1b..a1bafe91a 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -81,6 +81,8 @@ let convert (g : G.guestfs) inspect source output rcaps =
let rec do_convert () =
augeas_grub_configuration ();
+ Windows_virtio.install_linux_tools g inspect;
+
unconfigure_xen ();
unconfigure_vbox ();
unconfigure_vmware ();
diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml
index da02b6c4e..223e7661b 100644
--- a/v2v/windows_virtio.ml
+++ b/v2v/windows_virtio.ml
@@ -27,6 +27,8 @@ open Regedit
open Types
open Utils
+module G = Guestfs
+
let virtio_win =
try Sys.getenv "VIRTIO_WIN"
with Not_found ->
@@ -181,6 +183,34 @@ let rec install_drivers ((g, _) as reg) inspect rcaps =
virtio_rng_supported, virtio_ballon_supported, isa_pvpanic_supported)
)
+and install_linux_tools g inspect =
+ let os = match inspect.i_distro with
+ | "fedora" -> Some "fc28"
+ | "rhel" | "centos" | "scientificlinux" |
"redhat-based"
+ | "oraclelinux" -> (match inspect.i_major_version with
+ | 6 -> Some "el6"
+ | 7 -> Some "el7"
+ | _ -> None)
+ | "sles" | "suse-based" | "opensuse" -> Some
"lp151"
+ | _ -> None in
+
+ match os with
+ | None ->
+ warning (f_"don't know how to install guest tools on %s-%d")
+ inspect.i_distro inspect.i_major_version
+ | Some os ->
+ let src_path = "linux" // os in
+ let dst_path = "/var/tmp" in
+ debug "locating packages in %s" src_path;
+ let packages = copy_from_virtio_win g inspect src_path dst_path
+ (fun _ _ -> true) in
+ debug "done copying %d files" (List.length packages);
+ let packages = List.map ((//) dst_path) packages in
+ try
+ Linux.install g inspect packages;
+ with G.Error msg ->
+ warning (f_"failed to install QEMU Guest Agent: %s") msg
So this was going to be my question about this. Here we've decided to
effectively ignore failure to install qemu-ga. Should it be an error?
What's the chance that for a supported guest it might fail? Do the
packages have complex dependencies?
The patch in general looks OK.
Rich.
and add_guestor_to_registry ((g, root) as reg) inspect drv_name
drv_pciid =
let ddb_node = g#hivex_node_get_child root "DriverDatabase" in
diff --git a/v2v/windows_virtio.mli b/v2v/windows_virtio.mli
index 91b3ced45..fa9997829 100644
--- a/v2v/windows_virtio.mli
+++ b/v2v/windows_virtio.mli
@@ -40,6 +40,10 @@ val install_drivers
virtio devices if we managed to install those, or legacy devices
if we didn't. *)
+val install_linux_tools : Guestfs.guestfs -> Types.inspect -> unit
+(** installs QEMU Guest Agent on Linux guest OS from the driver directory or
+ driver ISO. It is not fatal if we fail to install the agent. *)
+
(**/**)
(* The following function is only exported for unit tests. *)
--
2.19.0
_______________________________________________
Libguestfs mailing list
Libguestfs(a)redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW