From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nc54v-0006zr-SI for qemu-devel@nongnu.org; Mon, 01 Feb 2010 17:49:09 -0500 Received: from [199.232.76.173] (port=34944 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nc54v-0006zI-3h for qemu-devel@nongnu.org; Mon, 01 Feb 2010 17:49:09 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nc54t-0005ue-4d for qemu-devel@nongnu.org; Mon, 01 Feb 2010 17:49:08 -0500 Received: from bhuna.collabora.co.uk ([93.93.128.226]:49599) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nc54r-0005tR-Hl for qemu-devel@nongnu.org; Mon, 01 Feb 2010 17:49:05 -0500 Message-ID: <4B675A2C.7030207@collabora.co.uk> Date: Mon, 01 Feb 2010 22:48:12 +0000 From: Ian Molton MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver References: <1265031265-14717-1-git-send-email-ian.molton@collabora.co.uk> <1265031265-14717-2-git-send-email-ian.molton@collabora.co.uk> <1265031265-14717-3-git-send-email-ian.molton@collabora.co.uk> <1265031265-14717-4-git-send-email-ian.molton@collabora.co.uk> <1265031265-14717-5-git-send-email-ian.molton@collabora.co.uk> <4B66F3C9.6090103@codemonkey.ws> In-Reply-To: <4B66F3C9.6090103@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Gerd Hoffmann Anthony Liguori wrote: >> + DEFINE_RNG_PROPERTIES(VirtIOPCIProxy, rng), >> > > I don't see any reason to use a define here. Consistency with the other virtio code (at the time I wrote it) > Coding style is off here (newline between ) and { ). Fixed. > Can't call gettimeofday directly. You have to use qemu_gettimeofday(). > But it would be better to not rely on gettimeofday and instead make use > of the rt_clock. Hm, this I fixed before, I'll make sure its right in the next patch. Must have got an old revision mixed up there. >> +static void virtio_rng_save(QEMUFile *f, void *opaque) >> +{ >> + VirtIORng *s = opaque; >> + >> + virtio_save(&s->vdev, f); >> +} >> + >> +static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id) >> +{ >> + VirtIORng *s = opaque; >> + >> + if (version_id != 1) >> + return -EINVAL; >> + >> + virtio_load(&s->vdev, f); >> + return 0; >> +} >> >> > > This doesn't look correct to me. There is absolutely no state > maintained by the virtio-rng backend? I find that hard to believe. What state needs maintaining? when it runs out of entropy, it simply reconnects. Unless I misunderstood what those functions are for... -Ian