crosvm/disk/src
Jiyong Park bc144baf0e Handle qcow image backed by a composite disk
This CL fixes a bug that was introduced by [1] where max_nesting_depth
is used to prevent unbounded nesting of qcow images.

When a qcow image is backed by a composite disk, the composite disk is
parsed twice: (1) once before the qcow header is created, and (2) once
again after the composite disk is written to the header and the header
is parsed. The max_nesting_depth was set correctly for (1), but was set
to 1 for (2). Since a composite disk inherently is nested,
max_nesting_depth drops to 0 and it causes an error.

This CL fixes the bug by respecting max_nesting_depth also for the case
(2).

Bug: N/A
Test: launch cuttlefish

[1] https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3146214

Change-Id: Ic2d30df6c76a0c1965e222960e0094fe847b1097
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3267734
Auto-Submit: Jiyong Park <jiyong@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andrew Walbran <qwandor@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2021-11-11 11:08:48 +00:00
..
qcow Handle qcow image backed by a composite disk 2021-11-11 11:08:48 +00:00
android_sparse.rs disk: convert to ThisError and sort 2021-09-02 21:00:21 +00:00
composite.rs disk: limit maximum nesting depth 2021-09-17 02:55:04 +00:00
disk.rs Reland "Dump backing File system type." 2021-10-11 23:10:07 +00:00
gpt.rs Add methods to create composite disk image. 2021-07-07 15:59:02 +00:00