Hi,

in qdev_init_chardev() the return value is picked based upon the name of
the device. For now, I've added a third 'if clause' to match for my
driver and pass through the CharDriverState * fron vl.c for my rng
driver, however I'd like to solve this properly.

Ignore qdev_init_chardev() ...

I think a simple name->pointer type matching system would work fine,
however I'd like to know if anyone else has sorted this yet, or if I
should be doing things differently altogether.

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

HTH,
  Gerd



Reply via email to