[Spice-devel] [PATCH win-vdagent] Don't exit when receiving unknown messages

Frediano Ziglio fziglio at redhat.com
Thu Feb 28 08:31:20 UTC 2019


> 
> In 8251fa25, a check on the minimum size of a message was introduced.
> For unsupported messages, the vdagent simply exited. This makes it
> difficult to extend the vdagent protocol without breaking old

The protocol is using capabilities, there should not be
unsupported messages.

> installations. Instead, just print a warning indicating that an
> unsupported message was received and ignore it.
> 

If you want to print a warning it means that it's not correct,
this is another indication that it's wrong.

> Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> ---
>  vdagent/vdagent.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
> index 89019bb..177e663 100644
> --- a/vdagent/vdagent.cpp
> +++ b/vdagent/vdagent.cpp
> @@ -1288,8 +1288,7 @@ void VDAgent::dispatch_message(VDAgentMessage* msg,
> uint32_t port)
>          break;
>      }
>      if (min_size < 0) {
> -        vd_printf("Unsupported message type %u size %u", msg->type,
> msg->size);
> -        _running = false;
> +        vd_printf("Unsupported message type %u size %u, ignoring",
> msg->type, msg->size);
>          return;
>      }
>      if (msg->size < (unsigned) min_size) {

RHEL 8 has 8251fa25 patch, should the users be forced to update
the guests?
If we want to change the protocol to allow unsupported message we
should first change the protocol specification, this is not a
fix, it's a workaround for a wrong/incomplete implementation on
the server side.
I prefer a proper fix than a workaround and this is not
fixing already installed guests.

Frediano


More information about the Spice-devel mailing list