[libvirt] [PATCH 0/4] Virtio-RNG followup

This series adds rate limiting and multiple device support and fixes docs and adds test for XML entities and multiple RNG devices. Peter Krempa (4): virtio-rng: allow multiple RNG devices docs: Fix attribute name for virtio-rng backend virtio-rng: Add rate limiting options for virtio-RNG tests: Test multiple RNG devices and support for XML entities in paths docs/formatdomain.html.in | 14 +++- docs/schemas/domaincommon.rng | 18 ++++- src/conf/domain_conf.c | 78 +++++++++++++--------- src/conf/domain_conf.h | 6 +- src/qemu/qemu_command.c | 28 +++++--- .../qemuxml2argv-virtio-rng-random.args | 2 +- .../qemuxml2argv-virtio-rng-random.xml | 4 ++ 7 files changed, 106 insertions(+), 44 deletions(-) -- 1.8.1.1

qemu supports adding multiple RNG devices. This patch allows libvirt to support this. --- src/conf/domain_conf.c | 61 +++++++++++++++++++++++++------------------------ src/conf/domain_conf.h | 4 +++- src/qemu/qemu_command.c | 19 +++++++-------- 3 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b65e52a..40eded6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1775,7 +1775,9 @@ void virDomainDefFree(virDomainDefPtr def) virDomainRedirdevDefFree(def->redirdevs[i]); VIR_FREE(def->redirdevs); - virDomainRNGDefFree(def->rng); + for (i = 0; i < def->nrngs; i++) + virDomainRNGDefFree(def->rngs[i]); + VIR_FREE(def->rngs); VIR_FREE(def->os.type); VIR_FREE(def->os.machine); @@ -2357,10 +2359,10 @@ int virDomainDeviceInfoIterate(virDomainDefPtr def, if (cb(def, &device, &def->memballoon->info, opaque) < 0) return -1; } - if (def->rng) { - device.type = VIR_DOMAIN_DEVICE_RNG; - device.data.rng = def->rng; - if (cb(def, &device, &def->rng->info, opaque) < 0) + device.type = VIR_DOMAIN_DEVICE_RNG; + for (i = 0; i < def->nrngs; i++) { + device.data.rng = def->rngs[i]; + if (cb(def, &device, &def->rngs[i]->info, opaque) < 0) return -1; } device.type = VIR_DOMAIN_DEVICE_HUB; @@ -10733,21 +10735,21 @@ virDomainDefParseXML(virCapsPtr caps, } } - /* Parse the RNG device */ + /* Parse the RNG devices */ if ((n = virXPathNodeSet("./devices/rng", ctxt, &nodes)) < 0) goto error; - - if (n > 1) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("only a single RNG device is supported")); - goto error; - } - - if (n > 0) { - if (!(def->rng = virDomainRNGDefParseXML(nodes[0], ctxt, flags))) + if (n && VIR_ALLOC_N(def->rngs, n) < 0) + goto no_memory; + for (i = 0; i < n; i++) { + virDomainRNGDefPtr rng = virDomainRNGDefParseXML(nodes[i], + ctxt, + flags); + if (!rng) goto error; - VIR_FREE(nodes); + + def->rngs[def->nrngs++] = rng; } + VIR_FREE(nodes); /* analysis of the hub devices */ if ((n = virXPathNodeSet("./devices/hub", ctxt, &nodes)) < 0) { @@ -11702,17 +11704,6 @@ static bool virDomainRNGDefCheckABIStability(virDomainRNGDefPtr src, virDomainRNGDefPtr dst) { - if (!src && !dst) - return true; - - if (!src || !dst) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target domain RNG device count '%d' " - "does not match source count '%d'"), - src ? 1 : 0, dst ? 1 : 0); - return false; - } - if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target RNG model '%s' does not match source '%s'"), @@ -12129,8 +12120,16 @@ virDomainDefCheckABIStability(virDomainDefPtr src, dst->memballoon)) return false; - if (!virDomainRNGDefCheckABIStability(src->rng, dst->rng)) + if (src->nrngs != dst->nrngs) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain RNG device count %zu " + "does not match source %zu"), dst->nrngs, src->nrngs); return false; + } + + for (i = 0 ; i < src->nrngs ; i++) + if (!virDomainRNGDefCheckABIStability(src->rngs[i], dst->rngs[i])) + return false; return true; } @@ -15054,8 +15053,10 @@ virDomainDefFormatInternal(virDomainDefPtr def, if (def->memballoon) virDomainMemballoonDefFormat(buf, def->memballoon, flags); - if (def->rng) - virDomainRNGDefFormat(buf, def->rng, flags); + for (n = 0; n < def->nrngs; n++) { + if (virDomainRNGDefFormat(buf, def->rngs[n], flags)) + goto error; + } virBufferAddLit(buf, " </devices>\n"); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 0828954..5dc3400 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1878,13 +1878,15 @@ struct _virDomainDef { size_t nseclabels; virSecurityLabelDefPtr *seclabels; + size_t nrngs; + virDomainRNGDefPtr *rngs; + /* Only 1 */ virDomainWatchdogDefPtr watchdog; virDomainMemballoonDefPtr memballoon; virCPUDefPtr cpu; virSysinfoDefPtr sysinfo; virDomainRedirFilterDefPtr redirfilter; - virDomainRNGDefPtr rng; void *namespaceData; virDomainXMLNamespace ns; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1c9bfc9..9270258 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -787,8 +787,8 @@ qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) if (virAsprintf(&def->memballoon->info.alias, "balloon%d", 0) < 0) goto no_memory; } - if (def->rng) { - if (virAsprintf(&def->rng->info.alias, "rng%d", 0) < 0) + for (i = 0; i < def->nrngs ; i++) { + if (virAsprintf(&def->rngs[i]->info.alias, "rng%d", i) < 0) goto no_memory; } @@ -1665,10 +1665,11 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, } /* VirtIO RNG */ - if (def->rng && - def->rng->model == VIR_DOMAIN_RNG_MODEL_VIRTIO && - def->rng->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { - if (qemuDomainPCIAddressSetNextAddr(addrs, &def->rng->info) < 0) + for (i = 0; i < def->nrngs; i++) { + if (def->rngs[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) + continue; + + if (qemuDomainPCIAddressSetNextAddr(addrs, &def->rngs[i]->info) < 0) goto error; } @@ -7110,13 +7111,13 @@ qemuBuildCommandLine(virConnectPtr conn, } } - if (def->rng) { + for (i = 0; i < def->nrngs; i++) { /* add the RNG source backend */ - if (qemuBuildRNGBackendArgs(cmd, def->rng, qemuCaps) < 0) + if (qemuBuildRNGBackendArgs(cmd, def->rngs[i], qemuCaps) < 0) goto error; /* add the device */ - if (qemuBuildRNGDeviceArgs(cmd, def->rng, qemuCaps) < 0) + if (qemuBuildRNGDeviceArgs(cmd, def->rngs[i], qemuCaps) < 0) goto error; } -- 1.8.1.1

On 02/25/13 23:31, Peter Krempa wrote:
qemu supports adding multiple RNG devices. This patch allows libvirt to support this.
This patch isn't relevant anymore. Qemu supports adding multiple RNG devices but it apparently shouldn't and the support will be limited in the next release. Peter

--- docs/formatdomain.html.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 12c9468..2a60f61 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4328,7 +4328,7 @@ qemu-kvm -net nic,model=? /dev/null <li>'egd' — a EGD protocol backend</li> </ul> </dd> - <dt><code>backend type='random'</code></dt> + <dt><code>backend model='random'</code></dt> <dd> <p> This backend type expects a non-blocking character device as input. @@ -4337,7 +4337,7 @@ qemu-kvm -net nic,model=? /dev/null When no file name is specified the hypervisor default is used. </p> </dd> - <dt><code>backend type='egd'</code></dt> + <dt><code>backend model='egd'</code></dt> <dd> <p> This backend connects to a source using the EGD protocol. -- 1.8.1.1

On 02/25/2013 03:31 PM, Peter Krempa wrote:
--- docs/formatdomain.html.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
ACK. You could push this one under the trivial rule.
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 12c9468..2a60f61 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4328,7 +4328,7 @@ qemu-kvm -net nic,model=? /dev/null <li>'egd' — a EGD protocol backend</li> </ul> </dd> - <dt><code>backend type='random'</code></dt> + <dt><code>backend model='random'</code></dt> <dd> <p> This backend type expects a non-blocking character device as input. @@ -4337,7 +4337,7 @@ qemu-kvm -net nic,model=? /dev/null When no file name is specified the hypervisor default is used. </p> </dd> - <dt><code>backend type='egd'</code></dt> + <dt><code>backend model='egd'</code></dt> <dd> <p> This backend connects to a source using the EGD protocol.
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Qemu's implementation of virtio RNG supports rate limiting of the entropy used. This patch exposes the option to tune this fucntionality. This patch is based on qemu commit 904d6f588063fb5ad2b61998acdf1e73fb4 The rate limiting is exported in the XML as: <devices> ... <rng model='virtio'> <rate period='1234'>4321</rate> <backend model='random'/> </rng> ... --- Notes: This series would benefit from the per-driver XML parsing checks to verify that rate > 8bits, otherwise it will be rounded down to 0 bytes. I will follow up with that change as soon as the per-driver callbacks get in. Version 3: - State the time unit in docs Version 2: - Qemu uses bytes/period, adapt the value according to that docs/formatdomain.html.in | 10 ++++++++++ docs/schemas/domaincommon.rng | 18 +++++++++++++++++- src/conf/domain_conf.c | 17 +++++++++++++++++ src/conf/domain_conf.h | 2 ++ src/qemu/qemu_command.c | 9 +++++++++ .../qemuxml2argv-virtio-rng-random.args | 2 +- .../qemuxml2argv-virtio-rng-random.xml | 1 + 7 files changed, 57 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 2a60f61..220884c 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4294,6 +4294,7 @@ qemu-kvm -net nic,model=? /dev/null ... <devices> <rng model='virtio'> + <rate period="2000">1234</rate> <backend model='random'>/dev/random</backend> <!-- OR --> <backend model='egd' type='udp'> @@ -4316,6 +4317,15 @@ qemu-kvm -net nic,model=? /dev/null <li>'virtio' — supported by qemu and virtio-rng kernel module</li> </ul> </dd> + <dt><code>rate</code></dt> + <dd> + <p> + The rate element allows to limit the rate that the entropy can be + read from the source. The value is in bits that the device is allowed + to read in the selected period. The period is represented in miliseconds. + The default period is 1000ms or 1 second. + </p> + </dd> <dt><code>backend</code></dt> <dd> <p> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8330a50..da53095 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3522,7 +3522,12 @@ <value>virtio</value> </choice> </attribute> - <ref name="rng-backend"/> + <interleave> + <ref name="rng-backend"/> + <optional> + <ref name="rng-rate"/> + </optional> + </interleave> </element> </define> @@ -3546,6 +3551,17 @@ </element> </define> + <define name="rng-rate"> + <element name="rate"> + <optional> + <attribute name="period"> + <ref name="positiveInteger"/> + </attribute> + </optional> + <ref name="positiveInteger"/> + </element> + </define> + <define name="usbmaster"> <element name="master"> <attribute name="startport"> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 40eded6..0e2f1a9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7506,6 +7506,17 @@ virDomainRNGDefParseXML(const xmlNodePtr node, ctxt->node = node; + if (virXPathUInt("string(./rate)", ctxt, &def->rate) < -1) { + virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid RNG rate value")); + goto error; + } + + if (def->rate > 0 && + virXPathUInt("string(./rate/@period)", ctxt, &def->period) < -1) { + virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid RNG period value")); + goto error; + } + if ((nbackends = virXPathNodeSet("./backend", ctxt, &backends)) < 0) goto error; @@ -13812,6 +13823,12 @@ virDomainRNGDefFormat(virBufferPtr buf, const char *backend = virDomainRNGBackendTypeToString(def->backend); virBufferAsprintf(buf, " <rng model='%s'>\n", model); + if (def->rate) { + virBufferAddLit(buf, " <rate"); + if (def->period) + virBufferAsprintf(buf, " period='%u'", def->period); + virBufferAsprintf(buf, ">%u</rate>\n", def->rate); + } virBufferAsprintf(buf, " <backend model='%s'", backend); switch ((enum virDomainRNGBackend) def->backend) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5dc3400..92130f0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1736,6 +1736,8 @@ enum virDomainRNGBackend { struct _virDomainRNGDef { int model; int backend; + unsigned int rate; + unsigned int period; union { char *file; /* file name for 'random' source */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9270258..4899ccf 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4256,6 +4256,15 @@ qemuBuildRNGDeviceArgs(virCommandPtr cmd, virBufferAsprintf(&buf, "virtio-rng-pci,rng=%s", dev->info.alias); + if (dev->rate > 0) { + /* qemu uses bytes */ + virBufferAsprintf(&buf, ",max-bytes=%u", dev->rate / 8); + if (dev->period) + virBufferAsprintf(&buf, ",period=%u", dev->period); + else + virBufferAddLit(&buf, ",period=1000"); + } + if (qemuBuildDeviceAddressStr(&buf, &dev->info, qemuCaps) < 0) goto cleanup; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args index 4611ae5..ced11db 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x4 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,max-bytes=100,period=1234,bus=pci.0,addr=0x4 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml index ab1f38c..26ddd38 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml @@ -17,6 +17,7 @@ <controller type='usb' index='0'/> <memballoon model='virtio'/> <rng model='virtio'> + <rate period='1234'>800</rate> <backend model='random'>/test/phile</backend> </rng> </devices> -- 1.8.1.1

On 02/25/2013 03:31 PM, Peter Krempa wrote:
Qemu's implementation of virtio RNG supports rate limiting of the entropy used. This patch exposes the option to tune this fucntionality.
s/fucntionality/functionality/
This patch is based on qemu commit 904d6f588063fb5ad2b61998acdf1e73fb4
The rate limiting is exported in the XML as: <devices> ... <rng model='virtio'> <rate period='1234'>4321</rate> <backend model='random'/> </rng> ... ---
Notes: This series would benefit from the per-driver XML parsing checks to verify that rate > 8bits, otherwise it will be rounded down to 0 bytes. I will follow up with that change as soon as the per-driver callbacks get in.
Version 3: - State the time unit in docs Version 2: - Qemu uses bytes/period, adapt the value according to that
docs/formatdomain.html.in | 10 ++++++++++ docs/schemas/domaincommon.rng | 18 +++++++++++++++++- src/conf/domain_conf.c | 17 +++++++++++++++++ src/conf/domain_conf.h | 2 ++ src/qemu/qemu_command.c | 9 +++++++++ .../qemuxml2argv-virtio-rng-random.args | 2 +- .../qemuxml2argv-virtio-rng-random.xml | 1 + 7 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 2a60f61..220884c 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4294,6 +4294,7 @@ qemu-kvm -net nic,model=? /dev/null ... <devices> <rng model='virtio'> + <rate period="2000">1234</rate> <backend model='random'>/dev/random</backend> <!-- OR --> <backend model='egd' type='udp'> @@ -4316,6 +4317,15 @@ qemu-kvm -net nic,model=? /dev/null <li>'virtio' — supported by qemu and virtio-rng kernel module</li> </ul> </dd> + <dt><code>rate</code></dt> + <dd> + <p> + The rate element allows to limit the rate that the entropy can be
grammar doesn't quite flow here; see below
+ read from the source. The value is in bits that the device is allowed + to read in the selected period. The period is represented in miliseconds.
s/miliseconds/milliseconds/
+ The default period is 1000ms or 1 second.
I'm still not sure we accurately covered things. Maybe: The optional <code>rate</code> element allows limiting the rate at which entropy can be consumed from the source. An optional <code>period</code> attribute specifies the duration of a period in milliseconds; if omitted, the period is taken as 1000 milliseconds (1 second). The element contents specify how many bits are permitted per period. Drivers may enforce a minimum rate, and may round the rate down to a minimum granularity.
+++ b/src/conf/domain_conf.h @@ -1736,6 +1736,8 @@ enum virDomainRNGBackend { struct _virDomainRNGDef { int model; int backend; + unsigned int rate; + unsigned int period;
Comments here would help: unsigned int rate; /* bits per period */ unsigned int period; /* milliseconds */
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x4 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,max-bytes=100,period=1234,bus=pci.0,addr=0x4
This is a long line; please split it with a backslash-newline to fit in 80 columns.
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml index ab1f38c..26ddd38 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml @@ -17,6 +17,7 @@ <controller type='usb' index='0'/> <memballoon model='virtio'/> <rng model='virtio'> + <rate period='1234'>800</rate> <backend model='random'>/test/phile</backend> </rng> </devices>
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Users may want to specify XML entities in paths to devices. Ensure they are parsed and used properly. Also test support for multiple RNG devices in one guest. --- tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args index ced11db..a99931a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,max-bytes=100,period=1234,bus=pci.0,addr=0x4 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,max-bytes=100,period=1234,bus=pci.0,addr=0x4 -object 'rng-random,id=rng1,filename=/test/strange<>phile' -device virtio-rng-pci,rng=rng1,bus=pci.0,addr=0x5 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml index 26ddd38..9950f5b 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml @@ -20,5 +20,8 @@ <rate period='1234'>800</rate> <backend model='random'>/test/phile</backend> </rng> + <rng model='virtio'> + <backend model='random'>/test/strange<>phile</backend> + </rng> </devices> </domain> -- 1.8.1.1

On 02/25/2013 03:31 PM, Peter Krempa wrote:
Users may want to specify XML entities in paths to devices. Ensure they are parsed and used properly. Also test support for multiple RNG devices in one guest.
Given your comments on 1/4 about qemu not intending to support multiple devices, you may need to rebase.
--- tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args index ced11db..a99931a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args @@ -1 +1 @@ -LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,max-bytes=100,period=1234,bus=pci.0,addr=0x4 +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -object rng-random,id=rng0,filename=/test/phile -device virtio-rng-pci,rng=rng0,max-bytes=100,period=1234,bus=pci.0,addr=0x4 -object 'rng-random,id=rng1,filename=/test/strange<>phile' -device virtio-rng-pci,rng=rng1,bus=pci.0,addr=0x5
Long line.
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml index 26ddd38..9950f5b 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml @@ -20,5 +20,8 @@ <rate period='1234'>800</rate> <backend model='random'>/test/phile</backend> </rng> + <rng model='virtio'> + <backend model='random'>/test/strange<>phile</backend> + </rng> </devices> </domain>
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Peter Krempa