]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
conf: Fix XML formatting of RNG device info
authorPeter Krempa <pkrempa@redhat.com>
Thu, 5 Dec 2013 17:33:01 +0000 (18:33 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 6 Dec 2013 10:03:56 +0000 (11:03 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=1035118

When outputting the XML for the RNG device, the code didn't format the
PCI address info. Additionally the schema wasn't expecting the info
although it was being parsed and used internally. Fix those mistakes and
add test for the PCI info section.

docs/schemas/domaincommon.rng
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.args
tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.xml

index 80848d2054a11fb245951844cebc09d0fa87ec66..38c680146d5d7b3abc6389693608cb4fa500f85c 100644 (file)
         <optional>
           <ref name="rng-rate"/>
         </optional>
+        <optional>
+          <ref name="alias"/>
+        </optional>
+        <optional>
+          <ref name="address"/>
+        </optional>
       </interleave>
     </element>
   </define>
index 65bd9b12e3cbabdaa9647a02f87c68deb1f997ff..0268847d8e3ae6f06e3ab432d8189ae48c727c65 100644 (file)
@@ -15832,6 +15832,11 @@ virDomainRNGDefFormat(virBufferPtr buf,
         break;
     }
 
+    if (virDomainDeviceInfoIsSet(&def->info, flags)) {
+        if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0)
+            return -1;
+    }
+
     virBufferAddLit(buf, "    </rng>\n");
 
     return 0;
index 01e9f8961106df8df7be0ce4765432243e749073..4ae6257f7f2f5f3f70a8299095716b5281ef81de 100644 (file)
@@ -4,4 +4,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
 -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 \
--device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x4
+-device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x7
index 0852deaa0e16c3a3f0ddea8d70425670cb211213..0a7bf6188fd4889f2ecbc626132e2a82e19e5bf8 100644 (file)
@@ -18,6 +18,7 @@
     <memballoon model='virtio'/>
     <rng model='virtio'>
       <backend model='random'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
     </rng>
   </devices>
 </domain>