From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9y9U-0000Bm-08 for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:45:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9y9O-0000Ad-HB for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:45:38 -0500 Received: from [199.232.76.173] (port=44462 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9y9O-0000Aa-AL for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:45:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16389) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9y9N-0005Vh-S1 for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:45:34 -0500 Message-ID: <4B011F38.9070500@redhat.com> Date: Mon, 16 Nov 2009 10:45:28 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] virtio-rng References: <4AFB2D4D.8050208@collabora.co.uk> In-Reply-To: <4AFB2D4D.8050208@collabora.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ian Molton Cc: qemu-devel@nongnu.org Hi, > in qdev_init_chardev() the return value is picked based upon the name of > the device. For now, I've added a third 'if clause' to match for my > driver and pass through the CharDriverState * fron vl.c for my rng > driver, however I'd like to solve this properly. Ignore qdev_init_chardev() ... > I think a simple name->pointer type matching system would work fine, > however I'd like to know if anyone else has sorted this yet, or if I > should be doing things differently altogether. Use a chardev property (look at serial.c, "isa-serial" device). Then you'll configure it on the qemu command line like this: -chardev $backend,id=some-name-here,more-chardev-parameters -device virtio-rng,chardev=some-name-here HTH, Gerd