network bridging, fix vendor-reset
This commit is contained in:
parent
bcbd8b7535
commit
8e1c5e609e
20
playbook.yml
20
playbook.yml
|
@ -1,10 +1,26 @@
|
||||||
- hosts: all, localhost
|
- hosts: all, localhost
|
||||||
become: yes
|
become: yes
|
||||||
vars:
|
vars:
|
||||||
pcie_device_ids:
|
vfio_pci_ids:
|
||||||
- '8086:15b8' # Intel Corporation Ethernet Connection (2) I219-V
|
# - '8086:15b8' # Intel Corporation Ethernet Connection (2) I219-V
|
||||||
- '1002:731f' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT]
|
- '1002:731f' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT]
|
||||||
- '1002:ab38' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio
|
- '1002:ab38' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio
|
||||||
|
pci_device_ids:
|
||||||
|
# Intel Corporation Ethernet Connection (2) I219-V
|
||||||
|
# - domain: '0000'
|
||||||
|
# bus: '00'
|
||||||
|
# slot: '1f'
|
||||||
|
# function: '6'
|
||||||
|
# Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT]
|
||||||
|
- domain: '0000'
|
||||||
|
bus: '03'
|
||||||
|
slot: '00'
|
||||||
|
function: '0'
|
||||||
|
# Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio
|
||||||
|
- domain: '0000'
|
||||||
|
bus: '03'
|
||||||
|
slot: '00'
|
||||||
|
function: '1'
|
||||||
usb_device_ids:
|
usb_device_ids:
|
||||||
- '054c:05c4' # Sony Corp. DualShock 4 [CUH-ZCT1x]
|
- '054c:05c4' # Sony Corp. DualShock 4 [CUH-ZCT1x]
|
||||||
- '046d:c539' # Logitech, Inc. USB Receiver
|
- '046d:c539' # Logitech, Inc. USB Receiver
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
name:
|
name:
|
||||||
- qemu
|
- qemu
|
||||||
- libvirt
|
- libvirt
|
||||||
|
- bridge-utils
|
||||||
- ovmf
|
- ovmf
|
||||||
- virt-manager
|
- virt-manager
|
||||||
- python-evdev
|
- python-evdev
|
||||||
- python-pyudev
|
- python-pyudev
|
||||||
# - vendor-reset-dkms-git
|
- vendor-reset-dkms-git
|
||||||
notify:
|
notify:
|
||||||
- restart libvirtd.service
|
- restart libvirtd.service
|
||||||
- restart virtlogd.socket
|
- restart virtlogd.socket
|
||||||
|
@ -24,7 +25,7 @@
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: install qemu hook
|
- name: install qemu hook
|
||||||
copy:
|
template:
|
||||||
src: hooks/qemu
|
src: hooks/qemu
|
||||||
dest: /etc/libvirt/hooks/qemu
|
dest: /etc/libvirt/hooks/qemu
|
||||||
mode: '755'
|
mode: '755'
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
systemctl start win10-usb
|
systemctl start win10-usb
|
||||||
|
|
||||||
|
# https://github.com/gnif/vendor-reset/issues/46#issuecomment-992282166
|
||||||
|
{% for pci_device_id in pci_device_ids %}
|
||||||
|
echo 'device_specific' >'/sys/bus/pci/devices/{{ pci_device_id.domain }}:{{ pci_device_id.bus }}:{{ pci_device_id.slot }}.{{ pci_device_id.function }}/reset_method'
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
vfio-isolate -u /tmp/win10.undo \
|
vfio-isolate -u /tmp/win10.undo \
|
||||||
drop-caches \
|
drop-caches \
|
|
@ -1 +1 @@
|
||||||
options vfio-pci ids={{ ','.join(pcie_device_ids) }}
|
options vfio-pci ids={{ ','.join(vfio_pci_ids) }}
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
</clock>
|
</clock>
|
||||||
<on_poweroff>destroy</on_poweroff>
|
<on_poweroff>destroy</on_poweroff>
|
||||||
<!-- Because of the AMD reset bug, we cannot actually restart normally -->
|
<!-- Because of the AMD reset bug, we cannot actually restart normally -->
|
||||||
<on_reboot>restart</on_reboot>
|
<on_reboot>destroy</on_reboot>
|
||||||
<on_crash>destroy</on_crash>
|
<on_crash>destroy</on_crash>
|
||||||
<pm>
|
<pm>
|
||||||
<suspend-to-mem enabled='no'/>
|
<suspend-to-mem enabled='no'/>
|
||||||
|
@ -166,58 +166,26 @@
|
||||||
<controller type='usb' index='0' model='qemu-xhci' ports='15'>
|
<controller type='usb' index='0' model='qemu-xhci' ports='15'>
|
||||||
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
||||||
</controller>
|
</controller>
|
||||||
<interface type='bridge'>
|
|
||||||
|
<!-- networking -->
|
||||||
|
<!-- <interface type='bridge'>
|
||||||
<mac address='52:54:00:f5:2c:df'/>
|
<mac address='52:54:00:f5:2c:df'/>
|
||||||
<source bridge='virbr0'/>
|
<source bridge='virbr0'/>
|
||||||
<model type='virtio'/>
|
<model type='virtio'/>
|
||||||
<link state='up'/>
|
<link state='up'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
|
||||||
|
</interface> -->
|
||||||
|
<interface type='bridge'>
|
||||||
|
<source bridge='br0'/>
|
||||||
|
<!-- <mac address='00:16:3e:1a:b3:4a'/> -->
|
||||||
|
<model type='virtio'/>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
|
<!-- HID -->
|
||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
<input type='mouse' bus='virtio'/>
|
<input type='mouse' bus='virtio'/>
|
||||||
<input type='keyboard' bus='ps2'/>
|
<input type='keyboard' bus='ps2'/>
|
||||||
<input type='keyboard' bus='virtio'/>
|
<input type='keyboard' bus='virtio'/>
|
||||||
<graphics type='spice' listen='127.0.0.1' port='5900' defaultMode='insecure'>
|
|
||||||
<listen type='address' address='127.0.0.1'/>
|
|
||||||
<image compression='off' />
|
|
||||||
<mouse mode='server'/>
|
|
||||||
<filetransfer enable='no'/>
|
|
||||||
</graphics>
|
|
||||||
<sound model='ich9'>
|
|
||||||
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
|
|
||||||
<audio id='1'/>
|
|
||||||
</sound>
|
|
||||||
<audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'/>
|
|
||||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
|
||||||
<source>
|
|
||||||
<address domain='0x0000' bus='0x00' slot='0x1f' function='0x6'/>
|
|
||||||
</source>
|
|
||||||
<address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
|
|
||||||
</hostdev>
|
|
||||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
|
||||||
<source>
|
|
||||||
<address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
|
|
||||||
</source>
|
|
||||||
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
|
|
||||||
</hostdev>
|
|
||||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
|
||||||
<source>
|
|
||||||
<address domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
|
|
||||||
</source>
|
|
||||||
<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
|
|
||||||
</hostdev>
|
|
||||||
<redirdev bus='usb' type='spicevmc'>
|
|
||||||
<address type='usb' bus='0' port='2'/>
|
|
||||||
</redirdev>
|
|
||||||
<redirdev bus='usb' type='spicevmc'>
|
|
||||||
<address type='usb' bus='0' port='3'/>
|
|
||||||
</redirdev>
|
|
||||||
<memballoon model='none'/>
|
|
||||||
<shmem name='looking-glass'>
|
|
||||||
<model type='ivshmem-plain'/>
|
|
||||||
<size unit='M'>32</size>
|
|
||||||
<address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
|
|
||||||
</shmem>
|
|
||||||
<!-- mouse evdev passthrough -->
|
<!-- mouse evdev passthrough -->
|
||||||
{% for item in mice %}
|
{% for item in mice %}
|
||||||
<input type='evdev'>
|
<input type='evdev'>
|
||||||
|
@ -230,6 +198,45 @@
|
||||||
<source dev='/dev/input/by-id/uinput-persist-keyboard{{ loop.index0 }}' grab='all' repeat='on'/>
|
<source dev='/dev/input/by-id/uinput-persist-keyboard{{ loop.index0 }}' grab='all' repeat='on'/>
|
||||||
</input>
|
</input>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
<!-- audio -->
|
||||||
|
<sound model='ich9'>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
|
||||||
|
<audio id='1'/>
|
||||||
|
</sound>
|
||||||
|
<audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'/>
|
||||||
|
|
||||||
|
<!-- pci passthrough -->
|
||||||
|
{% for pci_device_id in pci_device_ids %}
|
||||||
|
<hostdev mode='subsystem' type='pci' managed='yes'>
|
||||||
|
<source>
|
||||||
|
<address domain='0x{{ pci_device_id.domain }}' bus='0x{{ pci_device_id.bus }}' slot='0x{{ pci_device_id.slot }}' function='0x{{ pci_device_id.function }}'/>
|
||||||
|
</source>
|
||||||
|
</hostdev>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<!-- spice -->
|
||||||
|
<graphics type='spice' listen='127.0.0.1' port='5900' defaultMode='insecure'>
|
||||||
|
<listen type='address' address='127.0.0.1'/>
|
||||||
|
<image compression='off' />
|
||||||
|
<mouse mode='server'/>
|
||||||
|
<filetransfer enable='no'/>
|
||||||
|
</graphics>
|
||||||
|
<redirdev bus='usb' type='spicevmc'>
|
||||||
|
<address type='usb' bus='0' port='2'/>
|
||||||
|
</redirdev>
|
||||||
|
<redirdev bus='usb' type='spicevmc'>
|
||||||
|
<address type='usb' bus='0' port='3'/>
|
||||||
|
</redirdev>
|
||||||
|
<memballoon model='none'/>
|
||||||
|
|
||||||
|
<!-- looking-glass -->
|
||||||
|
<shmem name='looking-glass'>
|
||||||
|
<model type='ivshmem-plain'/>
|
||||||
|
<size unit='M'>32</size>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
|
||||||
|
</shmem>
|
||||||
|
|
||||||
</devices>
|
</devices>
|
||||||
<qemu:commandline>
|
<qemu:commandline>
|
||||||
</qemu:commandline>
|
</qemu:commandline>
|
||||||
|
|
Loading…
Reference in New Issue