[RFC PATCH] tests/avocado: avoid a copy to support read/write rootfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux