ovirt-imageio icon indicating copy to clipboard operation
ovirt-imageio copied to clipboard

options: Report image format and virtual size

Open nirs opened this issue 2 years ago • 3 comments

Report image virtual size in OPTIONS so clients can get the image size without a possibly slow extent call.

Report the format since OPTIONS can report the virtual size only when the backend provides raw format. This is used when using the http backend to report OPTIONS to the client.

Reporting virtual size is easy with the nbd and memory backends since they always use raw format.

When using file backend and qcow2 image, we don't have access to the image virtual size, and this size is not helpful to the user uploading or downloading data. Currently we don't know about the image format since engine does not report it in the ticket.

The http backend reports the info from the remote server, so it depends on the backend used by the remote server, and on having new server reporting the format and size.

To keep code and the API simple, we report virtual size only when using the nbd and memory backends. When engine will report the image format for the file backend, we can also report the size for raw images access via the file backend.

This is work in progress, exploring the needed changes. I will post a cleaner version later.

nirs avatar Dec 12 '21 09:12 nirs