On 20/11/2015 18:56, Markus Armbruster wrote:
> Looks rather fishy:
>
> if (strncmp(s->server_chr->filename, "unix:", 5)) {
> error_setg(errp, "chardev is not a unix client socket");
> return;
> }
>
> Paolo, is this reliable?
Yes, though by total chance (which is already a curious definition of
reliability). If you create "-chardev file,path=unix:foo",
chr->filename ends up with "file" because only pty and socket chardevs
set chr->filename. Everything else does not set it, and the field is
thus set to the default---the backend name.
> Is it the proper way to check?
It's the only one, which makes it the most proper too. Sarcasm is
intentional.
Paolo