From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alZ1W-00065V-Bv for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:36:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alZ1T-0000XN-5g for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:36:18 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alZ1S-0000XD-UW for qemu-devel@nongnu.org; Thu, 31 Mar 2016 05:36:15 -0400 Received: by mail-wm0-x235.google.com with SMTP id 20so105738198wmh.1 for ; Thu, 31 Mar 2016 02:36:14 -0700 (PDT) Date: Thu, 31 Mar 2016 10:36:12 +0100 From: Stefan Hajnoczi Message-ID: <20160331093612.GI32185@stefanha-x1.localdomain> References: <56F251B6.1030707@proxmox.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k9xkV0rc9XGsukaG" Content-Disposition: inline In-Reply-To: <56F251B6.1030707@proxmox.com> Subject: Re: [Qemu-devel] qemu-img convert corruption (raw to raw) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dominik Csapak Cc: qemu devel --k9xkV0rc9XGsukaG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 23, 2016 at 09:20:06AM +0100, Dominik Csapak wrote: > I have a strange issue with qemu-img convert which corrupts my images, and > found nothing relevant online. > Maybe someone here can help me. Please post your QEMU command-line (ps aux | grep qemu while the guest is running). Please also post your host distro and kernel version (uname -r). > My problem: >=20 > I have a Windows 10 VM with a hd image file of type RAW with cache mode > writeback. > I boot it up, write a bunch of data (a few gigabytes with crystal disk ma= rk) > and shutdown. > As soon as the qemu/kvm process is gone i do a > "qemu-img convert -p -f raw -O raw vmdisk.raw vmdisk2.raw" Have you tried replacing qemu-img convert with cp? > When it finishes i do a compare: > "cmp vmdisk.raw vmidsk2.raw" > The output is: > "vmdisk.raw vmdisk2.raw differ: byte yyyyy, line zzzzz" > this it tells me that the files are different. > this manifests by the fact that sometimes in windows on the new disk i get > filesystem errors or damaged files. > (depending on where the writes were) >=20 > now the strange part: > it does not happen with linux guests > it does not happen when i do a "echo 3 > /proc/sys/vm/drop_caches" before > the qemu-img command > it does not happen when i have the "-t none" or "-t writethrough" flags on > my qemu-img command > it DOES happen when i do a sync before the qemu-img command > the "-T" parameter makes no difference > it does also not happen when i cp the file > also when i wait a few minutes before the qemu-img command it works > correctly >=20 > now the real questions: > is writeback with windows not recommended (i would assume after a guest > shutdown it would be safe) > what do the -t and -T flags on qemu-img convert and why does it bypass the > host page cache (apparently?) > why does it work when i specify no caching on the target > (this baffles me, since it would seem that the source cache is the culpri= t, > not the target) >=20 > i apologize for the long message > and hope someone can explain this to me >=20 > with kind regards > Dominik Csapak >=20 >=20 --k9xkV0rc9XGsukaG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJW/O+MAAoJEJykq7OBq3PIFigIALLnynYmXy0KUhCbb10iR9e7 lnzVR/bXLxtbhcO57yggJ+jiG0S30R4suzmT6HGi/A16tPRWmyRhmAAkifOqnTlH 9Ip+Upover8somcLDvHWOPHB6F9E9sMudjWxc3m/owCrZBvCxJM50uCtUkzCyMN6 lwIrqFIP0q3zLX2LKUrIBWo9Bx58ZSQWPAb4umX47+Qk+mQiM5SXroUhxgpxFkML Nam5Bn3Gz0I9NLUYg1AQwInRO0ZNoYTDIdcEQeTLtZMSwirY9A+WkI9+/6WWcQSy gfSwJGpSf4bpmRbCkRBfzRlrAN7jn7hoQjpHT6MXdbXpJfGyYJ27sNSdMi5OrQk= =NFVF -----END PGP SIGNATURE----- --k9xkV0rc9XGsukaG--