qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ilkka Tengvall <ilkka.tengvall@cybercom.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu-img: error while compressing, Input/output error
Date: Fri, 12 Apr 2013 14:55:45 +0300	[thread overview]
Message-ID: <5167F641.8090004@cybercom.com> (raw)

I run into an issue where qemu-img convert fails repeatedly on 
compressing a raw disk image. It's not all broken, since it many times 
also works. When it fails, it fails always to the same sector.

I run into problem using f18 qemu-img-1.2.2-6.fc18.x86_64, and repeated 
it with the latest qemu-img from qemu git as of 12th of April 2013:
last git log: 93b48c201eb6c0404d15550a0eaa3c0f7937e35e

I discussed the problem on IRC on qemu channel with stefanha, and he 
asked me to provide the info here. Thanks for you help stefanha!

Here is some background snipplets:

"
<ikke> anyone having idea why "qemu-img convert -c -O qcow2 -f raw 
file1 file1.qcow2" would fail to:
<ikke> qemu-img: error while compressing sector 1842944: Input/output error
<stefanha> ikke: My guess is that 
qcow2_alloc_compressed_cluster_offset() is failing
<stefanha> Compressed writes cannot overwrite existing sectors,
<stefanha> perhaps there's a bug in qemu-img convert that causes it to 
touch the same sector twice.
<stefanha> We wouldn't notice it when compression is disabled.
<stefanha> But when it's enabled you get a failure.
<pm215> stefanha: by the way, is it right that qemu-img.c:1372 
calculates cluster_sectors from cluster_size by rounding down rather 
than up? I know nothing about this code but that looks a little suspicious
<stefanha> And the contents of the input image affect the I/O pattern 
during conversion
<stefanha> which would explain why you always get the problem with 
certain images.
<stefanha> pm215: That should be okay.  cluster_size is a power of 2 and 
multiple of 512.
<stefanha> For qcow2 the default cluster_size is 64 KB.
<stefanha> ikke: A post to the mailing list with a link to the file and 
a description of how to trigger the failure would be fine.
<stefanha> I think it won't take long to fix.
"

The image for repeating this is available here (~230MB):

http://hard.ware.fi/~ikke/stuff/ubuntufs.raw.img.gzip

and the command to reproduce the error is here:

$ qemu-img convert -c -O qcow2 -f raw root.fs.copy root.fs.small.new
qemu-img: error while compressing sector 1842944: Input/output error



BR,

Ilkka Tengvall
ilkka.tengvall@cybercom.com

             reply	other threads:[~2013-04-12 11:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 11:55 Ilkka Tengvall [this message]
2013-04-15  6:00 ` [Qemu-devel] qemu-img: error while compressing, Input/output error Fam Zheng
2013-04-15  6:52 ` Stefan Hajnoczi
2013-04-15 11:00   ` Ilkka Tengvall
2013-04-15 11:14     ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5167F641.8090004@cybercom.com \
    --to=ilkka.tengvall@cybercom.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).