[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V6 5/5] blockdev: Add infinite loop check in drive_i
From: |
Xu Wang |
Subject: |
[Qemu-devel] [PATCH V6 5/5] blockdev: Add infinite loop check in drive_init() |
Date: |
Tue, 5 Nov 2013 22:09:21 -0500 |
Check the backing file for a loop during image boot, to avoid a lack or
response or segfault.
Signed-off-by: Xu Wang <address@hidden>
---
blockdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index b260477..7c0927f 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -510,6 +510,12 @@ 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 ? drv->format_name : NULL)) {
+ error_report("drive_init: backing file loop check failed");
+ goto err;
+ }
+
QINCREF(bs_opts);
ret = bdrv_open(dinfo->bdrv, file, bs_opts, bdrv_flags, drv, &error);
--
1.8.1.4
- Re: [Qemu-devel] [PATCH V6 1/5] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list(), (continued)
[Qemu-devel] [PATCH V6 2/5] qemu-img: Add infinite loop checking in bdrv_new_open(), Xu Wang, 2013/11/05
[Qemu-devel] [PATCH V6 3/5] block: Add check infinite loop in bdrv_img_create(), Xu Wang, 2013/11/05
[Qemu-devel] [PATCH V6 4/5] block: Add backing file loop check in change_backing_file(), Xu Wang, 2013/11/05
[Qemu-devel] [PATCH V6 5/5] blockdev: Add infinite loop check in drive_init(),
Xu Wang <=