From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NA0hw-0000Dh-KW for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:29:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NA0hv-0000CD-N3 for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:29:24 -0500 Received: from [199.232.76.173] (port=55667 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NA0hv-0000Bz-KA for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:29:23 -0500 Received: from bhuna.collabora.co.uk ([93.93.128.226]:36617) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NA0hu-0008Oa-R3 for qemu-devel@nongnu.org; Mon, 16 Nov 2009 07:29:23 -0500 Message-ID: <4B014584.6000001@collabora.co.uk> Date: Mon, 16 Nov 2009 12:28:52 +0000 From: Ian Molton MIME-Version: 1.0 Subject: Re: [Qemu-devel] virtio-rng References: <4AFB2D4D.8050208@collabora.co.uk> <4B011F38.9070500@redhat.com> In-Reply-To: <4B011F38.9070500@redhat.com> 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: Gerd Hoffmann Cc: qemu-devel@nongnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gerd Hoffmann wrote: > Hi, Hi! Thanks for your reply - I should have posted to say I'd partially solved this. I have a question though, > 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 I've done something similar (below) My commandline looks like: - -virtiorng dev=/dev/foo,rate=1234 I added some properties to my driver which are obviously then filled in from the options code, and I do my init like this: VirtIODevice *virtio_rng_init(DeviceState *dev, RNGConf *rngdev) { VirtIORng *s; s = (VirtIORng *)virtio_common_init("virtio-rng", VIRTIO_ID_RNG, 0, sizeof(VirtIORng)); if (!s) return NULL; s->vdev.get_features = virtio_rng_get_features; s->vq = virtio_add_queue(&s->vdev, 128, virtio_rng_handle); s->chr = qemu_chr_open("vrngdev", rngdev->device, NULL); ... return &s->vdev; } Is this 'not the right way' ? I think the commandline looks much simpler this way. OTOH, I can see that this might help with my next problem, which is that I want to write EGD support for virtio-rng, so I'm guessing my commandline would (in your scheme) need to be something like: -tcpsocketthing $addr.of.egd.server,id=some-name-here, more-egd-client-options -device virtio-rng,tcpsocketthing=some-name-here,rate=$limit I guess the idea here is to seperate the host related config from the guest OS setup ? This doesnt, however, get around my problem that the -device option doesnt know how to parse OPT_SIZE types, though. (I'd like to be able to specify 'rate' in B/s or KB/s (or even kbits/sec, more appropriately)) - -Ian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJLAUWCAAoJEFIjE1w7L6YHi7YP/1JXi1T1T3/GUG8o+ZTXJbV5 KUCkwZct7bAqMaZyxsbkbqo947tNjL006kupvUwRsfS/Hrp2uf9K/+o0tTGr87Kl ec7sWAU67q1ydhFQQYcAnUeBEe2qO9qIXC2d32QOPOTBftwmmCYMSRob+VG0jOvy eBN9ZdnUM+vGWmFfAxH8U1Wcx4sxEni+QZ36cFSCwAVfimxqkj9h2sI4yYVmIwWI 3VN6BERQgBGMp81fRY+QiVFGSXEPfLi/ppI8Ta6MOO3dB91XzsqDcMNIHIJwmxFz S2uSMl9py3P5jGb2hhHHO56Fvl8paBOEvVm1SsOMXID9MpnrSHJZmlnKAe+P0nY2 EX+pvvqJZwA2OS15fjzypmho0WZtvS/HdrvEp9SQcM6dgfyVapR6H/GLrqV1iEZ5 uarKBbFKuWVCl8rWc4dZm6sMDfIuzjUgeMZyEhUx3dHVpzzd1B0zIZOVFyI7Fde1 +ox+lvm4EXBV/hji4GCc3E1pJSlmQtokSSTuaVrAXrwJRJcZpX3cjsQad5S5OOrI zXYgs2H/ITINxnVjxkPTHty1txcZrs2Wvjbs8LvkE7LsZuquy+maVN2VS7ahwy3q qCAkfm8Yp1QVmPM1sAlhuMPCrtQKl4VAt825PbpjEd4DNHZb1hnK8s7dc3NpVKcv NK+vr3fUldUlsU+6Om0r =yNv7 -----END PGP SIGNATURE-----