On 08/22/2017 11:00 AM, Fam Zheng wrote:
On Tue, 08/22 08:19, Philippe Mathieu-Daudé wrote:
+ def add_source_dir(self, data_dir):
+ name = "data-" + hashlib.sha1(data_dir).hexdigest()[:5]
+ tarfile = os.path.join(self._tmpdir, name + ".tar")
+ logging.debug("Creating archive %s for data dir: %s", tarfile,
data_dir)
+ subprocess.check_call(["tar", "--exclude-vcs",
--exclude-vcs-ignores will process .gitignore,
Sounds useful, thanks!
you can also list with 'git ls-files',
or generate tarball with scripts/make-release
They won't handle submodules, will they?
"git ls-files --recurse-submodules"
This way you can avoid the --exclude-vcs-ignores which is too recent for
NetBSD as remarked Kamil, and avoid the tar --exclude=
+ "--exclude=tests/vm/*.img",
+ "--exclude=tests/vm/*.img.*",
+ "--exclude=*.d",
+ "--exclude=*.o",
+ "--exclude=docker-src.*",
+ "-cf", tarfile, '.'], cwd=data_dir,
+ stdin=self._devnull, stdout=self._stdout)
+ self._data_args += ["-drive",
+ "file=%s,if=none,id=%s,cache=writeback,format=raw"
% \
+ (tarfile, name),
+ "-device",
+ "virtio-blk,drive=%s,serial=%s,bootindex=1" %
(name, name)]
what about mounting readonly via '-device virtio-9p-pci' (not using
tarball)?
It doesn't work. That way an out-of-tree build is required in the guest, but if
an in-tree build has been done in host side, out-of-tree builds fail. Also the
performance will be much worse, I believe: untar is sequential read, and after
that everything is in the guest page cache; with virtio-9p, there will be a
large amount of "random" requests between guest and host.
Indeed you are correct, I didn't think of it, thank to remember me that :)