From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0s3n-000771-SK for qemu-devel@nongnu.org; Mon, 23 Nov 2015 09:25:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0s3j-0005Lt-Py for qemu-devel@nongnu.org; Mon, 23 Nov 2015 09:25:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0s3j-0005LY-Jx for qemu-devel@nongnu.org; Mon, 23 Nov 2015 09:25:35 -0500 References: <871tbktuzy.fsf@blackfin.pond.sub.org> From: Paolo Bonzini Message-ID: <565321D9.7080604@redhat.com> Date: Mon, 23 Nov 2015 15:25:29 +0100 MIME-Version: 1.0 In-Reply-To: <871tbktuzy.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Is ivshmem's test for unix domain client socket valid? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, Claudio Fontana , Luiz Capitulino On 20/11/2015 18:56, Markus Armbruster wrote: > Looks rather fishy: >=20 > if (strncmp(s->server_chr->filename, "unix:", 5)) { > error_setg(errp, "chardev is not a unix client socket"); > return; > } >=20 > Paolo, is this reliable? Yes, though by total chance (which is already a curious definition of reliability). If you create "-chardev file,path=3Dunix: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