Change download_to_tmp so it can work with multi-root operating systems.
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 27 Jun 2011 15:10:25 +0000 (16:10 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 13 Jul 2011 16:01:56 +0000 (17:01 +0100)
commit4b563e4201e7f304c1aec9d7b853f2e5cdf0a0eb
treec537118655d032070a8c4b9881d064df3162db96
parenta3f4c85bd1ebd994c41e58986ddd8fb7f59f5898
Change download_to_tmp so it can work with multi-root operating systems.

The previous guestfs___download_to_tmp function did not handle
multiboot correctly.  In particular it used the same cache name
for downloaded files from different roots, which could have caused
things like applications in each root to be confused.

This changes the function so that the cache filename is prefixed
with the root / fs number, eg. $tmpdir/0-Name instead of $tmpdir/Name.

This change also requires the function to return the new name, so
all places in the code which called this function had to be
updated.

This updates and fixes commit 3c1f762abed92f7a358f3bc93e3396d0606b18ad.

(Cherry picked and backported from
commit 5f26270c343bf543a7bf20cf3e6f182f6282f8ea)
src/guestfs-internal.h
src/inspect.c
src/inspect_apps.c
src/inspect_fs_windows.c