]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix shrinking volumes with the delta flag
authorJán Tomko <jtomko@redhat.com>
Wed, 27 May 2015 14:33:22 +0000 (16:33 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 28 May 2015 12:10:32 +0000 (14:10 +0200)
commit8b316fe5da8e459349b1a3ee0037bc7988d6f8aa
tree52add58a0eae9c0544d1d6a871c57aab74636d3e
parent7211f66ad71066dc1bf9c428c70d8ba87ab791e9
Fix shrinking volumes with the delta flag

This never worked.

In 0.9.10 when this API was introduced, it was intended that
the SHRINK flag combined with DELTA would shrink the volume by
the specified capacity (to avoid passing negative numbers).
See commit 055bbf4.

When the SHRINK flag was finally implemented for the first backend
in 1.2.13 (commit aa9aa6a), it was only implemented for the absolute
values and with the delta flag the volume is always extended,
regardless of the SHRINK flag.

Treat the SHRINK flag as a minus sign when used together with DELTA,
to allow shrinking volumes as was documented in the API since 0.9.10.

https://bugzilla.redhat.com/show_bug.cgi?id=1220213
src/storage/storage_driver.c