On Mon, Feb 01, 2016 at 12:51:47PM +0100, Jan Zelený wrote: > On 1. 2. 2016 at 09:59:23, Richard W.M. Jones wrote: > > On Mon, Feb 01, 2016 at 09:44:29AM +0100, Jan Zelený wrote: > > > On 29. 1. 2016 at 22:03:00, Richard W.M. Jones wrote: > > > > FWIW I found the new database backend (not mentioned anywhere in the > > > > > > > > original submission). It is here: > > > > http://rpm.org/gitweb?p=rpm.git;a=tree;f=lib/backend/ndb > > > > > > > > Since this change has (rashly) been approved by FESCO, I guess we're > > > > going to be copying this code into some libguestfs tools, and we'll > > > > have to keep up with changes to RPM. It's a drag compared to using a > > > > real key-value store. > > > > > > May I ask why? Accessing rpm database in a different way than through > > > librpm API is highly discouraged even now. > > > > It's discussed in this thread already. Please see: > > > > https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ > > message/QZG6BVLOOYYGLFJQK5RQ5LAPJIL2KMYF/ > > https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org > > /message/NYEVENDEUVPRMWD7PJM2IJSR54H25SKI/ > > > > Even if the RPM database is only accessed via librpm, it's still > > important that the most central database present on every Fedora > > system is reliable, well-tested and flexible. Sqlite is a highly > > regarded piece of software, which runs on billions of Android phones. > > Fair enough but that doesn't answer my question. What is the reason for > copying rpm code in libguestfs instead of using librpm?
I don't have a clear answer on that yet, because I'm still waiting to find out if the database format will change incompatibly in future. If it changes incompatibly in future, and if librpm won't maintain backwards compatibility with old databases, then we'll need to take snapshots of the librpm code to ensure we can read old RPM databases out of guests. Notes: - I'm not talking about the BDB format - I understand the licensing issues which require a clean break. - I couldn't find a way in the the current librpm code to open the RPM database from a different location - obviously required because we need to open the database using our own trusted code, *not* the guest's untrusted code as was proposed elsewhere in this thread. However that's not a reason not to use librpm, since we could add APIs to do that. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/ -- devel mailing list devel@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org