[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V3 7/7] block: Add backing file loop check in qed_ch
From: |
Xu Wang |
Subject: |
[Qemu-devel] [PATCH V3 7/7] block: Add backing file loop check in qed_change_backing_file() |
Date: |
Mon, 15 Jul 2013 05:42:36 -0400 |
Add backing file loop check before execute change backing file for
qed format.
Signed-off-by: Xu Wang <address@hidden>
---
block/qed.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/block/qed.c b/block/qed.c
index f767b05..79c2875 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -1468,6 +1468,13 @@ static int bdrv_qed_change_backing_file(BlockDriverState
*bs,
return -ENOTSUP;
}
+ /* Check if loop exists in backing files chain after changed */
+ if (bdrv_backing_file_loop_check(bs->filename,
+ bs->drv ? bs->drv->format_name : NULL,
+ backing_file, backing_fmt)) {
+ return -EIO;
+ }
+
memcpy(&new_header, &s->header, sizeof(new_header));
new_header.features &= ~(QED_F_BACKING_FILE |
--
1.8.1.4
- [Qemu-devel] [PATCH V3 1/7] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list(), (continued)
- [Qemu-devel] [PATCH V3 1/7] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list(), Xu Wang, 2013/07/15
- [Qemu-devel] [PATCH V3 2/7] block: Add WIN32 platform support for backing_file_loop_check(), Xu Wang, 2013/07/15
- [Qemu-devel] [PATCH V3 3/7] block: Check infinite loop in bdrv_img_create(), Xu Wang, 2013/07/15
- [Qemu-devel] [PATCH V3 4/7] block: Add backing file loop check in change_backing_file(), Xu Wang, 2013/07/15
- [Qemu-devel] [PATCH V3 5/7] block: Add infinite loop check in drive_init(), Xu Wang, 2013/07/15
- [Qemu-devel] [PATCH V3 6/7] block: Add backing file loop check in qcow2_change_backing_file(), Xu Wang, 2013/07/15
- [Qemu-devel] [PATCH V3 7/7] block: Add backing file loop check in qed_change_backing_file(),
Xu Wang <=
- Re: [Qemu-devel] [PATCH V3 0/7] Redefine and export backing file loop check, Fam Zheng, 2013/07/18