On Wed, Sep 13, 2017 at 3:21 PM, Jason Dillaman <jdill...@redhat.com> wrote: > On Wed, 2017-09-13 at 10:44 -0600, Adam Wolfe Gordon wrote: >> + parent = bs->inherits_from; >> + if (parent == NULL) { >> + error_report("bs %s does not have parent", >> bdrv_get_device_or_node_name(bs)); >> + return; >> + } >> + >> + /* Force parents to re-read our size. */ > > Can you just invoke blk_truncate instead?
blk_truncate will end up calling qemu_rbd_truncate, which does an rbd_resize. The goal of this patch is to avoid calling rbd_resize from qemu, since we do resizes from an external orchestration service. That said, this patch also introduces a cache of the size (in BDRVRBDState.size_bytes), so it would be possible for qemu_rbd_truncate to avoid calling rbd_resize when the image is already the right size. If I did that, we could use blk_truncate when we detect a resize as well. Would that be a desirable change?