qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] virtio-rng


From: Ian Molton
Subject: Re: [Qemu-devel] virtio-rng
Date: Mon, 16 Nov 2009 12:28:52 +0000
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

-----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-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]