-
Notifications
You must be signed in to change notification settings - Fork 0
/
siov-mdev.sh
executable file
·33 lines (28 loc) · 978 Bytes
/
siov-mdev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
echo $SCRIPT_DIR
UUID=59a9c13f-2180-4fac-89c3-07ffd958ce4e
KERNEL_IMAGE=/home/aubrey/kvm/vmlinux
QEMU_IMAGE=/usr/local/bin/qemu-system-x86_64
GUEST_IMAGE=/home/aubrey/kvm/debian.qcow2
if [[ ! -f $QEMU_IMAGE ]]; then
echo "Qemu image $QEMU_IMAGE does not exist"
exit 1
else
echo "Using Qemu binary $QEMU_IMAGE"
fi
$QEMU_IMAGE \
-accel kvm \
-cpu host \
-smp 2 \
-m 8G \
-machine q35 \
-nographic \
-vga none \
-device virtio-net-pci,netdev=mynet0,mac=00:16:3E:68:08:FF,romfile= \
-netdev user,id=mynet0,hostfwd=tcp::10099-:22,hostfwd=tcp::12099-:2375 \
-drive file=${GUEST_IMAGE},if=virtio,format=qcow2 \
-kernel ${KERNEL_IMAGE} \
-append "root=/dev/vda1 ro console=ttyS0,115200n8 earlyprintk=ttyS0 intel_iommu=on,sm_on" \
-device intel-iommu,caching-mode=on,dma-drain=on,x-scalable-mode="modern",device-iotlb=on,aw-bits=48 \
-device vfio-pci,sysfsdev=/sys/devices/pci0000:6a/0000:6a:01.0/$UUID \