From: Eric Blake <eblake@redhat.com>
To: Dongxu Wang <wdongxu@linux.vnet.ibm.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [RFC] Check backing_file chain's loop
Date: Thu, 30 May 2013 06:12:00 -0600 [thread overview]
Message-ID: <51A74210.3000302@redhat.com> (raw)
In-Reply-To: <51A72673.7090300@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]
On 05/30/2013 04:14 AM, Dongxu Wang wrote:
> Hi,
>
> Now block layer does not check whether backing_file chain can be a
> circle, do you think it is necessary to do a check?
>
> For example, 1.qcow2's backing_file is 2.qcow2 and 2.qcow2's
> backing_file is 1.qcow2, then any IO operation will be a fault.
>
> If necessary, I will post a patch to fix.
Yes, it's worth patching.
>
> [$] qemu-img create -f qcow2 1.qcow2
> qemu-img: Image creation needs a size parameter
> [$] qemu-img create -f qcow2 1.qcow2 8M
> Formatting '1.qcow2', fmt=qcow2 size=8388608 encryption=off
> cluster_size=65536 lazy_refcounts=off
> [$] qemu-img create -f qcow2 2.qcow2 -o backing_file=1.qcow2
> Formatting '2.qcow2', fmt=qcow2 size=8388608 backing_file='1.qcow2'
> encryption=off cluster_size=65536 lazy_refcounts=off
> [$] qemu-img create -f qcow2 1.qcow2 -o backing_file=2.qcow2
> Formatting '1.qcow2', fmt=qcow2 size=8388608 backing_file='2.qcow2'
> encryption=off cluster_size=65536 lazy_refcounts=off
> [$] qemu-io -c "read -v 0 512" 1.qcow2
> ^CSegmentation fault (core dumped)
Also make sure that 'qemu-img info 1.qcow2' and 'qemu-img info
--backing-chain 1.qcow2' don't crash.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-05-30 12:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 10:14 [Qemu-devel] [RFC] Check backing_file chain's loop Dongxu Wang
2013-05-30 12:12 ` Eric Blake [this message]
2013-05-30 12:48 ` Stefan Hajnoczi
2013-05-31 2:17 ` Dongxu Wang
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=51A74210.3000302@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wdongxu@linux.vnet.ibm.com \
/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).