From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ny4vl-0004qt-ED for qemu-devel@nongnu.org; Sat, 03 Apr 2010 11:06:37 -0400 Received: from [140.186.70.92] (port=35020 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ny4vj-0004pU-Ve for qemu-devel@nongnu.org; Sat, 03 Apr 2010 11:06:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ny4vi-0008Do-E8 for qemu-devel@nongnu.org; Sat, 03 Apr 2010 11:06:35 -0400 Received: from mx20.gnu.org ([199.232.41.8]:56032) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ny4vi-0008Di-BS for qemu-devel@nongnu.org; Sat, 03 Apr 2010 11:06:34 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ny4vh-0006UH-TD for qemu-devel@nongnu.org; Sat, 03 Apr 2010 11:06:34 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 2/2] VirtIO RNG Date: Sat, 3 Apr 2010 16:06:26 +0100 References: <4BB2053C.6000701@collabora.co.uk> <201004011503.36690.paul@codesourcery.com> <4BB5C332.7080207@collabora.co.uk> In-Reply-To: <4BB5C332.7080207@collabora.co.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004031606.26893.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ian Molton , Gerd Hoffmann > Paul Brook wrote: > >>>> This patch adds support for virtio-rng. Data is read from a > >>>> chardev and can be either raw entropy or received via the EGD > >>>> protocol. > >>> > >>> I still don't get why you need this at all. It seems like > >>> virtio-serial would already provides everything you need. > >> > >> I guess when virtio-rng was first written, virtio-serial wasn't > >> flexible enough because it didn't support multiple devices > > > > That argument no longer holds. > > So now everything that looks like a stream of bytes has to use the > virtio-serial code... IMO, yes. That's the whole point of virtio-serial. You can handle it however you like in your in your favourite guest OS, but I object to qemu having multiple virtio devices that look and smell exactly like a serial port. >Why? Its not like it'll make the rng device any simpler, smaller, >faster, or reduce its dependencies. Virtio is simple enough to begin with! I disagree. Past experience shows that it's more than possible to completely screw up something as simple as a serial port. If everything that looks like a serial port provides their own implementation then the chances are they'll all be missing something, and broken in different ways. Take rate limiting as an example: Your implementation has at least one outright bug (using gettimeofday), and various questionable characteristics (is a 1-second token bucket appropriate). The EGD protocol bits are another example. You aren't exposing any of the interesting bits of this protocol to the guest, so it seems entirely reasonable to connect this to a serial port. That allows it to be used by guests that don't have a virtio-rng driver. Paul