]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd: add --estimated-size option for import from stdin 61535/head
authorKirill Nazarov <KiNazarov@croc.ru>
Sun, 26 Jan 2025 19:08:24 +0000 (22:08 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 27 Jun 2025 16:01:01 +0000 (18:01 +0200)
commitb4fbabd6fca55f081226f8f768e6fbe0037d215c
tree0178a086afee9fa774c000f5869f5d57112e077c
parent82aafe416ea96c482396ffab3a5765831f9d645d
rbd: add --estimated-size option for import from stdin

One issue with importing from stdin is that it's not easy to track
progress. The only feasible option is to process messages on the highest
log level looking for lines like

librbd::io::ImageRequestWQ: 0x56342ecc7a50 aio_write: ... off=1187840, len=864256 ...

but when it comes to large images it takes a lot of effort.
This commit introduces --estimated-size option, that makes it possible
to print out progress in percents via the standard mechanism. Obviously,
it requires the knowledge of the amount of provided data in advance and
in case of an error nonsensical percents might be printed, but I don't
think it's that big of a deal.

Also use `estimated size` as the base image size, making resizing not
necessary in cases where we know the exact amount of data provided from
stdin.

Co-authored-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Kirill Nazarov <KiNazarov@croc.ru>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
doc/man/8/rbd.rst
src/test/cli/rbd/help.t
src/tools/rbd/ArgumentTypes.cc
src/tools/rbd/ArgumentTypes.h
src/tools/rbd/action/Import.cc