[Spice-devel] File Transfer API
Victor Toso
lists at victortoso.com
Tue Sep 22 05:34:03 PDT 2015
Hey,
On Thu, Sep 17, 2015 at 10:21:59AM -0500, Jonathon Jongsma wrote:
> > This all sounds good to me, just one question, are you going to change
> > 'progress_callback' to report total progress, or is it going to stay as
> > it is now? (in other words, if an application only wants to display that
> > current file transfer operation is N% complete regardless of the files
> > being transferred, is there a way to do that?).
>
> Yeah, this is basically unrelated to the additional API that I proposed,
> so we can either choose to change this progress_callback or not,
> separately from the decision about whether to add the new API.
>
> I would support changing progress_callback to report total progress, but
> there's a slight hitch: internally all transfers are dumped into the
> same bin. So let's say that you issue two calls to
> spice_main_file_copy_async() sequentially:
>
> spice_main_file_copy_async(..., [files A and B], ..., prog_cb1, ...);
> - prog_cb1(bytes_readAB, [total size of A + B], ...);
> - prog_cb1(bytes_readAB, [total size of A + B], ...);
> (while those files are still being transferred)
> spice_main_file_copy_async(..., [files C and D], ..., prog_cb2, ...);
> - prog_cb1(bytes_readABCD, [total size of A + B + C + D], ...);
> - prog_cb1(bytes_readABCD, [total size of A + B + C + D], ...);
> - prog_cb2(bytes_readABCD, [total size of A + B + C + D], ...);
> - prog_cb2(bytes_readABCD, [total size of A + B + C + D], ...);
>
> You might expect that prog_cb1 would always report only the progress of
> files A+B, and prog_cb2 to only report the progress of files C+D. But
> unless we do some internal redesign, it would report all current
> transfers. I'm not sure that this is a problem, and unless somebody
> really wanted to change things, I'd probably keep the behavior above.
> But I thought I'd mention it since there is a decision to make.
>
> Jonathon
Yep, I don't think it is necessary to change the API and we should
deprecate it at some point in the future.
Great email and the screencast is promising!
So, replying to your original question:
> Objections? Alternate suggestions?
None!
cheers,
toso
More information about the Spice-devel
mailing list