[Spice-devel] [PATCH spice-html5 v2 1/2] main: Add messages for file transfer detailed errors

Jeremy White jwhite at codeweavers.com
Mon Sep 18 15:37:37 UTC 2017


Hi Tomáš,

You missed one of my comments on this patch; I pointed out that your
earlier version did not apply; I think that failure is more serious than
you realize.

I will not ack any patch that does not apply cleanly to the current
upstream/master.  If I do:
  git checkout -b test origin/master
  git-am < your patch
and it fails, I will reject it; I will not make any effort to 'massage'
it into working.

I do that for a variety of reasons, but one is that it makes me nervous
that you have not tested your patch against the actual code base; that
you are running it against a different code base, which may invalidate
your testing.  Since you know the code best, it's really helpful if you
can be very rigorous in testing.

Please formulate and test your patches against the current upstream master.

Cheers,

Jeremy

On 09/18/2017 04:14 AM, Tomáš Bohdálek wrote:
> ---
>  enums.js    | 12 ++++++++++--
>  main.js     | 16 ++++++++++++++--
>  spicemsg.js |  4 ++++
>  3 files changed, 28 insertions(+), 4 deletions(-)
> 
> diff --git a/enums.js b/enums.js
> index d5a9003..7154595 100644
> --- a/enums.js
> +++ b/enums.js
> @@ -369,12 +369,20 @@ var VD_AGENT_CAP_MOUSE_STATE            = 0,
>      VD_AGENT_CAP_GUEST_LINEEND_LF       = 8,
>      VD_AGENT_CAP_GUEST_LINEEND_CRLF     = 9,
>      VD_AGENT_CAP_MAX_CLIPBOARD          = 10,
> -    VD_AGENT_END_CAP                    = 11;
> +    VD_AGENT_CAP_AUDIO_VOLUME_SYNC      = 11,
> +    VD_AGENT_CAP_MONITORS_CONFIG_POSITION  = 12,
> +    VD_AGENT_CAP_FILE_XFER_DISABLED        = 13,
> +    VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS = 14,
> +    VD_AGENT_END_CAP                       = 15;
>  
>  var VD_AGENT_FILE_XFER_STATUS_CAN_SEND_DATA = 0,
>      VD_AGENT_FILE_XFER_STATUS_CANCELLED     = 1,
>      VD_AGENT_FILE_XFER_STATUS_ERROR         = 2,
> -    VD_AGENT_FILE_XFER_STATUS_SUCCESS       = 3;
> +    VD_AGENT_FILE_XFER_STATUS_SUCCESS       = 3,
> +    VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE    = 4,
> +    VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED      = 5,
> +    VD_AGENT_FILE_XFER_STATUS_AGENT_NOT_CONNECTED = 6,
> +    VD_AGENT_FILE_XFER_STATUS_DISABLED            = 7;
>  
>  var SPICE_STREAM_FLAGS_TOP_DOWN = (1 << 0);
>  
> diff --git a/main.js b/main.js
> index 173ff97..6a04da9 100644
> --- a/main.js
> +++ b/main.js
> @@ -344,7 +344,8 @@ SpiceMainConn.prototype.announce_agent_capabilities = function(request)
>  {
>      var caps = new VDAgentAnnounceCapabilities(request, (1 << VD_AGENT_CAP_MOUSE_STATE) |
>                                                          (1 << VD_AGENT_CAP_MONITORS_CONFIG) |
> -                                                        (1 << VD_AGENT_CAP_REPLY));
> +                                                        (1 << VD_AGENT_CAP_REPLY) |
> +                                                        (1 << VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS));
>      this.send_agent_message(VD_AGENT_ANNOUNCE_CAPABILITIES, caps);
>  }
>  
> @@ -385,13 +386,24 @@ SpiceMainConn.prototype.handle_file_xfer_status = function(file_xfer_status)
>          case VD_AGENT_FILE_XFER_STATUS_ERROR:
>              xfer_error = "some errors occurred in the spice agent";
>              break;
> -        case VD_AGENT_FILE_XFER_STATUS_SUCCESS:
> +        case VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE:
> +            xfer_error = "not enough space in the remote system";
> +            break;
> +        case VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED:
> +            xfer_error = "remote system is locked";
> +            break;
> +        case VD_AGENT_FILE_XFER_STATUS_AGENT_NOT_CONNECTED:
> +            xfer_error = "spice angent is not connected";
> +            break;
> +        case VD_AGENT_FILE_XFER_STATUS_DISABLED:
> +            xfer_error = "file transfer is disabled on the remote system";
>              break;
>          default:
>              xfer_error = "unhandled status type: " + file_xfer_status.result;
>              break;
>      }
>  
> +    xfer_error = "File transfer: " + xfer_error;
>      this.file_xfer_completed(xfer_task, xfer_error)
>  }
>  
> diff --git a/spicemsg.js b/spicemsg.js
> index 3619996..4220d31 100644
> --- a/spicemsg.js
> +++ b/spicemsg.js
> @@ -577,6 +577,10 @@ VDAgentFileXferStatusMessage.prototype =
>          var dv = new SpiceDataView(a);
>          this.id = dv.getUint32(at, true); at += 4;
>          this.result = dv.getUint32(at, true); at += 4;
> +        if (this.result == VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE)
> +        {
> +            this.data = dv.getUint64(at, true); at += 8;
> +        }
>          return at;
>      },
>      buffer_size: function()
> 



More information about the Spice-devel mailing list