* [RFC PATCH] tests/avocado: avoid a copy to support read/write rootfs
@ 2023-12-14 14:42 Alex Bennée
0 siblings, 0 replies; only message in thread
From: Alex Bennée @ 2023-12-14 14:42 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, David Woodhouse, Paul Durrant, Cleber Rosa,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal, Paolo Bonzini, open list:Overall KVM CPUs
While the test causes the rootfs to be updated we don't actually need
to persist anything between runs. Avoid the copy by enabling
"snapshot=on" for the drive instead.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/avocado/kvm_xen_guest.py | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/tests/avocado/kvm_xen_guest.py b/tests/avocado/kvm_xen_guest.py
index d73fa888ef..f30313e6cf 100644
--- a/tests/avocado/kvm_xen_guest.py
+++ b/tests/avocado/kvm_xen_guest.py
@@ -57,14 +57,10 @@ def common_vm_setup(self, readwrite=False):
"367962983d0d32109998a70b45dcee4672d0b045")
self.rootfs = self.get_asset("rootfs.ext4",
"f1478401ea4b3fa2ea196396be44315bab2bb5e4")
- if readwrite:
- dest = os.path.join(self.workdir, os.path.basename(self.rootfs))
- shutil.copy(self.rootfs, dest)
- self.rootfs = dest
def run_and_check(self, readwrite=False):
if readwrite:
- drive = f"file={self.rootfs},if=none,format=raw,id=drv0"
+ drive = f"file={self.rootfs},if=none,snapshot=on,format=raw,id=drv0"
else:
drive = f"file={self.rootfs},if=none,readonly=on,format=raw,id=drv0"
self.vm.add_args('-kernel', self.kernel_path,
--
2.39.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-14 14:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-14 14:42 [RFC PATCH] tests/avocado: avoid a copy to support read/write rootfs Alex Bennée
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).