mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
inspection: Fix inspection of recent RPM guests using non-BDB.
Recent RPM-based guests have switched from using Berkeley DB (BDB) to sqlite. In order to inspect these guests (and earlier ones) we need to stop using the hokey parsing of the BDB and use librpm APIs instead. This commit adds a new internal API so we can call librpm from the daemon, and changes the library part to use the new API for RPM-based guests. This change removes the requirement for BDB tools like db_dump. See also: http://lists.rpm.org/pipermail/rpm-ecosystem/2021-March/000751.html http://lists.rpm.org/pipermail/rpm-ecosystem/2021-March/000754.html https://blog.fpmurphy.com/2011/08/programmatically-retrieve-rpm-package-details.html This breaks the virt-inspector test (now in the separate guestfs-tools repository). However this is not a bug in libguestfs, but a bug in the phoney Fedora guest that we use for testing - we created a BDB-style RPM database which was supposed to be just enough to make the old code work. The new code using real librpm needs /usr/lib/rpm/rpmrc (not present in the phoney image) and also cannot parse the phoney database, so we will need to separately rework that test. Thanks: Panu Matilainen Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1766487 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1409024
This commit is contained in:
@@ -607,6 +607,16 @@ Please read L<guestfs(3)/INSPECTION> for more details.
|
||||
See also C<guestfs_inspect_get_mountpoints>,
|
||||
C<guestfs_inspect_get_filesystems>." };
|
||||
|
||||
{ defaults with
|
||||
name = "internal_list_rpm_applications"; added = (1, 45, 3);
|
||||
style = RStructList ("applications2", "application2"), [], [];
|
||||
visibility = VInternal;
|
||||
impl = OCaml "Rpm.internal_list_rpm_applications";
|
||||
shortdesc = "get applications from RPM guest";
|
||||
longdesc = "\
|
||||
This internal function is used by C<guestfs_inspect_list_applications2>
|
||||
to list the applications for RPM guests."};
|
||||
|
||||
]
|
||||
|
||||
let non_daemon_functions = [
|
||||
|
||||
@@ -516,6 +516,7 @@ let proc_nr = [
|
||||
507, "luks_uuid";
|
||||
508, "cryptsetup_open";
|
||||
509, "cryptsetup_close";
|
||||
510, "internal_list_rpm_applications";
|
||||
]
|
||||
|
||||
(* End of list. If adding a new entry, add it at the end of the list
|
||||
|
||||
Reference in New Issue
Block a user