mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
qemu: Support interface model=virtio-{non-}transitional
Add new <interface> model handling for virtio transitional devices. Ex: <interface> <model type='virtio-transitional'/> </interface> * "virtio-transitional" maps to qemu "virtio-net-pci-transitional" * "virtio-non-transitional" maps to qemu "virtio-net-pci-non-transitional" Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
239b535d99
commit
4d964373b5
@ -5764,7 +5764,11 @@ qemu-kvm -net nic,model=? /dev/null
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Typical values for QEMU and KVM include:
|
Typical values for QEMU and KVM include:
|
||||||
ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio
|
ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio.
|
||||||
|
<span class="since">Since 5.2.0</span>, <code>virtio-transitional</code>
|
||||||
|
and <code>virtio-non-transitional</code> values are supported.
|
||||||
|
See <a href="#elementsVirtioTransitional">Virtio transitional devices</a>
|
||||||
|
for more details.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h5><a id="elementsDriverBackendOptions">Setting NIC driver-specific options</a></h5>
|
<h5><a id="elementsDriverBackendOptions">Setting NIC driver-specific options</a></h5>
|
||||||
|
@ -29418,7 +29418,9 @@ virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface)
|
|||||||
bool
|
bool
|
||||||
virDomainNetIsVirtioModel(const virDomainNetDef *net)
|
virDomainNetIsVirtioModel(const virDomainNetDef *net)
|
||||||
{
|
{
|
||||||
return STREQ_NULLABLE(net->model, "virtio");
|
return (STREQ_NULLABLE(net->model, "virtio") ||
|
||||||
|
STREQ_NULLABLE(net->model, "virtio-transitional") ||
|
||||||
|
STREQ_NULLABLE(net->model, "virtio-non-transitional"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -479,6 +479,12 @@ qemuBuildVirtioDevStr(virBufferPtr buf,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_NET:
|
case VIR_DOMAIN_DEVICE_NET:
|
||||||
|
has_tmodel = STREQ_NULLABLE(device.data.net->model,
|
||||||
|
"virtio-transitional");
|
||||||
|
has_ntmodel = STREQ_NULLABLE(device.data.net->model,
|
||||||
|
"virtio-non-transitional");
|
||||||
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_LEASE:
|
case VIR_DOMAIN_DEVICE_LEASE:
|
||||||
case VIR_DOMAIN_DEVICE_FS:
|
case VIR_DOMAIN_DEVICE_FS:
|
||||||
case VIR_DOMAIN_DEVICE_INPUT:
|
case VIR_DOMAIN_DEVICE_INPUT:
|
||||||
|
@ -692,8 +692,13 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STREQ_NULLABLE(net->model, "virtio"))
|
if (STREQ_NULLABLE(net->model, "virtio") ||
|
||||||
return virtioFlags;
|
STREQ_NULLABLE(net->model, "virtio-non-transitional"))
|
||||||
|
return virtioFlags;
|
||||||
|
|
||||||
|
/* Transitional devices only work in conventional PCI slots */
|
||||||
|
if (STREQ_NULLABLE(net->model, "virtio-transitional"))
|
||||||
|
return pciFlags;
|
||||||
|
|
||||||
if (STREQ_NULLABLE(net->model, "e1000e"))
|
if (STREQ_NULLABLE(net->model, "e1000e"))
|
||||||
return pcieFlags;
|
return pcieFlags;
|
||||||
|
@ -26,9 +26,13 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
|||||||
-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
|
-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
|
||||||
addr=0x1 \
|
addr=0x1 \
|
||||||
-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.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 \
|
||||||
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
|
-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.1,\
|
-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 \
|
addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
||||||
|
-netdev user,id=hostnet0 \
|
||||||
|
-device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=hostnet0,\
|
||||||
|
id=net0,mac=00:11:22:33:44:55,bus=pci.1,addr=0x0 \
|
||||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
||||||
resourcecontrol=deny \
|
resourcecontrol=deny \
|
||||||
-msg timestamp=on
|
-msg timestamp=on
|
||||||
|
@ -26,9 +26,13 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
|||||||
-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
|
-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
|
||||||
addr=0x1 \
|
addr=0x1 \
|
||||||
-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.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 \
|
||||||
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
|
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
|
||||||
-device virtio-blk-pci-non-transitional,scsi=off,bus=pci.1,addr=0x0,\
|
-device virtio-blk-pci-non-transitional,scsi=off,bus=pci.2,addr=0x0,\
|
||||||
drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
||||||
|
-netdev user,id=hostnet0 \
|
||||||
|
-device virtio-net-pci-non-transitional,netdev=hostnet0,id=net0,\
|
||||||
|
mac=00:11:22:33:44:55,bus=pci.1,addr=0x0 \
|
||||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
||||||
resourcecontrol=deny \
|
resourcecontrol=deny \
|
||||||
-msg timestamp=on
|
-msg timestamp=on
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
</disk>
|
</disk>
|
||||||
|
<interface type='user'>
|
||||||
|
<mac address='00:11:22:33:44:55'/>
|
||||||
|
<model type='virtio-non-transitional'/>
|
||||||
|
</interface>
|
||||||
<controller type='usb' model='none'/>
|
<controller type='usb' model='none'/>
|
||||||
<memballoon model='none'/>
|
<memballoon model='none'/>
|
||||||
</devices>
|
</devices>
|
||||||
|
@ -29,7 +29,10 @@ addr=0x1 \
|
|||||||
-device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 \
|
-device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 \
|
||||||
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
|
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
|
||||||
-device virtio-blk-pci,disable-legacy=off,disable-modern=off,scsi=off,\
|
-device virtio-blk-pci,disable-legacy=off,disable-modern=off,scsi=off,\
|
||||||
bus=pci.2,addr=0x1,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
bus=pci.2,addr=0x2,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
||||||
|
-netdev user,id=hostnet0 \
|
||||||
|
-device virtio-net-pci,disable-legacy=off,disable-modern=off,netdev=hostnet0,\
|
||||||
|
id=net0,mac=00:11:22:33:44:55,bus=pci.2,addr=0x1 \
|
||||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
||||||
resourcecontrol=deny \
|
resourcecontrol=deny \
|
||||||
-msg timestamp=on
|
-msg timestamp=on
|
||||||
|
@ -28,8 +28,11 @@ addr=0x1 \
|
|||||||
-device pcie-pci-bridge,id=pci.2,bus=pci.1,addr=0x0 \
|
-device pcie-pci-bridge,id=pci.2,bus=pci.1,addr=0x0 \
|
||||||
-device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 \
|
-device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 \
|
||||||
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
|
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
|
||||||
-device virtio-blk-pci-transitional,scsi=off,bus=pci.2,addr=0x1,\
|
-device virtio-blk-pci-transitional,scsi=off,bus=pci.2,addr=0x2,\
|
||||||
drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
||||||
|
-netdev user,id=hostnet0 \
|
||||||
|
-device virtio-net-pci-transitional,netdev=hostnet0,id=net0,\
|
||||||
|
mac=00:11:22:33:44:55,bus=pci.2,addr=0x1 \
|
||||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
|
||||||
resourcecontrol=deny \
|
resourcecontrol=deny \
|
||||||
-msg timestamp=on
|
-msg timestamp=on
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
</disk>
|
</disk>
|
||||||
|
<interface type='user'>
|
||||||
|
<mac address='00:11:22:33:44:55'/>
|
||||||
|
<model type='virtio-transitional'/>
|
||||||
|
</interface>
|
||||||
<controller type='usb' model='none'/>
|
<controller type='usb' model='none'/>
|
||||||
<memballoon model='none'/>
|
<memballoon model='none'/>
|
||||||
</devices>
|
</devices>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<driver name='qemu' type='raw'/>
|
<driver name='qemu' type='raw'/>
|
||||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
|
||||||
</disk>
|
</disk>
|
||||||
<controller type='usb' index='0' model='none'/>
|
<controller type='usb' index='0' model='none'/>
|
||||||
<controller type='sata' index='0'>
|
<controller type='sata' index='0'>
|
||||||
@ -35,6 +35,16 @@
|
|||||||
<target chassis='2' port='0x9'/>
|
<target chassis='2' port='0x9'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
<controller type='pci' index='3' model='pcie-root-port'>
|
||||||
|
<model name='pcie-root-port'/>
|
||||||
|
<target chassis='3' port='0xa'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||||
|
</controller>
|
||||||
|
<interface type='user'>
|
||||||
|
<mac address='00:11:22:33:44:55'/>
|
||||||
|
<model type='virtio-non-transitional'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
||||||
|
</interface>
|
||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
<input type='keyboard' bus='ps2'/>
|
<input type='keyboard' bus='ps2'/>
|
||||||
<memballoon model='none'/>
|
<memballoon model='none'/>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<driver name='qemu' type='raw'/>
|
<driver name='qemu' type='raw'/>
|
||||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
|
||||||
</disk>
|
</disk>
|
||||||
<controller type='usb' index='0' model='none'/>
|
<controller type='usb' index='0' model='none'/>
|
||||||
<controller type='sata' index='0'>
|
<controller type='sata' index='0'>
|
||||||
@ -39,6 +39,11 @@
|
|||||||
<target chassis='3' port='0x9'/>
|
<target chassis='3' port='0x9'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||||
</controller>
|
</controller>
|
||||||
|
<interface type='user'>
|
||||||
|
<mac address='00:11:22:33:44:55'/>
|
||||||
|
<model type='virtio-transitional'/>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
|
||||||
|
</interface>
|
||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
<input type='keyboard' bus='ps2'/>
|
<input type='keyboard' bus='ps2'/>
|
||||||
<memballoon model='none'/>
|
<memballoon model='none'/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user