|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [Qemu-devel] [PATCH v3 03/10] tests: Add vm test lib |
Date: | Tue, 22 Aug 2017 11:23:42 -0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
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-releaseThey 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 :)
[Prev in Thread] | Current Thread | [Next in Thread] |