[PATCH 0/2] convert: Use yum/apt/... for package removals
by Cole Robinson
https://issues.redhat.com/browse/RHEL-71522
Switch package removal from rpm/dep to yum/dnf/etc, to handle
the case when other packages depend on ex. open-vm-tools
Changes since RFC:
+ use cached `inspect` data -> fixes test suite
+ make failure non-fatal
+ ignore empty package list
This may still break some really old cases. Notable `unconfigure_xen`
has a comment referencing RHEL 3, which lacks yum AFAIK. Which would
cause Guest_packages.uninstall_command to error.
Maybe we don't care about RHEL-3?
Or turn the error into a warning and be done with it?
Cole Robinson (2):
convert: Use yum/apt/... for package removals, not rpm/dpkg
convert: make package removal failure non-fatal
convert/convert_linux.ml | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
--
2.48.1
3 weeks, 2 days
[PATCH] WIP: convert: Use yum/apt/... for package removals, not rpm/dpkg
by Cole Robinson
Current package removal implementation uses `rpm -e`, which will
fail if anything depends on the package we are trying to remove.
Like when `spausedd` is dependent on `open-vm-tools`.
Reuse the package uninstall logic from virt-customize, which
will handle this no problem.
Fixes: https://issues.redhat.com/browse/RHEL-71522
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
First time touching ocaml, be gentle :)
This fixes my minimal test case, but there's test suite
regressions.
+ How to run a single test against in tree virt-v2v?
+ and/or get `make check` to spit out more info?
more questions:
+ uninstall failure is still fatal. example how to make this
non-fatal?
+ `virt-v2v -v` logs don't show command stdout.
expected? do I need an extra debug option?
+ better way to share code with customize_run.ml ?
guest_pkgs_command() is lifted from there
+ should I instead change Linux.remove impl, or should I aim
to remove that code entirely?
convert/convert_linux.ml | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
index 3d0e2b88..2e0cf61b 100644
--- a/convert/convert_linux.ml
+++ b/convert/convert_linux.ml
@@ -131,6 +131,18 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
(*----------------------------------------------------------------------*)
(* Conversion step. *)
+ let guest_pkgs_command f =
+ try f (g#inspect_get_package_management inspect.i_root) with
+ | Guest_packages.Unknown_package_manager msg
+ | Guest_packages.Unimplemented_package_manager msg ->
+ error "%s" msg
+ in
+
+ let uninstall_packages pkgs =
+ let cmd = guest_pkgs_command(Guest_packages.uninstall_command pkgs) in
+ ignore (g#sh cmd);
+ in
+
let rec do_convert () =
augeas_grub_configuration ();
@@ -237,7 +249,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
else
None
) inspect.i_apps in
- Linux.remove g inspect.i_root xenmods;
+ uninstall_packages xenmods;
(* Undo related nastiness if kmod-xenpv was installed. *)
if xenmods <> [] then (
@@ -310,7 +322,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
fun { G.app2_name = name } -> name = package_name
) inspect.i_apps in
if has_guest_additions then
- Linux.remove g inspect.i_root [package_name];
+ uninstall_packages [package_name];
(* Guest Additions might have been installed from a tarball. The
* above code won't detect this case. Look for the uninstall tool
@@ -455,8 +467,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
)
);
- let remove = !remove in
- Linux.remove g inspect.i_root remove;
+ uninstall_packages !remove;
(* VMware Tools may have been installed from a tarball, so the
* above code won't remove it. Look for the uninstall tool and run
@@ -503,7 +514,7 @@ let convert (g : G.guestfs) source inspect i_firmware _ keep_serial_console _ =
let pkgs = List.map (fun { G.app2_name = name } -> name) pkgs in
if pkgs <> [] then (
- Linux.remove g inspect.i_root pkgs;
+ uninstall_packages pkgs;
(* Installing these guest utilities automatically unconfigures
* ttys in /etc/inittab if the system uses it. We need to put
--
2.48.1
3 weeks, 2 days
[PATCH 0/2] appliance: fix Debian dependencies
by da.gomez@kernel.org
Add support for the new default DHCP client and fix sfdisk missing
dependency.
To: guestfs(a)lists.libguestfs.org
Cc: da.gomez(a)samsung.com
Signed-off-by: Daniel Gomez <da.gomez(a)samsung.com>
---
Daniel Gomez (2):
appliance: add dhcpcd support on Debian
appliance: add support for sfdisk on Debian
appliance/packagelist.in | 3 +++
1 file changed, 3 insertions(+)
---
base-commit: 0dee44bd369c59da2bd0aa531d98d96f619f428e
change-id: 20250205-fix-debian-deps-8be4c30106c9
Best regards,
--
Daniel Gomez <da.gomez(a)samsung.com>
3 weeks, 2 days