[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Is ivshmem's test for unix domain client socket valid?
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Is ivshmem's test for unix domain client socket valid? |
Date: |
Mon, 23 Nov 2015 15:25:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
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