Skip to content

Instantly share code, notes, and snippets.

@sboeuf
Created August 14, 2018 20:14
Show Gist options
  • Save sboeuf/fd7ead9f0f81192745488b3d97f8b88f to your computer and use it in GitHub Desktop.
Save sboeuf/fd7ead9f0f81192745488b3d97f8b88f to your computer and use it in GitHub Desktop.
sudo ./x86_64-softmmu/qemu-system-x86_64 \
-nographic \
-nodefaults \
-L . \
-machine virt,accel=kvm,kernel_irqchip,nofw \
-smp sockets=1,cpus=4,cores=2,maxcpus=8 -cpu host \
-m 2G,slots=3,maxmem=16G \
-kernel /home/sebastien/workloads/linux_4_17/linux-4.17.14/arch/x86/boot/compressed/vmlinux.bin \
-append 'console=hvc0 single iommu=false root=/dev/ram0' \
-device virtio-serial-pci,id=virtio-serial0 \
-device virtconsole,chardev=charconsole0,id=console0 \
-chardev stdio,id=charconsole0 \
-device sysbus-debugcon,iobase=0x402,chardev=debugcon \
-chardev file,path=/tmp/debug-log,id=debugcon \
-monitor telnet:127.0.0.1:55555,server,nowait \
-qmp unix:/run/virtcontainers/pods/wH9OFIZOLD5jtSs3PNht/monitor.sock,server,nowait
-device pcie-root-port,id=rp1,addr=6,bus=pcie.0,multifunction=on
(qemu) device_add virtio-net-pci,bus=rp1
$ lspci
00:01.0 Class 0780: 1af4:1003
01:00.0 Class 0200: 1af4:1041
00:00.0 Class 0600: 1b36:0008
00:06.0 Class 0604: 1b36:000c
sudo ./x86_64-softmmu/qemu-system-x86_64 \
-nographic \
-nodefaults \
-L . \
-machine virt,accel=kvm,kernel_irqchip,nofw \
-smp sockets=1,cpus=4,cores=2,maxcpus=8 -cpu host \
-m 2G,slots=3,maxmem=16G \
-kernel /home/sebastien/workloads/linux_4_17/linux-4.17.14/arch/x86/boot/compressed/vmlinux.bin \
-append 'console=hvc0 single iommu=false root=/dev/ram0' \
-device virtio-serial-pci,id=virtio-serial0 \
-device virtconsole,chardev=charconsole0,id=console0 \
-chardev stdio,id=charconsole0 \
-device sysbus-debugcon,iobase=0x402,chardev=debugcon \
-chardev file,path=/tmp/debug-log,id=debugcon \
-monitor telnet:127.0.0.1:55555,server,nowait \
-qmp unix:/run/virtcontainers/pods/wH9OFIZOLD5jtSs3PNht/monitor.sock,server,nowait
-device pcie-pci-bridge,id=rp1,addr=6,bus=pcie.0,multifunction=on
(qemu) device_add virtio-net-pci,bus=rp1
$ lspci
01:01.0 Class 0200: 1af4:1000
00:01.0 Class 0780: 1af4:1003
00:00.0 Class 0600: 1b36:0008
00:06.0 Class 0604: 1b36:000e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment