[libvirt] [RFC PATCH 0/2] Clear capabilities cache options

John Ferlan jferlan at redhat.com
Wed May 20 12:52:55 UTC 2015


Posting this as an RFC since I'm trying to get upstream feedback on whether
either approach is better or whether perhaps both approaches should be used.

The problem occurred primarily for downstream installations where it seems
the order of the build libvirtd caused issues regarding whether certain
capabilities bits were present.  Although the history of the case doesn't
"prove" my theory exactly other issues around the same time that were part
of a private bz or email stream (I forget now) seem to indicate that the
order of libvirtd builds and installations would be very important as they
relate to when the cache is rebuilt.

In the instances seen there was lots of testing going on related to whether
patches were found in a 'maintenance release' and the 'mainline release'.
Since the process is build the mainline first and then backport the patch(es)
to the maintenance release, it's possible the date of the maintenance
libvirtd would be later than that of the mainline release.  If testing
installs the maintenance release first and the cache gets updated based
on the 'ctime' of libvirtd being later than what was currently installed
and then the mainline release is installed with a libvirtd 'ctime' that
would possibly be prior to that of the maintentance release, then the
cache wouldn't be updated.  The fix for testing has been just to delete
the cache.

In looking at the code and history, I see a couple possible solutions.
The first seems to be a "big hammer" - on every libvirtd installation we
delete the entire cache - this would force the reread. I believe I got
that right using %post of the install to clear out anything in the
capabilities directory (whether just created or already existing from some
prior installation). Another solution was to adjust the libvirtd 'ctime'
check to be if different than what is found in the cache. When looking at
the original commit, this seems to be what the intention was in the commit
message, but the actual code was slightly different. Upstream review 
comments for changes didn't mention the difference either, see:

http://www.redhat.com/archives/libvir-list/2014-March/msg00629.html

and

https://www.redhat.com/archives/libvir-list/2014-March/msg00301.html

John Ferlan (2):
  spec: Remove capabilities cache during %post install
  qemu: Force capabilities cache read if libvirtd date is different

 libvirt.spec.in              | 11 +++++++++++
 src/qemu/qemu_capabilities.c |  6 ++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

-- 
2.1.0




More information about the libvir-list mailing list