inspect: Cache downloaded files in the handle g->tmpdir.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 13 Apr 2011 21:35:35 +0000 (22:35 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 18 Apr 2011 21:08:45 +0000 (22:08 +0100)
commit9dc18e406bf7aafd552bfd8837e559c53f80e21d
treedb40e50c3d45374ee35adb1e81b70401bc98d95e
parentfe03580928ecac05d71e7dc0435487c9e467b1cc
inspect: Cache downloaded files in the handle g->tmpdir.

During inspection we download various files such as the Windows
'software' and 'system' registries.  Previously these were downloaded
as temporary files and discarded immediately after use.  This meant
that the 'software' registry was being downloaded twice by
virt-inspector (it's required once for basic OS inspection, and a
second time to list Windows applications).

This commit changes this so that these files are cached in g->tmpdir,
and thus the second time we just reuse the file we've already
downloaded.

Callers shouldn't be relying on inspect-list-applications to reread
the actual registry from the VM (unless you close and reopen the
handle).  It says in the documentation that the results of inspection
may be cached in the handle.
(cherry picked from commit 3c1f762abed92f7a358f3bc93e3396d0606b18ad)
src/inspect.c