Received: from eggs.gnu.org ([2001:4830:134:3::10]:49964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaIEL-0001bC-QG for qemu-devel@nongnu.org; Mon, 29 Feb 2016 02:26:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaIEH-0003Nc-NB for qemu-devel@nongnu.org; Mon, 29 Feb 2016 02:26:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaIEH-0003NY-Ih for qemu-devel@nongnu.org; Mon, 29 Feb 2016 02:26:53 -0500 From: Markus Armbruster Date: Mon, 29 Feb 2016 08:26:50 +0100 Message-ID: <87r3fw564l.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] An ivshmem + chardev peculiarity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Cam Macdonell , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Claudio Fontana , David Marchand The ivshmem client/server protocol is one-way: only the server sends. The only way clients can communicate is by connect and close. Since the ivshmem device model uses a chardev for its connection to the server, both connect and close happen in chardev code. Example: monitor command chardev-add connects, the server starts sending. chardev-add succeeds. device_add fails somehow. Now you must chardev-remove to close the connection. >From the server's point of view, a peer connected and disconnected. It duly announces this to already connected peers. This is a bit weird, but it shouldn't cause problems. If you forget to chardev-remove, the "peer" stays connected. Can be declared PEBKAC. Connect on realize and close on realize failure and unrealize would be neater, I think. Chardevs don't let me do that, as far as I can tell. Ideas? There's one exception to the behavior I just described: on version mismatch, the device model calls qemu_chr_delete(). I consider that a bug, and I'm going to fix it.