From: Jeff Cody <jcody@redhat.com>
To: Xu Wang <gesaint@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, stefanha@gmail.com, famz@redhat.com,
qemu-devel@nongnu.org, wdongxu@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH V9 4/4] blockdev: Add infinite loop check in drive_init()
Date: Thu, 19 Dec 2013 12:25:59 -0500 [thread overview]
Message-ID: <20131219172559.GF4699@localhost.localdomain> (raw)
In-Reply-To: <1385447913-19004-5-git-send-email-gesaint@linux.vnet.ibm.com>
On Tue, Nov 26, 2013 at 01:38:33AM -0500, Xu Wang wrote:
> Check the backing file for a loop during image boot, to avoid a lack or
> response or segfault.
>
> Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com>
> ---
> blockdev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/blockdev.c b/blockdev.c
> index 330aa4a..e39fc27 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -511,6 +511,13 @@ static DriveInfo *blockdev_init(QDict *bs_opts,
>
> bdrv_flags |= ro ? 0 : BDRV_O_RDWR;
>
> + /* Add backing file loop check */
> + if (!bdrv_backing_chain_okay(file, drv, NULL, &error)) {
> + error_setg(errp, "drive_init: backing file loop check failed. %s",
> + error_get_pretty(error));
Leaks error.
> + goto err;
> + }
> +
> QINCREF(bs_opts);
> ret = bdrv_open(dinfo->bdrv, file, bs_opts, bdrv_flags, drv, &error);
>
> --
> 1.8.1.4
>
>
prev parent reply other threads:[~2013-12-19 21:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 6:38 [Qemu-devel] [PATCH V9 0/4] Refine and export backing file loop check Xu Wang
2013-11-26 6:38 ` [Qemu-devel] [PATCH V9 1/4] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list() Xu Wang
2013-12-19 15:23 ` Jeff Cody
2013-12-19 16:18 ` Jeff Cody
2013-11-26 6:38 ` [Qemu-devel] [PATCH V9 2/4] block: Add check infinite loop in bdrv_img_create() Xu Wang
2013-12-19 16:27 ` Jeff Cody
2013-11-26 6:38 ` [Qemu-devel] [PATCH V9 3/4] block: Add backing file loop check in change_backing_file() Xu Wang
2013-12-19 16:13 ` Jeff Cody
2013-11-26 6:38 ` [Qemu-devel] [PATCH V9 4/4] blockdev: Add infinite loop check in drive_init() Xu Wang
2013-12-19 17:25 ` Jeff Cody [this message]
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=20131219172559.GF4699@localhost.localdomain \
--to=jcody@redhat.com \
--cc=famz@redhat.com \
--cc=gesaint@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).