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>
Wed, 13 Apr 2011 21:35:35 +0000 (22:35 +0100)
commit3c1f762abed92f7a358f3bc93e3396d0606b18ad
treea192d1a370a524a4cde61967d5a83ad0cea06276
parent70975981bed8e0c01b5966c10b507bb82086e5f8
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.
src/inspect.c