
On 02/19/13 14:20, John Ferlan wrote:
On 02/13/2013 05:59 AM, Peter Krempa wrote:
This patch implements support for the virtio-rng-pci device and the rng-random backend in qemu.
Two capabilities bits are added to track support for those:
QEMU_CAPS_DEVICE_VIRTIO_RNG - for the device support and QEMU_CAPS_OBJECT_RNG_RANDOM - for the backend support.
qemu is invoked with these additional parameters if the device is enabled:
-object rng-random,id=rng0,filename=/test/phile (to add the backend) -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x4 (to add the device) --- src/qemu/qemu_capabilities.c | 5 ++- src/qemu/qemu_capabilities.h | 3 ++ src/qemu/qemu_command.c | 100 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 1 deletion(-)
[...]
+ + +static int +qemuBuildRNGDeviceArgs(virCommandPtr cmd, + virDomainRNGDefPtr dev, + virQEMUCapsPtr qemuCaps) +{ + virBuffer buf = VIR_BUFFER_INITIALIZER; + int ret = -1; + + if (dev->model != VIR_DOMAIN_RNG_MODEL_VIRTIO || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_RNG)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("RNG device type '%s' is not supported " + "by this of qemu"), s/of //
another thought - keep your messages similar - like above:
"this qemu doesn't support RNG device type '%s'"
Right, I'll do them in a consistent way.
Peter