[libvirt] [PATCH 3/8] tests: Move data directories into testQemuData

Peter Krempa pkrempa at redhat.com
Wed Mar 13 09:43:48 UTC 2019


On Wed, Mar 13, 2019 at 10:32:59 +0100, Andrea Bolognani wrote:
> On Wed, 2019-03-13 at 10:22 +0100, Peter Krempa wrote:
> > On Wed, Mar 13, 2019 at 10:18:52 +0100, Andrea Bolognani wrote:
> > > Anyway, by the end of the series we'll have to pass dataDir to
> > > testQemuCapsIterate() in addition to using it to build the path for
> > > both the input and output file, so it makes sense to store it into
> > > a variable instead of building it from abs_srcdir plus the directory
> > > name two or more times.
> > > 
> > > As for why it's stored in the structure, I could easily have used a
> > > global variable instead, but this approach seemed cleaner, especially
> > > considering that we're already using the structure to store data that
> > > is similar in scope (the driver).
> > 
> > Well, I agree that we should pre-construct the string rather than
> > constructing it multiple times, but since every use of that string is
> > inside the function which does the testing there's no point passing it
> > in via the structure.
> 
> As mentioned above, one of the uses is as an argument to
> testQemuCapsIterate(), which needs to be called from main() rather
> than from doCapsTest().

Um, my bad. I did not read the commit message thoroughly apparently.

ACK
-------------- 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/20190313/5e073edb/attachment-0001.sig>


More information about the libvir-list mailing list