@@ -7971,6 +7971,8 @@ qemu-kvm -net nic,model=? /dev/null
</p>
<ul>
<li>'virtio' - supported by qemu and virtio-rng kernel module</li>
+ <li>'virtio-transitional' <span class='since'>Since 5.1.0</span></li>
+ <li>'virtio-non-transitional' <span class='since'>Since 5.1.0</span></li>
</ul>
</dd>
<dt><code>rate</code></dt>
@@ -5452,7 +5452,11 @@
<define name="rng">
<element name="rng">
<attribute name="model">
- <value>virtio</value>
+ <choice>
+ <value>virtio</value>
+ <value>virtio-transitional</value>
+ <value>virtio-non-transitional</value>
+ </choice>
</attribute>
<interleave>
<ref name="rng-backend"/>
@@ -859,7 +859,10 @@ VIR_ENUM_IMPL(virDomainDiskTray, VIR_DOMAIN_DISK_TRAY_LAST,
VIR_ENUM_IMPL(virDomainRNGModel,
VIR_DOMAIN_RNG_MODEL_LAST,
- "virtio");
+ "virtio",
+ "virtio-transitional",
+ "virtio-non-transitional",
+);
VIR_ENUM_IMPL(virDomainRNGBackend,
VIR_DOMAIN_RNG_BACKEND_LAST,
@@ -2127,6 +2127,8 @@ struct _virBlkioDevice {
typedef enum {
VIR_DOMAIN_RNG_MODEL_VIRTIO,
+ VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL,
+ VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL,
VIR_DOMAIN_RNG_MODEL_LAST
} virDomainRNGModel;
@@ -488,6 +488,13 @@ qemuBuildVirtioDevStr(virBufferPtr buf,
ntmodel_cap = QEMU_CAPS_DEVICE_VHOST_SCSI_PCI_NON_TRANSITIONAL;
break;
+ case VIR_DOMAIN_DEVICE_RNG:
+ has_tmodel = device.data.rng->model == VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL;
+ has_ntmodel = device.data.rng->model == VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL;
+ tmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_TRANSITIONAL;
+ ntmodel_cap = QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_NON_TRANSITIONAL;
+ break;
+
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_FS:
case VIR_DOMAIN_DEVICE_INPUT:
@@ -506,7 +513,6 @@ qemuBuildVirtioDevStr(virBufferPtr buf,
case VIR_DOMAIN_DEVICE_SHMEM:
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
- case VIR_DOMAIN_DEVICE_RNG:
case VIR_DOMAIN_DEVICE_MEMORY:
case VIR_DOMAIN_DEVICE_IOMMU:
case VIR_DOMAIN_DEVICE_VSOCK:
@@ -4550,6 +4550,14 @@ qemuDomainRNGDefValidate(const virDomainRNGDef *def,
model_supported = virQEMUCapsGet(qemuCaps,
QEMU_CAPS_DEVICE_VIRTIO_RNG);
break;
+ case VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL:
+ model_supported = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_TRANSITIONAL) ||
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY));
+ break;
+ case VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL:
+ model_supported = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_RNG_PCI_NON_TRANSITIONAL) ||
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY));
+ break;
case VIR_DOMAIN_RNG_MODEL_LAST:
break;
}
@@ -862,7 +862,11 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
case VIR_DOMAIN_DEVICE_RNG:
switch ((virDomainRNGModel) dev->data.rng->model) {
case VIR_DOMAIN_RNG_MODEL_VIRTIO:
+ case VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL:
return virtioFlags;
+ case VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL:
+ /* Transitional devices only work in conventional PCI slots */
+ return pciFlags;
case VIR_DOMAIN_RNG_MODEL_LAST:
return 0;
@@ -28,6 +28,7 @@ addr=0x1 \
-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
-device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \
-device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \
+-device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
-device virtio-blk-pci,disable-legacy=on,disable-modern=off,scsi=off,bus=pci.2,\
addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
@@ -36,6 +37,9 @@ addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
id=net0,mac=00:11:22:33:44:55,bus=pci.1,addr=0x0 \
-device vhost-scsi-pci,disable-legacy=on,disable-modern=off,\
wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,bus=pci.3,addr=0x0 \
+-object rng-random,id=objrng0,filename=/dev/urandom \
+-device virtio-rng-pci,disable-legacy=on,disable-modern=off,rng=objrng0,\
+id=rng0,bus=pci.4,addr=0x0 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
@@ -28,6 +28,7 @@ addr=0x1 \
-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
-device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \
-device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \
+-device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
-device virtio-blk-pci-non-transitional,scsi=off,bus=pci.2,addr=0x0,\
drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
@@ -36,6 +37,8 @@ drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
mac=00:11:22:33:44:55,bus=pci.1,addr=0x0 \
-device vhost-scsi-pci-non-transitional,wwpn=naa.5123456789abcde0,vhostfd=3,\
id=hostdev0,bus=pci.3,addr=0x0 \
+-object rng-random,id=objrng0,filename=/dev/urandom \
+-device virtio-rng-pci-non-transitional,rng=objrng0,id=rng0,bus=pci.4,addr=0x0 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
@@ -19,6 +19,9 @@
<hostdev mode='subsystem' type='scsi_host' managed='no' model='virtio-non-transitional'>
<source protocol='vhost' wwpn='naa.5123456789abcde0'/>
</hostdev>
+ <rng model='virtio-non-transitional'>
+ <backend model='random'>/dev/urandom</backend>
+ </rng>
<controller type='usb' index='0' model='none'/>
<memballoon model='none'/>
</devices>
@@ -35,6 +35,8 @@ id=virtio-disk0,bootindex=1 \
addr=0x1 \
-device vhost-scsi-pci,wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,\
bus=pci.2,addr=0x3 \
+-object rng-random,id=objrng0,filename=/dev/urandom \
+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.2,addr=0x4 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
@@ -35,6 +35,8 @@ drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
mac=00:11:22:33:44:55,bus=pci.2,addr=0x1 \
-device vhost-scsi-pci-transitional,wwpn=naa.5123456789abcde0,vhostfd=3,\
id=hostdev0,bus=pci.2,addr=0x3 \
+-object rng-random,id=objrng0,filename=/dev/urandom \
+-device virtio-rng-pci-transitional,rng=objrng0,id=rng0,bus=pci.2,addr=0x4 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on
@@ -19,6 +19,9 @@
<hostdev mode='subsystem' type='scsi_host' managed='no' model='virtio-transitional'>
<source protocol='vhost' wwpn='naa.5123456789abcde0'/>
</hostdev>
+ <rng model='virtio-transitional'>
+ <backend model='random'>/dev/urandom</backend>
+ </rng>
<controller type='usb' index='0' model='none'/>
<memballoon model='none'/>
</devices>
@@ -45,6 +45,11 @@
<target chassis='4' port='0xb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
</controller>
+ <controller type='pci' index='5' model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='5' port='0xc'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/>
+ </controller>
<interface type='user'>
<mac address='00:11:22:33:44:55'/>
<model type='virtio-non-transitional'/>
@@ -57,5 +62,9 @@
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</hostdev>
<memballoon model='none'/>
+ <rng model='virtio-non-transitional'>
+ <backend model='random'>/dev/urandom</backend>
+ <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+ </rng>
</devices>
</domain>
@@ -51,5 +51,9 @@
<address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
</hostdev>
<memballoon model='none'/>
+ <rng model='virtio-transitional'>
+ <backend model='random'>/dev/urandom</backend>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
+ </rng>
</devices>
</domain>
Add new <rng> model values for virtio transitional devices. Ex: <rng model='virtio-transitional'> ... </rng> * "virtio-transitional" maps to qemu "virtio-rng-pci-transitional" * "virtio-non-transitional" maps to qemu "virtio-rng-pci-non-transitional" Signed-off-by: Cole Robinson <crobinso@redhat.com> --- docs/formatdomain.html.in | 2 ++ docs/schemas/domaincommon.rng | 6 +++++- src/conf/domain_conf.c | 5 ++++- src/conf/domain_conf.h | 2 ++ src/qemu/qemu_command.c | 8 +++++++- src/qemu/qemu_domain.c | 8 ++++++++ src/qemu/qemu_domain_address.c | 4 ++++ .../virtio-non-transitional.x86_64-3.1.0.args | 4 ++++ .../virtio-non-transitional.x86_64-latest.args | 3 +++ tests/qemuxml2argvdata/virtio-non-transitional.xml | 3 +++ .../virtio-transitional.x86_64-3.1.0.args | 2 ++ .../virtio-transitional.x86_64-latest.args | 2 ++ tests/qemuxml2argvdata/virtio-transitional.xml | 3 +++ tests/qemuxml2xmloutdata/virtio-non-transitional.xml | 9 +++++++++ tests/qemuxml2xmloutdata/virtio-transitional.xml | 4 ++++ 15 files changed, 62 insertions(+), 3 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list