From: Ian Molton <ian.molton@collabora.co.uk>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] virtio-rng
Date: Mon, 16 Nov 2009 12:28:52 +0000 [thread overview]
Message-ID: <4B014584.6000001@collabora.co.uk> (raw)
In-Reply-To: <4B011F38.9070500@redhat.com>
-----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-----
next prev parent reply other threads:[~2009-11-16 12:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-11 21:31 [Qemu-devel] virtio-rng Ian Molton
2009-11-11 22:57 ` Paul Brook
2009-11-16 9:45 ` Gerd Hoffmann
2009-11-16 12:28 ` Ian Molton [this message]
2009-11-16 13:10 ` Gerd Hoffmann
2009-11-16 17:58 ` Ian Molton
2009-11-16 22:51 ` Jamie Lokier
2009-11-16 23:16 ` Ian Molton
2009-11-16 23:35 ` Jamie Lokier
2009-11-17 9:18 ` Ian Molton
2009-11-17 9:24 ` Amit Shah
[not found] ` <4B02705A.5060400@collabora.co.uk>
[not found] ` <20091117095456.GA11125@amit-x200.redhat.com>
[not found] ` <4B0278B0.1080505@collabora.co.uk>
[not found] ` <20091117102837.GA11493@amit-x200.redhat.com>
2009-11-17 11:10 ` Ian Molton
2009-11-17 11:25 ` Amit Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B014584.6000001@collabora.co.uk \
--to=ian.molton@collabora.co.uk \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).