[systemd-devel] [PATCH 1/2] libsystemd: add sd-hwdb library
gregkh at linuxfoundation.org
Wed Dec 3 16:53:29 PST 2014
On Thu, Dec 04, 2014 at 12:57:53AM +0100, Tom Gundersen wrote:
> On Wed, Dec 3, 2014 at 10:19 PM, Greg KH <gregkh at linuxfoundation.org> wrote:
> > On Wed, Dec 03, 2014 at 10:11:40PM +0100, Tom Gundersen wrote:
> >> This is libudev-hwdb, but decoupled from libudev and in the libsystemd style.
> >> The core code is unchanged, apart from the following minor changes:
> >> - hwdb.bin located in /**/systemd/hwdb/ take preference over the ones located
> >> in /**/udev/
> >> - properties are stored internally in an OrderedHashmap, rather than a
> >> linked list.
> >> - a new API call allows individual properties to be queried directly, rather
> >> than iterating over them all
> >> - the iteration over properties have been moved inside the library, rather than
> >> exposing a list directly
> >> - the unused 'flags' parameter was dropped
> > Why pull this apart?
> We'd like to move the libudev API closer to the libsystemd one, and as
> the hwdb stuff is actually completely separate from the rest of
> libudev, it is a nice place to start I thought. The benefit is rather
> minor (consistency of API and improved error handling), but still
> worth-while I think.
That makes sense.
> > Are other applications wanting to use this?
> A couple applications use hwdb directly yes, and in some cases without
> using libudev for anything else.
I maintain one such application, usbutils, that only depends on libudev
for the database, so this will be a nice change for it to make.
> If people start using dbus more in
> place of the userspace-to-userspace udev transport, then I guess we'll
> have more cases of programs using hwdb directly without otherwise
> needing libudev, so having these separate (at least their API, if not
> the actual .so) makes sense I think. There have been requests for
> splitting out hwdb before , but I don't think these patches help
> much for what they want (and hwdb really does not make sense in a
> non-Linux setting anyway, so I'm not really convinced by that feature
> request at all).
There have been some requests in Gentoo to split this out as well, so
this will make those users happy.
thanks for doing this.
More information about the systemd-devel