Feature #1413
closed
Added by Damien Churchill over 12 years ago.
Updated over 12 years ago.
Description
It would be handy if there was an asynchronous version of the librbd copy method. Or at least some means of getting some progress reporting using the API.
- Target version set to v0.35
- Translation missing: en.field_position set to 30
What would such an API look like? Copy is implemented using read_iterate... we could add a user-supplied callback that reports the byte offset.
Whatever it is, we should do the same for import, export, and any other long-running operation.
- Assignee set to Colin McCabe
I would say the callback route would be best.
Something along the lines of:
callback(int totalChunks, int chunks, int chunkSize, void* userData)
would be good.
For being more in line with the read_iterate() that'll call it, I suggest:
for C:
int callback(uint64_t total_len, uint64_t ofs, const char *chunk_data, uint64_t chunk_len, void *user_data);
for C++:
class RbdCopyContext {
public:
int callback(uint64_t total_len, uint64_t ofs, bufferlist& bl) = 0;
};
Thanks, Yehuda. I suppose it does make sense to provide a C++-style API with a virtual base class, just to be consistent with the rest of the interface. As Sage said, we should also make this slightly more generic and call it something like ProgressContext / callback so that it can be used with some other rbd operations.
- Status changed from New to Resolved
Also available in: Atom
PDF