qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v13 15/17] iotests: add simple incremental backu


From: John Snow
Subject: Re: [Qemu-devel] [PATCH v13 15/17] iotests: add simple incremental backup case
Date: Fri, 20 Feb 2015 11:05:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0



On 02/20/2015 05:02 AM, Stefan Hajnoczi wrote:
On Fri, Feb 13, 2015 at 05:08:56PM -0500, John Snow wrote:
+    def check_incremental(self, target=None):
+        if target is None:
+            target = self.bitmaps[-1].last_target()
+        self.assertTrue(iotests.compare_images(self.test_img, target))
+        return True
+
+
+    def hmp_io_writes(self, drive, patterns):
+        for pattern in patterns:
+            self.vm.hmp_qemu_io(drive, 'write -P%s %s %s' % pattern)
+        self.vm.hmp_qemu_io(drive, 'flush')

Please don't read image files while the guest is still running.  Image
formats do not support concurrent readers and writers.

Three options:
1. Stop the guest before accessing self.test_img
2. Use drive-backup to make a full copy of self.test_img that can be
    accessed.
3. Test specific patterns in the backup file instead of using
    compare_images (qemu-io -c 'read -P 0xff 0 512' img)


I'm not sure I understand the complication, here. There is no "running guest," so these HMP writes are emulating the guest writes. As Max says, we're using -qtest here.

If you really want, I can introduce emulated stop/resume commands just for the sake of demonstration (I had them in there before) but for iotests I don't see why it's strictly necessary.

--js



reply via email to

[Prev in Thread] Current Thread [Next in Thread]