mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: Auto assign pci addresses for shared memory devices
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1165029 Signed-off-by: Luyao Huang <lhuang@redhat.com>
This commit is contained in:
parent
7d73ca06ce
commit
e309ea6658
@ -2562,6 +2562,7 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
|
||||
flags) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Further non-primary video cards which have to be qxl type */
|
||||
for (i = 1; i < def->nvideos; i++) {
|
||||
if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
|
||||
@ -2575,6 +2576,16 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
|
||||
flags) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Shared Memory */
|
||||
for (i = 0; i < def->nshmems; i++) {
|
||||
if (def->shmems[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
|
||||
continue;
|
||||
|
||||
if (virDomainPCIAddressReserveNextSlot(addrs,
|
||||
&def->shmems[i]->info, flags) < 0)
|
||||
goto error;
|
||||
}
|
||||
for (i = 0; i < def->ninputs; i++) {
|
||||
/* Nada - none are PCI based (yet) */
|
||||
}
|
||||
|
@ -1,16 +1,19 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
/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 ivshmem,shm=shmem0 \
|
||||
-device ivshmem,size=128m,shm=shmem1 \
|
||||
-device ivshmem,size=256m,shm=shmem2 \
|
||||
-device ivshmem,size=512m,chardev=charshmem3 \
|
||||
-device ivshmem,shm=shmem0,bus=pci.0,addr=0x3 \
|
||||
-device ivshmem,size=128m,shm=shmem1,bus=pci.0,addr=0x5 \
|
||||
-device ivshmem,size=256m,shm=shmem2,bus=pci.0,addr=0x4 \
|
||||
-device ivshmem,size=512m,chardev=charshmem3,bus=pci.0,addr=0x6 \
|
||||
-chardev socket,id=charshmem3,path=/var/lib/libvirt/shmem-shmem3-sock \
|
||||
-device ivshmem,size=1024m,chardev=charshmem4 \
|
||||
-device ivshmem,size=1024m,chardev=charshmem4,bus=pci.0,addr=0x7 \
|
||||
-chardev socket,id=charshmem4,path=/tmp/shmem4-sock \
|
||||
-device ivshmem,size=2048m,chardev=charshmem5,msi=on,ioeventfd=off \
|
||||
-device ivshmem,size=2048m,chardev=charshmem5,\
|
||||
msi=on,ioeventfd=off,bus=pci.0,addr=0x8 \
|
||||
-chardev socket,id=charshmem5,path=/tmp/shmem5-sock \
|
||||
-device ivshmem,size=4096m,chardev=charshmem6,msi=on,vectors=16 \
|
||||
-device ivshmem,size=4096m,chardev=charshmem6,\
|
||||
msi=on,vectors=16,bus=pci.0,addr=0x9 \
|
||||
-chardev socket,id=charshmem6,path=/tmp/shmem6-sock \
|
||||
-device ivshmem,size=8192m,chardev=charshmem7,msi=on,vectors=32,ioeventfd=on \
|
||||
-device ivshmem,size=8192m,chardev=charshmem7,\
|
||||
msi=on,vectors=32,ioeventfd=on,bus=pci.0,addr=0xa \
|
||||
-chardev socket,id=charshmem7,path=/tmp/shmem7-sock
|
||||
|
@ -23,6 +23,7 @@
|
||||
</shmem>
|
||||
<shmem name='shmem2'>
|
||||
<size unit='M'>256</size>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||
</shmem>
|
||||
<shmem name='shmem3'>
|
||||
<size unit='M'>512</size>
|
||||
|
Loading…
x
Reference in New Issue
Block a user