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>