qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 17/26] qapi: add conditions to SPICE type/comman


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 17/26] qapi: add conditions to SPICE type/commands/events on the schema
Date: Thu, 17 Aug 2017 10:43:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Markus Armbruster <address@hidden> writes:

[...]
> Check for completeness by reviewing the case insensitive occurrences of
> SPICE in the schema not covered by your patch:
>
> * add_client
>
>   Same rationale as for VNC (see my review of PATCH 16).  Good.

Hmm, there's a difference to VNC, in qmp_add_client():

    if (strcmp(protocol, "spice") == 0) {
        if (!qemu_using_spice(errp)) {
            close(fd);
            return;
        }
        skipauth = has_skipauth ? skipauth : false;
        tls = has_tls ? tls : false;
        if (qemu_spice_display_add_client(fd, skipauth, tls) < 0) {
            error_setg(errp, "spice failed to add client");
            close(fd);
        }
        return;
#ifdef CONFIG_VNC
    } else if (strcmp(protocol, "vnc") == 0) {
        skipauth = has_skipauth ? skipauth : false;
        vnc_display_add_client(NULL, fd, skipauth);
        return;
#endif
    } else if ((s = qemu_chr_find(protocol)) != NULL) {
        if (qemu_chr_add_client(s, fd) < 0) {
            error_setg(errp, "failed to add client");
            close(fd);
            return;
        }
        return;
    }

    error_setg(errp, "protocol '%s' is invalid", protocol);
    close(fd);

Observe:

* Protocol "spice" is always recognized.  Without CONFIG_SPICE,
  using_spice is always false, and the command fails with
  qemu_using_spice()'s error "SPICE is not in use".

* Protocol "vnc" is only recognized with CONFIG_VNC.  Without, it's
  rejected with "protocol 'vnc' is invalid".

* If you name your character device "spice" or "vnc", you can't use it
  with add_client.  This is a design flaw.

  Except you can use one named "vnc" when !CONFIG_VNC.

  I'm afraid the command needs to be replaced.  Not in this series, of
  course.

[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]