From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBO4s-0001Op-4w for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:33:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBO4o-0000QG-W1 for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:33:42 -0500 Received: from mail-bn1bbn0108.outbound.protection.outlook.com ([157.56.111.108]:47737 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBO4o-0000QB-Rg for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:33:38 -0500 Message-ID: <54B65A8B.3000801@freescale.com> Date: Wed, 14 Jan 2015 14:01:15 +0200 From: Vasile Catalin-B50542 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [virtio] virtqueue allocation and thread-safety List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, I'm trying to make a new virtio device. I got it running (I made a functional dummy device & guest driver). Now I'm trying to build some communication between the device and guest=20 driver. I can't seem to find where the actual allocation of virtqueues are made. I've looked inside virtio_init(), but it just allocates the vq=20 structures and I don't see any pointers inside that structure that might give and idea of something=20 dynamically allocated. There is a member of that structure named "vector", but it's=20 type is uint16_t. I've also looked inside the virtio_add_queue(), and it just makes some=20 constant assignments. Where are the vqs buffer space actually allocated? One more thing. Are the virtqueue functions thread safe, from both point=20 of views (qemu and guest driver API's view)? Also I don't see any dynamic allocations/freeing when pushing and=20 popping, either. C=C4=83t=C4=83