[libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

Peter Krempa pkrempa at redhat.com
Tue Apr 16 14:41:57 UTC 2019


On Tue, Apr 16, 2019 at 15:32:31 +0100, Daniel Berrange wrote:
> On Tue, Apr 16, 2019 at 04:26:49PM +0200, Peter Krempa wrote:
> > On Tue, Apr 16, 2019 at 15:17:31 +0100, Daniel Berrange wrote:
> > > On Tue, Apr 16, 2019 at 04:09:54PM +0200, Peter Krempa wrote:

[...]

> > Currently there aren't any collisions which would cause problems, but I
> > have one on my private branch.
> > 
> > Given that this change is rather simple I figured we could just stop
> > inverting them.
> 
> Ok, that does make a little more sense, though generally my view would
> be that if we're doing something that is order sensitive like XML
> parsing & formatting, then we shouldn't be using a hash table to
> represent the data - at least not as the primary record. 
> 
> Which bit of code is using the hash in this case ? Is it something
> purely inside the test suite, or in the real XML handling code ?

I'm adding some private data for blockjobs which are formatted into the
status XML. I'm storing them in a hash table as the order isn't really
important here and the user should never see this.

I was just bothered by the fact that I'd need to have an output file (or
change the name of the blockjob) and figured that the insertion into the
hash table is very simple and does not really matter how we do it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190416/ce151993/attachment-0001.sig>


More information about the libvir-list mailing list