Description of problem: On a debian host, if db_dump is not installed, the inspection of a centos VM (probably all rpm based distro) is failing Version-Release number of selected component (if applicable): 1.34.3 How reproducible: Always Steps to Reproduce: 1. Run virt-inspector /tmp/my_vm.img 2. libguestfs: error: /usr/bin/db_dump exited with error status 1. Actual results: The inspection fails Expected results: The inspection succeed without the list installed RPM's Additional info: I'm also wondering that in some conditions (other endianess or different Berkeley DB versiob) that the db_dump command can simply fail. That would probably also cause the inspection to fail.
Probably a missing dependency of the Debian package.
Yes the dependency is indeed missing (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=849597). But what about the other concerns?
(In reply to Laurent Bigonville from comment #0) > Additional info: > I'm also wondering that in some conditions (other endianess or different > Berkeley DB versiob) that the db_dump command can simply fail. That would > probably also cause the inspection to fail. The BDB format is designed to cope with these cases.
While the Debian package missed a Depends (or Recommends/Suggests), IMHO the library (and the tools) should cope better with external programs used. The support for dumping RPM databases (for packages) is enabled only when the libdb tools are found during at configure time, so in the same way the code block could be skipped when the tool is not found at runtime: this would enable packagers to use better "weak dependencies" for all the non-mandatory features that require external tools (for example dumping of RPM databases, extraction of icon from Windows and CirrOS guests, etc). I'll come up with a patch to do this.
(In reply to Pino Toscano from comment #4) > While the Debian package missed a Depends (or Recommends/Suggests), IMHO the > library (and the tools) should cope better with external programs used. > > The support for dumping RPM databases (for packages) is enabled only when > the libdb tools are found during at configure time, so in the same way the > code block could be skipped when the tool is not found at runtime: this > would enable packagers to use better "weak dependencies" for all the > non-mandatory features that require external tools (for example dumping of > RPM databases, extraction of icon from Windows and CirrOS guests, etc). > > I'll come up with a patch to do this. Series for this: https://www.redhat.com/archives/libguestfs/2017-January/msg00034.html
v2 of the patch series was rejected upstream: https://www.redhat.com/archives/libguestfs/2017-February/msg00043.html (In reply to Pino Toscano from comment #4) > The support for dumping RPM databases (for packages) is enabled only when > the libdb tools are found during at configure time, so in the same way the > code block could be skipped when the tool is not found at runtime: this > would enable packagers to use better "weak dependencies" for all the > non-mandatory features that require external tools (for example dumping of > RPM databases, extraction of icon from Windows and CirrOS guests, etc). I'm not sure I agree with this premise either. The dependency could still be required at build time, and then become a weak dependency at run time. It seems we don't handle this case very well at the moment. But a minimal change to fix this bug would be to just (re-)check if DB_DUMP is still available at runtime before trying to run the command. I'll have a go at that.
https://www.redhat.com/archives/libguestfs/2017-October/msg00032.html
My second version posted: https://www.redhat.com/archives/libguestfs/2017-October/msg00058.html
I think the patch in comment 8 was forgotten about so I've reposted it: https://www.redhat.com/archives/libguestfs/2018-November/msg00011.html
(In reply to Richard W.M. Jones from comment #9) > I think the patch in comment 8 was forgotten about so I've reposted it: > > https://www.redhat.com/archives/libguestfs/2018-November/msg00011.html It was not forgotten, simply I don't agree with this approach, and I rather prefer a proper handling of _runtime_ tools at _runtime_. Reply sent: https://www.redhat.com/archives/libguestfs/2018-November/msg00013.html This is my proposal: https://www.redhat.com/archives/libguestfs/2017-February/msg00043.html
libguestfs 1.45.3 will use librpm directly to access the RPM database, and removes the requirement for db_dump, therefore closing.