[Spice-devel] [PATCH spice-gtk v4] main: Handle lack of free space for file transfer

Victor Toso victortoso at redhat.com
Wed May 31 21:21:30 UTC 2017


Hi,

On Wed, May 31, 2017 at 11:10:50PM +0200, Jakub Janků wrote:
> Agent can send FileXferStatusMessage with result
> VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE together with info about
> amount of available free space when the file to transfer is too large
> and the client announces support of this result by sending
> VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS

Yes, just pushed!

commit 371f1a64272fc6da0025c1e783f418bf8ee0b741
Author: Jakub Janků <janku.jakub.jj at gmail.com>
Date:   Wed May 10 22:35:20 2017 +0200

The related protocol patch is also in.

Thanks for your work :)
I've tested the other patches as well, I plan to comment on them soon.

Cheers,

> ---
>  src/channel-main.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/src/channel-main.c b/src/channel-main.c
> index bbc5905..af892ba 100644
> --- a/src/channel-main.c
> +++ b/src/channel-main.c
> @@ -1321,6 +1321,7 @@ static void agent_announce_caps(SpiceMainChannel *channel)
>      VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_CLIPBOARD_BY_DEMAND);
>      VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_CLIPBOARD_SELECTION);
>      VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_MONITORS_CONFIG_POSITION);
> +    VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS);
>  
>      agent_msg_queue(channel, VD_AGENT_ANNOUNCE_CAPABILITIES, size, caps);
>      g_free(caps);
> @@ -1870,6 +1871,17 @@ static void main_agent_handle_xfer_status(SpiceMainChannel *channel,
>          error = g_error_new_literal(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
>                                      _("The spice agent reported an error during the file transfer"));
>          break;
> +    case VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE: {
> +        uint64_t *free_space = (uint64_t *)(msg->data);
> +        gchar *free_space_str = g_format_size(*free_space);
> +        gchar *file_size_str = g_format_size(spice_file_transfer_task_get_total_bytes(xfer_task));
> +        error = g_error_new(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
> +                            _("File transfer failed due to lack of free space on remote machine "
> +                              "(%s free, %s to transfer)"), free_space_str, file_size_str);

> +        g_free(free_space_str);
> +        g_free(file_size_str);
> +        break;
> +    }
>      case VD_AGENT_FILE_XFER_STATUS_SUCCESS:
>          break;
>      default:
> -- 
> 2.9.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170531/6c40a00a/attachment.sig>


More information about the Spice-devel mailing list