mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemu: command: support for virtio packed option
Pass the packed option on the QEMU command line of the capability for packed virtqueues is detected and the parameter is set explicitly. Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
0e3b30944d
commit
5a2f2310a0
@ -614,6 +614,16 @@ qemuBuildVirtioOptionsStr(virBufferPtr buf,
|
|||||||
virBufferAsprintf(buf, ",ats=%s",
|
virBufferAsprintf(buf, ",ats=%s",
|
||||||
virTristateSwitchTypeToString(virtio->ats));
|
virTristateSwitchTypeToString(virtio->ats));
|
||||||
}
|
}
|
||||||
|
if (virtio->packed != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PACKED_QUEUES)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("the packed setting is not supported with this "
|
||||||
|
"QEMU binary"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
virBufferAsprintf(buf, ",packed=%s",
|
||||||
|
virTristateSwitchTypeToString(virtio->packed));
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -24,36 +24,38 @@ server,nowait \
|
|||||||
-rtc base=utc \
|
-rtc base=utc \
|
||||||
-no-shutdown \
|
-no-shutdown \
|
||||||
-no-acpi \
|
-no-acpi \
|
||||||
-device virtio-scsi-pci,iommu_platform=on,ats=on,id=scsi0,bus=pci.0,addr=0x8 \
|
-device virtio-scsi-pci,iommu_platform=on,ats=on,packed=on,id=scsi0,bus=pci.0,\
|
||||||
-device virtio-serial-pci,id=virtio-serial0,iommu_platform=on,ats=on,bus=pci.0,\
|
addr=0x8 \
|
||||||
addr=0x9 \
|
-device virtio-serial-pci,id=virtio-serial0,iommu_platform=on,ats=on,packed=on,\
|
||||||
|
bus=pci.0,addr=0x9 \
|
||||||
-usb \
|
-usb \
|
||||||
-drive file=/var/lib/libvirt/images/img1,format=raw,if=none,\
|
-drive file=/var/lib/libvirt/images/img1,format=raw,if=none,\
|
||||||
id=drive-virtio-disk0 \
|
id=drive-virtio-disk0 \
|
||||||
-device virtio-blk-pci,iommu_platform=on,ats=on,bus=pci.0,addr=0xa,\
|
-device virtio-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0xa,\
|
||||||
drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
|
||||||
-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
|
-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
|
||||||
-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,iommu_platform=on,\
|
-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,iommu_platform=on,\
|
||||||
ats=on,bus=pci.0,addr=0x3 \
|
ats=on,packed=on,bus=pci.0,addr=0x3 \
|
||||||
-fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,\
|
-fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,\
|
||||||
path=/export/fs2 \
|
path=/export/fs2 \
|
||||||
-device virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,iommu_platform=on,\
|
-device virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,iommu_platform=on,\
|
||||||
ats=on,bus=pci.0,addr=0x4 \
|
ats=on,packed=on,bus=pci.0,addr=0x4 \
|
||||||
-netdev user,id=hostnet0 \
|
-netdev user,id=hostnet0 \
|
||||||
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,\
|
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,\
|
||||||
addr=0x6,iommu_platform=on,ats=on \
|
addr=0x6,iommu_platform=on,ats=on,packed=on \
|
||||||
-device virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe,iommu_platform=on,ats=on \
|
-device virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe,iommu_platform=on,ats=on,\
|
||||||
|
packed=on \
|
||||||
-device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10,iommu_platform=on,\
|
-device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10,iommu_platform=on,\
|
||||||
ats=on \
|
ats=on,packed=on \
|
||||||
-device virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11,iommu_platform=on,\
|
-device virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11,iommu_platform=on,\
|
||||||
ats=on \
|
ats=on,packed=on \
|
||||||
-device virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,\
|
-device virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,\
|
||||||
addr=0x12,iommu_platform=on,ats=on \
|
addr=0x12,iommu_platform=on,ats=on,packed=on \
|
||||||
-chardev socket,id=chr-vu-video0,fd=1729 \
|
-chardev socket,id=chr-vu-video0,fd=1729 \
|
||||||
-device vhost-user-gpu-pci,id=video0,max_outputs=1,chardev=chr-vu-video0,\
|
-device vhost-user-gpu-pci,id=video0,max_outputs=1,chardev=chr-vu-video0,\
|
||||||
bus=pci.0,addr=0x2,iommu_platform=on,ats=on \
|
bus=pci.0,addr=0x2,iommu_platform=on,ats=on,packed=on \
|
||||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc,iommu_platform=on,\
|
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc,iommu_platform=on,\
|
||||||
ats=on \
|
ats=on,packed=on \
|
||||||
-object rng-random,id=objrng0,filename=/dev/random \
|
-object rng-random,id=objrng0,filename=/dev/random \
|
||||||
-device virtio-rng-pci,rng=objrng0,id=rng0,iommu_platform=on,ats=on,bus=pci.0,\
|
-device virtio-rng-pci,rng=objrng0,id=rng0,iommu_platform=on,ats=on,packed=on,\
|
||||||
addr=0xd
|
bus=pci.0,addr=0xd
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<devices>
|
<devices>
|
||||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||||
<disk type='file' device='disk'>
|
<disk type='file' device='disk'>
|
||||||
<driver name='qemu' type='raw' iommu='on' ats='on'/>
|
<driver name='qemu' type='raw' iommu='on' ats='on' packed='on'/>
|
||||||
<source file='/var/lib/libvirt/images/img1'/>
|
<source file='/var/lib/libvirt/images/img1'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
|
||||||
@ -27,22 +27,22 @@
|
|||||||
<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='scsi' index='0' model='virtio-scsi'>
|
<controller type='scsi' index='0' model='virtio-scsi'>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||||
</controller>
|
</controller>
|
||||||
<controller type='pci' index='0' model='pci-root'/>
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
<controller type='virtio-serial' index='0'>
|
<controller type='virtio-serial' index='0'>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
|
||||||
</controller>
|
</controller>
|
||||||
<filesystem type='mount' accessmode='passthrough'>
|
<filesystem type='mount' accessmode='passthrough'>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<source dir='/export/fs1'/>
|
<source dir='/export/fs1'/>
|
||||||
<target dir='fs1'/>
|
<target dir='fs1'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||||
</filesystem>
|
</filesystem>
|
||||||
<filesystem type='mount' accessmode='mapped'>
|
<filesystem type='mount' accessmode='mapped'>
|
||||||
<driver type='path' wrpolicy='immediate' iommu='on' ats='on'/>
|
<driver type='path' wrpolicy='immediate' iommu='on' ats='on' packed='on'/>
|
||||||
<source dir='/export/fs2'/>
|
<source dir='/export/fs2'/>
|
||||||
<target dir='fs2'/>
|
<target dir='fs2'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||||
@ -50,30 +50,30 @@
|
|||||||
<interface type='user'>
|
<interface type='user'>
|
||||||
<mac address='52:54:56:58:5a:5c'/>
|
<mac address='52:54:56:58:5a:5c'/>
|
||||||
<model type='virtio'/>
|
<model type='virtio'/>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
||||||
</interface>
|
</interface>
|
||||||
<input type='mouse' bus='virtio'>
|
<input type='mouse' bus='virtio'>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
|
||||||
</input>
|
</input>
|
||||||
<input type='keyboard' bus='virtio'>
|
<input type='keyboard' bus='virtio'>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
|
||||||
</input>
|
</input>
|
||||||
<input type='tablet' bus='virtio'>
|
<input type='tablet' bus='virtio'>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x11' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x11' function='0x0'/>
|
||||||
</input>
|
</input>
|
||||||
<input type='passthrough' bus='virtio'>
|
<input type='passthrough' bus='virtio'>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<source evdev='/dev/input/event1234'/>
|
<source evdev='/dev/input/event1234'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>
|
||||||
</input>
|
</input>
|
||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
<input type='keyboard' bus='ps2'/>
|
<input type='keyboard' bus='ps2'/>
|
||||||
<video>
|
<video>
|
||||||
<driver iommu='on' ats='on' name='vhostuser'/>
|
<driver iommu='on' ats='on' packed='on' name='vhostuser'/>
|
||||||
<model type='virtio' heads='1' primary='yes'>
|
<model type='virtio' heads='1' primary='yes'>
|
||||||
<acceleration accel3d='yes' rendernode='/dev/dri/test'/>
|
<acceleration accel3d='yes' rendernode='/dev/dri/test'/>
|
||||||
</model>
|
</model>
|
||||||
@ -81,11 +81,11 @@
|
|||||||
</video>
|
</video>
|
||||||
<memballoon model='virtio'>
|
<memballoon model='virtio'>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
</memballoon>
|
</memballoon>
|
||||||
<rng model='virtio'>
|
<rng model='virtio'>
|
||||||
<backend model='random'>/dev/random</backend>
|
<backend model='random'>/dev/random</backend>
|
||||||
<driver iommu='on' ats='on'/>
|
<driver iommu='on' ats='on' packed='on'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
|
||||||
</rng>
|
</rng>
|
||||||
</devices>
|
</devices>
|
||||||
|
@ -2989,7 +2989,8 @@ mymain(void)
|
|||||||
QEMU_CAPS_OBJECT_RNG_RANDOM,
|
QEMU_CAPS_OBJECT_RNG_RANDOM,
|
||||||
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
||||||
QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM,
|
QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM,
|
||||||
QEMU_CAPS_VIRTIO_PCI_ATS);
|
QEMU_CAPS_VIRTIO_PCI_ATS,
|
||||||
|
QEMU_CAPS_VIRTIO_PACKED_QUEUES);
|
||||||
|
|
||||||
DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE,
|
DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE,
|
||||||
QEMU_CAPS_KVM);
|
QEMU_CAPS_KVM);
|
||||||
|
@ -1291,7 +1291,8 @@ mymain(void)
|
|||||||
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
|
||||||
QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM,
|
QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM,
|
||||||
QEMU_CAPS_VIRTIO_PCI_ATS,
|
QEMU_CAPS_VIRTIO_PCI_ATS,
|
||||||
QEMU_CAPS_DEVICE_VHOST_USER_GPU);
|
QEMU_CAPS_DEVICE_VHOST_USER_GPU,
|
||||||
|
QEMU_CAPS_VIRTIO_PACKED_QUEUES);
|
||||||
|
|
||||||
DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE,
|
DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE,
|
||||||
QEMU_CAPS_KVM);
|
QEMU_CAPS_KVM);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user