Prior to this change, the disk resize operation would unconditionally
allocate disk space if the resize caused the disk to grow, and the disk
was marked as non-sparse.
With this change, the behavior is changed so that the `sparse=` option
specified at block device creation time is never modified; if a disk was
sparse before it was resized, it will remain sparse afterwards. The new
area of the disk image is only allocated if the disk was originally not
sparse.
The promotion to non-sparse when resizing was intended as a transition
mechanism for changing existing sparse disks into fully preallocated
resizable disks in Crostini, but this was never actually implemented.
This partially reverts commit 7673338200 ("devices: block: let resize
convert to non-sparse") [1].
[1]: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2070846
BUG=b:296117425
TEST=Resize Crostini disk image using slider in settings UI
Change-Id: Ibe55b851ef996d9b7ec903f0f2ee7cf5b3434217
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4309988
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on
simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security
boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesn’t
emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as
the virtio standard.
crosvm is currently used to run Linux/Android guests on ChromeOS devices.
For contribution, see the contributor guide. Mirror
repository is available at GitHub for your convenience, but
we don't accept bug reports or pull requests there.