https://www.qemu.org/docs/master/system/index.html https://readthedocs.org/projects/qemu/downloads/pdf/latest/
https://www.qemu.org/docs/master/interop/vhost-user.html?highlight=network https://www.qemu.org/docs/master/system/i386/pc.html?highlight=network https://www.qemu.org/docs/master/system/devices/net.html?highlight=network
Connecting emulated networks between QEMU instances Using the -netdev socket (or -nic socket or -net socket) option, it is possible to create emulated networks that span several QEMU instances. See the description of the -netdev socket option in Invocation to have a basic example.
qemu -h
Network options:
-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]
[,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]
[,restrict=on|off][,hostname=host][,dhcpstart=addr]
[,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]
[,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule][,smb=dir[,smbserver=addr]]
configure a user mode network backend with ID 'str',
its DHCP server and optional services
-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]
[,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]
[,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]
[,poll-us=n]
configure a host TAP network backend with ID 'str'
connected to a bridge (default=br0)
use network scripts 'file' (default=/etc/qemu-ifup)
to configure it and 'dfile' (default=/etc/qemu-ifdown)
to deconfigure it
use '[down]script=no' to disable script execution
use network helper 'helper' (default=/usr/lib/qemu/qemu-bridge-helper) to
configure it
use 'fd=h' to connect to an already opened TAP interface
use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces
use 'sndbuf=nbytes' to limit the size of the send buffer (the
default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')
use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag
use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition
use vhost=on to enable experimental in kernel accelerator
(only has effect for virtio guests which use MSIX)
use vhostforce=on to force vhost on for non-MSIX virtio guests
use 'vhostfd=h' to connect to an already opened vhost net device
use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices
use 'queues=n' to specify the number of queues to be created for multiqueue TAP
use 'poll-us=n' to speciy the maximum number of microseconds that could be
spent on busy polling for vhost net
-netdev bridge,id=str[,br=bridge][,helper=helper]
configure a host TAP network backend with ID 'str' that is
connected to a bridge (default=br0)
using the program 'helper (default=/usr/lib/qemu/qemu-bridge-helper)
-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]
[,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]
[,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]
[,rxcookie=rxcookie][,offset=offset]
configure a network backend with ID 'str' connected to
an Ethernet over L2TPv3 pseudowire.
Linux kernel 3.3+ as well as most routers can talk
L2TPv3. This transport allows connecting a VM to a VM,
VM to a router and even VM to Host. It is a nearly-universal
standard (RFC3391). Note - this implementation uses static
pre-configured tunnels (same as the Linux kernel).
use 'src=' to specify source address
use 'dst=' to specify destination address
use 'udp=on' to specify udp encapsulation
use 'srcport=' to specify source udp port
use 'dstport=' to specify destination udp port
use 'ipv6=on' to force v6
L2TPv3 uses cookies to prevent misconfiguration as
well as a weak security measure
use 'rxcookie=0x012345678' to specify a rxcookie
use 'txcookie=0x012345678' to specify a txcookie
use 'cookie64=on' to set cookie size to 64 bit, otherwise 32
use 'counter=off' to force a 'cut-down' L2TPv3 with no counter
use 'pincounter=on' to work around broken counter handling in peer
use 'offset=X' to add an extra offset between header and data
-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]
configure a network backend to connect to another network
using a socket connection
-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]
configure a network backend to connect to a multicast maddr and port
use 'localaddr=addr' to specify the host address to send packets from
-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]
configure a network backend to connect to another network
using an UDP tunnel
-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]
configure a vhost-user network, backed by a chardev 'dev'
-netdev hubport,id=str,hubid=n[,netdev=nd]
configure a hub port on the hub with ID 'n'
-nic [tap|bridge|user|l2tpv3|vhost-user|socket][,option][,...][mac=macaddr]
initialize an on-board / default host NIC (using MAC address
macaddr) and connect it to the given host network backend
-nic none use it alone to have zero network devices (the default is to
provided a 'user' network connection)
-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]
configure or create an on-board (or machine default) NIC and
connect it to hub 0 (please use -nic unless you need a hub)
-net [user|tap|bridge|socket][,option][,option][,...]
old way to initialize a host network interface
(use the -netdev option if possible instead)
❯ qemu-system-x86_64 -device pxb-pcie,help
Unable to init server: Could not connect: Connection refused
pxb-pcie options:
failover_pair_id=<str>
rombar=<uint32>
x-pcie-lnksta-dllla=<bool> - on/off
bus_nr=<uint8>
romfile=<str>
numa_node=<uint16>
addr=<int32> - Slot and optional function number, example: 06.0 or 06
x-pcie-extcap-init=<bool> - on/off
command_serr_enable=<bool> - on/off
multifunction=<bool> - on/off
❯ qemu-system-x86_64 -device ioh3420,help
Unable to init server: Could not connect: Connection refused
ioh3420 options:
addr=<int32> - Slot and optional function number, example: 06.0 or 06
aer_log_max=<uint16>
slot=<uint16>
power_controller_present=<bool> - on/off
port=<uint8>
x-pcie-extcap-init=<bool> - on/off
command_serr_enable=<bool> - on/off
chassis=<uint8>
failover_pair_id=<str>
x-pcie-lnksta-dllla=<bool> - on/off
romfile=<str>
rombar=<uint32>
multifunction=<bool> - on/off
disable-acs=<bool>
❯ qemu-system-x86_64 -device pcie-root-port,help
Unable to init server: Could not connect: Connection refused
pcie-root-port options:
addr=<int32> - Slot and optional function number, example: 06.0 or 06
power_controller_present=<bool> - on/off
aer_log_max=<uint16>
x-speed=<PCIELinkSpeed> - 2_5/5/8/16
slot=<uint16>
x-pcie-lnksta-dllla=<bool> - on/off
port=<uint8>
mem-reserve=<size>
x-pcie-extcap-init=<bool> - on/off
pref64-reserve=<size>
rombar=<uint32>
command_serr_enable=<bool> - on/off
romfile=<str>
multifunction=<bool> - on/off
chassis=<uint8>
x-width=<PCIELinkWidth> - 1/2/4/8/12/16/32
failover_pair_id=<str>
pref32-reserve=<size>
bus-reserve=<uint32>
x-migrate-msix=<bool>
disable-acs=<bool>
io-reserve=<size>
❯ sudo apt install qemu-system-x86 ovmf cloud-utils
❯ ls -l /dev/kvm
crw-rw----+ 1 root kvm 10, 232 Jan 26 22:49 /dev/kvm
❯ sudo chown root:libvirt /dev/kvm
ls /usr/share/ovmf/OVMF.fd
https://gist.github.com/mcastelino/88195a7d99811a177f5e643d1465e19e
VMN=1
qemu-system-x86_64 \
-machine pc,accel=kvm,kernel_irqchip \
-enable-kvm \
-bios OVMF.fd \
-smp sockets=1,cpus=4,cores=2 -cpu host \
-m 1024 \
-vga none -nographic \
-drive file="$IMAGE",if=virtio,aio=threads,format=raw \
-netdev user,id=mynet0,hostfwd=tcp::${VMN}0022-:22,hostfwd=tcp::${VMN}2375-:2375 \
-device virtio-net-pci,netdev=mynet0 \
-netdev socket,id=vlan,mcast=230.0.0.1:1234 \
-device virtio-net-pci,netdev=vlan \
sudo socat \
UDP4-DATAGRAM:230.0.0.1:1234,sourceport=1234,reuseaddr,ip-add-membership=230.0.0.1:127.0.0.1 \
TUN:10.0.3.1/24,tun-type=tap,iff-no-pi,iff-up,tun-name=vmvlan0
What precisely has changed in v197?
With systemd 197 we have added native support for a number of different naming policies into systemd/udevd proper and made a scheme similar to biosdevname's (but generally more powerful, and closer to kernel-internal device identification schemes) the default. The following different naming schemes for network interfaces are now supported by udev natively:
Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
Classic, unpredictable kernel-native ethX naming (example: eth0)
https://github.com/qemu/qemu/blob/master/docs/pcie.txt#L69
# To plug a device into pcie.0 as a Root Complex Integrated Endpoint use:
-device <dev>[,bus=pcie.0]
# To expose a new PCI Express Root Bus use:
-device pxb-pcie,id=pcie.1,bus_nr=x[,numa_node=y][,addr=z]
# PCI Express Root Ports and PCI Express to PCI bridges can be connected to the pcie.1 bus:
-device ioh3420,id=root_port1[,bus=pcie.1][,chassis=x][,slot=y][,addr=z] \
-device pcie-pci-bridge,id=pcie_pci_bridge1,bus=pcie.1
## Vanilla
# lspci -t
-[0000:00]-+-00.0
+-01.0
+-02.0
+-03.0
+-1f.0
+-1f.2
\-1f.3
## -device pci-bridge,id=bridge0,chassis_nr=1 \
## -device virtio-scsi-pci,id=scsi0,bus=bridge0,addr=0x3 \
## -device pci-bridge,id=bridge1,chassis_nr=2 \
## -device virtio-scsi-pci,id=scsi1,bus=bridge1,addr=0x3 \
## -device virtio-scsi-pci,id=scsi2,bus=bridge1,addr=0x4
root@ubuntu:~# lspci -t
-[0000:00]-+-00.0
+-01.0-[01]----03.0
+-02.0-[02]--+-03.0
| \-04.0
+-03.0
+-04.0
+-05.0
+-1f.0
+-1f.2
\-1f.3
root@ubuntu:~# lspci -v
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0
00:01.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge (prog-if 00 [Normal decode])
Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 24
Memory at 80020d000 (64-bit, non-prefetchable) [size=256]
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00007000-00007fff [size=4K]
Memory behind bridge: c0200000-c03fffff [size=2M]
Prefetchable memory behind bridge: 0000000800000000-00000008000fffff [size=1M]
Capabilities: [4c] MSI: Enable+ Count=1/1 Maskable+ 64bit+
Capabilities: [48] Slot ID: 0 slots, First+, chassis 01
Capabilities: [40] Hot-plug capable
Kernel driver in use: shpchp
00:02.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge (prog-if 00 [Normal decode])
Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 25
Memory at 80020c000 (64-bit, non-prefetchable) [size=256]
Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
I/O behind bridge: 00006000-00006fff [size=4K]
Memory behind bridge: c0000000-c01fffff [size=2M]
Prefetchable memory behind bridge: 0000000800100000-00000008001fffff [size=1M]
Capabilities: [4c] MSI: Enable+ Count=1/1 Maskable+ 64bit+
Capabilities: [48] Slot ID: 0 slots, First+, chassis 02
Capabilities: [40] Hot-plug capable
Kernel driver in use: shpchp
00:03.0 Ethernet controller: Red Hat, Inc. Virtio network device
Subsystem: Red Hat, Inc. Virtio network device
Flags: bus master, fast devsel, latency 0, IRQ 23
I/O ports at 8160 [size=32]
Memory at c0483000 (32-bit, non-prefetchable) [size=4K]
Memory at 800200000 (64-bit, prefetchable) [size=16K]
Expansion ROM at 40000000 [disabled] [size=512K]
Capabilities: [98] MSI-X: Enable+ Count=3 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
00:04.0 SCSI storage controller: Red Hat, Inc. Virtio block device
Subsystem: Red Hat, Inc. Virtio block device
Flags: bus master, fast devsel, latency 0, IRQ 20
I/O ports at 8080 [size=128]
Memory at c0482000 (32-bit, non-prefetchable) [size=4K]
Memory at 800204000 (64-bit, prefetchable) [size=16K]
Capabilities: [98] MSI-X: Enable+ Count=2 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
00:05.0 SCSI storage controller: Red Hat, Inc. Virtio block device
Subsystem: Red Hat, Inc. Virtio block device
Flags: bus master, fast devsel, latency 0, IRQ 21
I/O ports at 8000 [size=128]
Memory at c0481000 (32-bit, non-prefetchable) [size=4K]
Memory at 800208000 (64-bit, prefetchable) [size=16K]
Capabilities: [98] MSI-X: Enable+ Count=2 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0
00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02) (prog-if 01 [AHCI 1.0])
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0, IRQ 31
I/O ports at 8140 [size=32]
Memory at c0480000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [a8] SATA HBA v1.0
Kernel driver in use: ahci
Kernel modules: ahci
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0, IRQ 10
I/O ports at 8100 [size=64]
01:03.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
Subsystem: Red Hat, Inc. Virtio SCSI
Physical Slot: 3
Flags: bus master, fast devsel, latency 0, IRQ 20
I/O ports at 7000 [size=64]
Memory at c0200000 (32-bit, non-prefetchable) [size=4K]
Memory at 800000000 (64-bit, prefetchable) [size=16K]
Capabilities: [98] MSI-X: Enable+ Count=4 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
02:03.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
Subsystem: Red Hat, Inc. Virtio SCSI
Physical Slot: 3-1
Flags: bus master, fast devsel, latency 0, IRQ 21
I/O ports at 6040 [size=64]
Memory at c0001000 (32-bit, non-prefetchable) [size=4K]
Memory at 800104000 (64-bit, prefetchable) [size=16K]
Capabilities: [98] MSI-X: Enable+ Count=4 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
02:04.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
Subsystem: Red Hat, Inc. Virtio SCSI
Physical Slot: 4-1
Flags: bus master, fast devsel, latency 0, IRQ 22
I/O ports at 6000 [size=64]
Memory at c0000000 (32-bit, non-prefetchable) [size=4K]
Memory at 800100000 (64-bit, prefetchable) [size=16K]
Capabilities: [98] MSI-X: Enable+ Count=4 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
https://gist.github.com/mcastelino/b2ecebbaf609c665549eac35b3cc39ce
-device pcie-root-port,bus=pcie.0,id=rp1,slot=1 \
-device pcie-root-port,bus=pcie.0,id=rp2,slot=2 \
-device pcie-root-port,bus=pcie.0,id=rp3,slot=3,bus-reserve=1 \
-device pcie-pci-bridge,id=br1,bus=rp1 \
-device pcie-pci-bridge,id=br2,bus=rp2 \
-device e1000,bus=br1,addr=8
root@ubuntu:~# lspci -t
-[0000:00]-+-00.0
+-01.0
+-02.0-[01-02]----00.0-[02]----08.0
+-03.0-[03-04]----00.0-[04]--
+-04.0-[05-06]--
+-05.0
+-06.0
+-1f.0
+-1f.2
\-1f.3
02:08.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03)
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Physical Slot: 8
Flags: bus master, fast devsel, latency 0, IRQ 22
Memory at c0600000 (32-bit, non-prefetchable) [size=128K]
I/O ports at 8000 [size=64]
Expansion ROM at c0680000 [disabled] [size=512K]
Kernel driver in use: e1000
Kernel modules: e1000
root@ubuntu:~# ip l sho ens8
3: ens8: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
altname enp2s8
root@ubuntu:~# dmesg | grep ens8
[ 0.896340] e1000 0000:02:08.0 ens8: renamed from eth0
root@ubuntu:~# dmesg | grep enp2s8
root@ubuntu:~#
00:01.0 Ethernet controller: Red Hat, Inc. Virtio network device
Subsystem: Red Hat, Inc. Virtio network device
Flags: bus master, fast devsel, latency 0, IRQ 21
I/O ports at 9160 [size=32]
Memory at c0986000 (32-bit, non-prefetchable) [size=4K]
Memory at 800000000 (64-bit, prefetchable) [size=16K]
Expansion ROM at 40000000 [disabled] [size=512K]
Capabilities: [98] MSI-X: Enable+ Count=3 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
00:02.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 22
Memory at c0985000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=01, subordinate=02, sec-latency=0
I/O behind bridge: 00008000-00008fff [size=4K]
Memory behind bridge: c0600000-c08fffff [size=3M]
Prefetchable memory behind bridge: 0000000800100000-00000008002fffff [size=2M]
Capabilities: [54] Express Root Port (Slot+), MSI 00
Capabilities: [48] MSI-X: Enable+ Count=1 Masked-
Capabilities: [40] Subsystem: Red Hat, Inc. QEMU PCIe Root port
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Access Control Services
Kernel driver in use: pcieport
00:03.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 23
Memory at c0984000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=03, subordinate=04, sec-latency=0
I/O behind bridge: 00007000-00007fff [size=4K]
Memory behind bridge: c0200000-c04fffff [size=3M]
Prefetchable memory behind bridge: 0000000800300000-00000008004fffff [size=2M]
Capabilities: [54] Express Root Port (Slot+), MSI 00
Capabilities: [48] MSI-X: Enable+ Count=1 Masked-
Capabilities: [40] Subsystem: Red Hat, Inc. QEMU PCIe Root port
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Access Control Services
Kernel driver in use: pcieport
00:04.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 20
Memory at c0983000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=05, subordinate=06, sec-latency=0
I/O behind bridge: 00006000-00006fff [size=4K]
Memory behind bridge: c0000000-c01fffff [size=2M]
Prefetchable memory behind bridge: 0000000800500000-00000008006fffff [size=2M]
Capabilities: [90] Vendor Specific Information: Len=20 <?>
Capabilities: [54] Express Root Port (Slot+), MSI 00
Capabilities: [48] MSI-X: Enable+ Count=1 Masked-
Capabilities: [40] Subsystem: Red Hat, Inc. QEMU PCIe Root port
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Access Control Services
Kernel driver in use: pcieport
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86067sec preferred_lft 86067sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86069sec preferred_lft 14069sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: ens8: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
altname enp2s8
-device e1000,bus=br1,addr=8 \
-device e1000,bus=br1,addr=7 \
-device e1000,bus=br1,addr=6
[ 1.022791] sr 2:0:0:0: Attached scsi generic sg0 type 5
[ 1.184137] e1000 0000:02:07.0 eth1: (PCI:33MHz:32-bit) 52:54:00:12:34:57
[ 1.184487] e1000 0000:02:07.0 eth1: Intel(R) PRO/1000 Network Connection
[ 1.492069] e1000 0000:02:08.0 eth2: (PCI:33MHz:32-bit) 52:54:00:12:34:56
[ 1.492368] e1000 0000:02:08.0 eth2: Intel(R) PRO/1000 Network Connection
[ 1.493464] e1000 0000:02:07.0 ens7: renamed from eth1
[ 1.506977] e1000 0000:02:08.0 ens8: renamed from eth2
[ 1.518940] e1000 0000:02:06.0 ens6: renamed from eth0
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86351sec preferred_lft 86351sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86354sec preferred_lft 14354sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: ens6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:58 brd ff:ff:ff:ff:ff:ff
altname enp2s6
4: ens7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
altname enp2s7
5: ens8: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
altname enp2s8
SUDOUSER=$(whoami)
echo "${SUDOUSER} ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/60-${SUDOUSER}-elevate
sudo chmod 0440 /etc/sudoers.d/60-${SUDOUSER}-elevate
sudo visudo -c
sudo mkdir -p /etc/systemd/system/getty@tty1.service.d/
sudo mkdir /etc/systemd/system/serial-getty@ttyS0.service.d/
cat <<EOF | sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
Type=simple
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux
EOF
cat <<EOF | sudo tee /etc/systemd/system/serial-getty@ttyS0.service.d/override.conf
[Service]
Type=simple
ExecStart=
ExecStart=-/sbin/agetty --autologin root --issue-file /etc/issue.ttyS0 --login-pause --noclear %I 115200 vt100-nav
EOF
# man systemd-networkd-wait-online
sudo mkdir -p /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
cat <<EOF | tee /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
[Service]
ExecStart=
ExecStart=/lib/systemd/systemd-networkd-wait-online --timeout=3
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now getty@tty1.service
sudo systemctl enable --now serial-getty@ttyS0.service
sudo systemctl restart serial-getty@ttyS0.service
# ~/.profile: executed by Bourne-compatible login shells.
cat <<EOF | sudo tee /etc/profile.d/ttyS0-dimensions.sh
if [ $(tty) == '/dev/ttyS0' ]; then
stty rows 31 cols 100
fi
EOF
echo $ROWS $LINES
sudo chmod -x /etc/update-motd.d/*
sudo mkdir -p /etc/systemd/system/networking.service.d/
cat <<EOF > /etc/systemd/system/networking.service.d/timeout.conf
[Service]
TimeoutStopSec=
TimeoutStopSec=10
EOF
sudo mkdir -p /etc/systemd/system/systemd-logind.service.d/
cat <<EOF > /etc/systemd/system/systemd-logind.service.d/timeout.conf
[Service]
TimeoutStopSec=
TimeoutStopSec=10
EOF
sudo systemctl daemon-reload
cat <<EOF > /etc/issue.ttyS0
\S
nodename: \n
domainname: \O
kernel: \r on \m
os version: \v
current date: \d
current time: \t
tty: \l
IPv4: \4
IPv6: \6
EOF
apt -y \
-o Dpkg::Progress-Fancy="0" \
update
apt -y \
-o Dpkg::Progress-Fancy="0" \
upgrade
apt -y \
-o Dpkg::Progress-Fancy="0" \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" \
--no-install-recommends \
install \
bind9-dnsutils \
coreutils \
curl \
iproute2 \
iputils-arping \
iputils-ping \
jq \
less \
mtr-tiny \
nano \
procps \
psmisc \
tcpdump \
telnet \
traceroute \
hwloc-nox
hwloc-nox for lstopo
❯ virsh dumpxml --domain ubuntu20.04
<domain type='kvm'>
<name>ubuntu20.04</name>
<uuid>2e25039a-dd7a-413b-b600-09a6de0bf36b</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://ubuntu.com/ubuntu/20.04"/>
</libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/ubuntu20.04_VARS.fd</nvram>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<cpu mode='host-model' check='partial'/>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/home/vsix/Scratch/debugimg.raw'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</disk>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci1'>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
<master startport='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/>
</controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pcie-root'/>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</controller>
<controller type='pci' index='1' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='1' port='0x10'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='2' port='0x11'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
</controller>
<controller type='pci' index='3' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='3' port='0x12'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
</controller>
<controller type='pci' index='4' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='4' port='0x13'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
</controller>
<controller type='pci' index='5' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='5' port='0x14'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
</controller>
<controller type='pci' index='6' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='6' port='0x15'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:b3:fb:8e'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<channel type='unix'>
<target type='virtio' name='org.qemu.guest_agent.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>
<input type='tablet' bus='usb'>
<address type='usb' bus='0' port='1'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='spice' autoport='yes'>
<listen type='address'/>
<image compression='off'/>
</graphics>
<sound model='ich9'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>
<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='virtio'>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</rng>
</devices>
</domain>
https://libvirt.org/pci-addresses.html gives
<controller type='pci' index='0' model='pcie-root'/>
<controller type='pci' index='1' model='pcie-expander-bus'>
<model name='pxb-pcie'/>
<target busNr='254'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='2' port='0x0'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</controller>
<interface type='network'>
<source network='default'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</interface>
/usr/bin/qemu-system-x86_64
-name guest=ubuntu20.04,debug-threads=on
-S
-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-5-ubuntu20.04/master-key.aes
-blockdev {"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}
-blockdev {"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}
-blockdev {"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/ubuntu20.04_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}
-blockdev {"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}
-machine pc-q35-4.2,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format
-cpu EPYC-Milan,x2apic=on,tsc-deadline=on,hypervisor=on,tsc-adjust=on,vaes=on,vpclmulqdq=on,spec-ctrl=on,stibp=on,arch-capabilities=on,ssbd=on,cmp-legacy=on,virt-ssbd=on,rdctl-no=on,skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,pcid=off
-m 4096
-overcommit mem-lock=off
-smp 2,sockets=2,cores=1,threads=1
-uuid 2e25039a-dd7a-413b-b600-09a6de0bf36b
-no-user-config
-nodefaults
-chardev socket,id=charmonitor,fd=31,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control
-rtc base=utc,driftfix=slew
-global kvm-pit.lost_tick_policy=delay
-no-hpet
-no-shutdown
-global ICH9-LPC.disable_s3=1
-global ICH9-LPC.disable_s4=1
-boot strict=on
-device pxb-pcie,bus_nr=254,id=pci.1,bus=pcie.0,addr=0x1
-device pcie-root-port,port=0x0,chassis=2,id=pci.2,bus=pci.1,multifunction=on,addr=0x0
-device pcie-root-port,port=0x2,chassis=3,id=pci.3,bus=pci.1,addr=0x0.0x1
-device pcie-root-port,port=0x10,chassis=4,id=pci.4,bus=pcie.0,multifunction=on,addr=0x2
-device pcie-root-port,port=0x11,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x1
-device pcie-root-port,port=0x12,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x2
-device pcie-root-port,port=0x13,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x3
-device pcie-root-port,port=0x14,chassis=8,id=pci.8,bus=pcie.0,addr=0x2.0x4
-device pcie-pci-bridge,id=pci.9,bus=pci.8,addr=0x0
-device qemu-xhci,id=usb,bus=pci.3,addr=0x0
-device virtio-serial-pci,id=virtio-serial0,bus=pci.7,addr=0x0
-blockdev {"driver":"file","filename":"/var/lib/libvirt/images/debugimg.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}
-blockdev {"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}
-device virtio-blk-pci,scsi=off,bus=pci.5,addr=0x0,drive=libvirt-1-format,id=virtio-disk0,bootindex=1
-netdev tap,fd=33,id=hostnet0,vhost=on,vhostfd=34
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:2d:c2:63,bus=pci.2,addr=0x0.0x1
-netdev tap,fd=35,id=hostnet1,vhost=on,vhostfd=36
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:5d:94:c7,bus=pci.2,multifunction=on,addr=0x0
-netdev tap,fd=37,id=hostnet2,vhost=on,vhostfd=38
-device virtio-net-pci,netdev=hostnet2,id=net2,mac=52:54:00:1e:19:2f,bus=pci.6,addr=0x0
-chardev spicevmc,id=charchannel0,name=vdagent
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0
-chardev socket,id=charchannel1,fd=39,server,nowait
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0
-chardev pty,id=charconsole0
-device virtconsole,chardev=charconsole0,id=console0
-device usb-tablet,id=input2,bus=usb.0,port=1
-spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.9,addr=0x1
-device virtio-balloon-pci,id=balloon0,bus=pci.4,addr=0x0
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny
-msg timestamp=on
Saucy:
-device pxb-pcie,bus_nr=254,id=pci.1,bus=pcie.0,addr=0x1
-device pcie-root-port,port=0x0,chassis=2,id=pci.2,bus=pci.1,multifunction=on,addr=0x0
-device pcie-root-port,port=0x2,chassis=3,id=pci.3,bus=pci.1,addr=0x0.0x1
-netdev tap,fd=33,id=hostnet0,vhost=on,vhostfd=34
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:2d:c2:63,bus=pci.2,addr=0x0.0x1
-netdev tap,fd=35,id=hostnet1,vhost=on,vhostfd=36
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:5d:94:c7,bus=pci.2,multifunction=on,addr=0x0
-device pcie-root-port,port=0x12,chassis=6,id=pci.6,bus=pcie.0,addr=0x2 \
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02,bus=pci.6,addr=0x0
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp1s0
valid_lft 86391sec preferred_lft 86391sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86393sec preferred_lft 14393sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
root@ubuntu:~# lspci -t
-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-03.0
+-1f.0
+-1f.2
\-1f.3
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86384sec preferred_lft 86384sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86386sec preferred_lft 14386sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
root@ubuntu:~# lspci -t
-[0000:00]-+-00.0
+-01.0
+-02.0
+-03.0
+-1f.0
+-1f.2
\-1f.3
-device pcie-root-port,port=0x1,chassis=1,id=pci.1,bus=pcie.0,addr=0x2 \
-blockdev driver=raw,node-name=mydisk,file.driver=file,file.filename={{diskimg}} \
-device virtio-blk-pci,scsi=off,bus=pci.1,addr=0x0,drive=mydisk,id=virtio-disk0,bootindex=1 \
-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-1f.0
+-1f.2
\-1f.3
01:00.0 SCSI storage controller: Red Hat, Inc. Virtio block device (rev 01)
Subsystem: Red Hat, Inc. Virtio block device
Physical Slot: 0
Flags: bus master, fast devsel, latency 0, IRQ 22
Memory at c0000000 (32-bit, non-prefetchable) [size=4K]
Memory at 800000000 (64-bit, prefetchable) [size=16K]
Capabilities: [dc] MSI-X: Enable+ Count=2 Masked-
Capabilities: [c8] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [b4] Vendor Specific Information: VirtIO: Notify
Capabilities: [a4] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [94] Vendor Specific Information: VirtIO: ISR
Capabilities: [84] Vendor Specific Information: VirtIO: CommonCfg
Capabilities: [7c] Power Management version 3
Capabilities: [40] Express Endpoint, MSI 00
Kernel driver in use: virtio-pci
-device pxb-pcie,bus_nr=254,id=pci.2,bus=pcie.0,addr=0x3 \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x5 \
-device pxb-pcie,bus_nr=254,id=pci.2,bus=pcie.0,addr=0x3 \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x5 \
-device virtio-net-pci,bus=pci.11,addr=0x0
root@ubuntu:~# lspci -t
-+-[0000:fe]---05.0-[ff]----00.0
\-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-03.0
+-1f.0
+-1f.2
\-1f.3
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp255s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
3: enp0s1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0x3 \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x5 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device pcie-root-port,port=0x6,chassis=6,id=pci.12,bus=pci.2,addr=0x6 \
-device virtio-net-pci,bus=pci.12,addr=0x0 \
-device pcie-root-port,port=0x7,chassis=7,id=pci.13,bus=pci.2,addr=0x7 \
-device virtio-net-pci,bus=pci.13,addr=0x0 \
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
3: enp70s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:58 brd ff:ff:ff:ff:ff:ff
4: enp71s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:59 brd ff:ff:ff:ff:ff:ff
5: enp0s1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
root@ubuntu:~# lspci -t
-+-[0000:44]-+-05.0-[45]----00.0
| +-06.0-[46]----00.0
| \-07.0-[47]----00.0
\-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-03.0
+-1f.0
+-1f.2
\-1f.3
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0x3 \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x1 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device pcie-root-port,port=0x5,chassis=9,id=pci.19,bus=pci.2,addr=0x2 \
-device virtio-net-pci,bus=pci.19,addr=0x0 \
root@ubuntu:~# lsp
lspci lspgpot
root@ubuntu:~# lspci -t
-+-[0000:44]-+-01.0-[45]----00.0
| \-02.0-[46]----00.0
\-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-03.0
+-1f.0
+-1f.2
\-1f.3
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
3: enp70s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:58 brd ff:ff:ff:ff:ff:ff
4: enp0s1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0x3 \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x1 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device pcie-root-port,port=0x5,chassis=9,id=pci.19,bus=pci.2,addr=0x2 \
-device virtio-net-pci,bus=pci.19,addr=0x1 \
root@ubuntu:~# lspci -t
-+-[0000:44]-+-01.0-[45]----00.0
| \-02.0-[46]--
\-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-03.0
+-1f.0
+-1f.2
\-1f.3
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
3: enp0s1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
[ 0.265588] pci 0000:00:01.0: can't claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
[ 0.266033] pci 0000:45:00.0: can't claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
[ 0.266481] pci 0000:00:01.0: BAR 6: assigned [mem 0x40000000-0x4007ffff pref]
[ 0.266808] pci 0000:00:1f.3: BAR 4: assigned [io 0x1000-0x103f]
[ 0.267383] pci 0000:00:01.0: BAR 2: assigned [io 0x1040-0x105f]
[ 0.267922] pci 0000:00:1f.2: BAR 4: assigned [io 0x1060-0x107f]
[ 0.268443] pci 0000:00:02.0: PCI bridge to [bus 01]
[ 0.268683] pci 0000:00:02.0: bridge window [io 0x6000-0x6fff]
[ 0.269390] pci 0000:00:02.0: bridge window [mem 0xc0000000-0xc01fffff]
[ 0.269975] pci 0000:00:02.0: bridge window [mem 0x800000000-0x8000fffff 64bit pref]
[ 0.274927] pci 0000:45:00.0: BAR 6: assigned [mem 0xc0680000-0xc06fffff pref]
[ 0.275272] pci 0000:44:01.0: PCI bridge to [bus 45]
[ 0.275507] pci 0000:44:01.0: bridge window [io 0x8000-0x8fff]
[ 0.276203] pci 0000:44:01.0: bridge window [mem 0xc0600000-0xc07fffff]
[ 0.276787] pci 0000:44:01.0: bridge window [mem 0x800100000-0x8001fffff 64bit pref]
[ 0.277678] pci 0000:44:02.0: PCI bridge to [bus 46]
[ 0.278528] pci 0000:44:02.0: bridge window [io 0x7000-0x7fff]
[ 0.279137] pci 0000:44:02.0: bridge window [mem 0xc0400000-0xc05fffff]
[ 0.279638] pci 0000:44:02.0: bridge window [mem 0x800200000-0x8002fffff 64bit pref]
[ 0.294179] ACPI: \_SB_.GSIG: Enabled at IRQ 22
[ 0.294692] pcieport 0000:00:02.0: PME: Signaling with IRQ 24
[ 0.295058] pcieport 0000:00:02.0: AER: enabled with IRQ 24
[ 0.295344] pcieport 0000:00:02.0: pciehp: Slot #0 AttnBtn+ PwrCtrl+ MRL- AttnInd+ PwrInd+ HotPlug+ Surprise+ Interlock+ NoCompl- IbPresDis- LLActRep+
[ 0.313054] ACPI: \_SB_.LNKA: Enabled at IRQ 10
[ 0.313526] pcieport 0000:44:01.0: PME: Signaling with IRQ 25
[ 0.315778] pcieport 0000:44:01.0: AER: enabled with IRQ 25
[ 0.316130] pcieport 0000:44:01.0: pciehp: Slot #0 AttnBtn+ PwrCtrl+ MRL- AttnInd+ PwrInd+ HotPlug+ Surprise+ Interlock+ NoCompl- IbPresDis- LLActRep+
[ 0.329872] ACPI: \_SB_.LNKB: Enabled at IRQ 11
[ 0.330333] pcieport 0000:44:02.0: PME: Signaling with IRQ 26
[ 0.330664] pcieport 0000:44:02.0: AER: enabled with IRQ 26
[ 0.330951] pcieport 0000:44:02.0: pciehp: Slot #0 AttnBtn+ PwrCtrl+ MRL- AttnInd+ PwrInd+ HotPlug+ Surprise+ Interlock+ NoCompl- IbPresDis- LLActRep+
[ 0.331643] pcieport 0000:44:02.0: pciehp: Slot(0-2): Card present
[ 0.331941] pcieport 0000:44:02.0: pciehp: Slot(0-2): Link Up
[ 0.332389] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[ 1.879731] pcieport 0000:44:02.0: pciehp: Slot(0-2): No device found <<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02 \
-netdev user,id=mynet1,hostfwd=tcp::10023-:22 \
-device virtio-net-pci,netdev=mynet1,mac=02:02:02:02:02:03 \
\
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0xf \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x1 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device pcie-root-port,port=0x5,chassis=9,id=pci.19,bus=pci.2,addr=0x2 \
-device virtio-net-pci,bus=pci.19,addr=0x1 \
root@ubuntu:~# lspci -t
-+-[0000:44]-+-01.0-[45]----00.0
| \-02.0-[46]--
\-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-03.0
+-0f.0
+-1f.0
+-1f.2
\-1f.3
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86391sec preferred_lft 86391sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86393sec preferred_lft 14393sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
(qemu) info network
virtio-net-pci.0: index=0,type=nic,model=virtio-net-pci,macaddr=02:02:02:02:02:02
\ mynet0: index=0,type=user,net=10.0.2.0,restrict=off
virtio-net-pci.1: index=0,type=nic,model=virtio-net-pci,macaddr=02:02:02:02:02:03
\ mynet1: index=0,type=user,net=10.0.2.0,restrict=off
virtio-net-pci.2: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
(qemu) info pci
Bus 68, device 1, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 10.
BUS 68.
secondary bus 69.
subordinate bus 69.
IO range [0x8000, 0x8fff]
memory range [0xc0600000, 0xc07fffff]
prefetchable memory range [0x800200000, 0x8002fffff]
BAR0: 32 bit memory at 0xc0881000 [0xc0881fff].
id "pci.11"
Bus 69, device 0, function 0:
Ethernet controller: PCI device 1af4:1041
PCI subsystem 1af4:1100
IRQ 10.
BAR1: 32 bit memory at 0xc0600000 [0xc0600fff].
BAR4: 64 bit prefetchable memory at 0x800200000 [0x800203fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 68, device 2, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 11.
BUS 68.
secondary bus 70.
subordinate bus 70.
IO range [0x7000, 0x7fff]
memory range [0xc0400000, 0xc05fffff]
prefetchable memory range [0x800300000, 0x8003fffff]
BAR0: 32 bit memory at 0xc0880000 [0xc0880fff].
id "pci.19"
Bus 0, device 0, function 0:
Host bridge: PCI device 8086:29c0
PCI subsystem 1af4:1100
id ""
Bus 0, device 1, function 0:
Ethernet controller: PCI device 1af4:1000
PCI subsystem 1af4:0001
IRQ 10.
BAR0: I/O at 0x1040 [0x105f].
BAR1: 32 bit memory at 0xc0283000 [0xc0283fff].
BAR4: 64 bit prefetchable memory at 0x800100000 [0x800103fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 2, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 11.
BUS 0.
secondary bus 1.
subordinate bus 1.
IO range [0x6000, 0x6fff]
memory range [0xc0000000, 0xc01fffff]
prefetchable memory range [0x800000000, 0x8000fffff]
BAR0: 32 bit memory at 0xc0282000 [0xc0282fff].
id "pci.1"
Bus 1, device 0, function 0:
SCSI controller: PCI device 1af4:1042
PCI subsystem 1af4:1100
IRQ 11.
BAR1: 32 bit memory at 0xc0000000 [0xc0000fff].
BAR4: 64 bit prefetchable memory at 0x800000000 [0x800003fff].
id "virtio-disk0"
Bus 0, device 3, function 0:
Ethernet controller: PCI device 1af4:1000
PCI subsystem 1af4:0001
IRQ 11.
BAR0: I/O at 0x1060 [0x107f].
BAR1: 32 bit memory at 0xc0281000 [0xc0281fff].
BAR4: 64 bit prefetchable memory at 0x800104000 [0x800107fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 15, function 0:
Host bridge: PCI device 1b36:000b
PCI subsystem 1af4:1100
id "pci.2"
Bus 0, device 31, function 0:
ISA bridge: PCI device 8086:2918
PCI subsystem 1af4:1100
id ""
Bus 0, device 31, function 2:
SATA controller: PCI device 8086:2922
PCI subsystem 1af4:1100
IRQ 10.
BAR4: I/O at 0x1080 [0x109f].
BAR5: 32 bit memory at 0xc0280000 [0xc0280fff].
id ""
Bus 0, device 31, function 3:
SMBus: PCI device 8086:2930
PCI subsystem 1af4:1100
IRQ 10.
BAR4: I/O at 0x1000 [0x103f].
id ""
root@ubuntu:~# lspci -v
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0
00:01.0 Ethernet controller: Red Hat, Inc. Virtio network device
Subsystem: Red Hat, Inc. Virtio network device
Flags: bus master, fast devsel, latency 0, IRQ 21
I/O ports at 1040 [size=32]
Memory at c0283000 (32-bit, non-prefetchable) [size=4K]
Memory at 800100000 (64-bit, prefetchable) [size=16K]
Expansion ROM at 40000000 [disabled] [size=512K]
Capabilities: [98] MSI-X: Enable+ Count=3 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
00:02.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 22
Memory at c0282000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00006000-00006fff [size=4K]
Memory behind bridge: c0000000-c01fffff [size=2M]
Prefetchable memory behind bridge: 0000000800000000-00000008000fffff [size=1M]
Capabilities: [54] Express Root Port (Slot+), MSI 00
Capabilities: [48] MSI-X: Enable+ Count=1 Masked-
Capabilities: [40] Subsystem: Red Hat, Inc. QEMU PCIe Root port
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Access Control Services
Kernel driver in use: pcieport
00:03.0 Ethernet controller: Red Hat, Inc. Virtio network device
Subsystem: Red Hat, Inc. Virtio network device
Flags: bus master, fast devsel, latency 0, IRQ 23
I/O ports at 1060 [size=32]
Memory at c0281000 (32-bit, non-prefetchable) [size=4K]
Memory at 800104000 (64-bit, prefetchable) [size=16K]
Expansion ROM at 40080000 [disabled] [size=512K]
Capabilities: [98] MSI-X: Enable+ Count=3 Masked-
Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [70] Vendor Specific Information: VirtIO: Notify
Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [50] Vendor Specific Information: VirtIO: ISR
Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
Kernel driver in use: virtio-pci
00:0f.0 Host bridge: Red Hat, Inc. QEMU PCIe Expander bridge
Subsystem: Red Hat, Inc. QEMU PCIe Expander bridge
Flags: bus master, 66MHz, fast devsel, latency 0
00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0
00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02) (prog-if 01 [AHCI 1.0])
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0, IRQ 29
I/O ports at 1080 [size=32]
Memory at c0280000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [a8] SATA HBA v1.0
Kernel driver in use: ahci
Kernel modules: ahci
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Flags: bus master, fast devsel, latency 0, IRQ 10
I/O ports at 1000 [size=64]
01:00.0 SCSI storage controller: Red Hat, Inc. Virtio block device (rev 01)
Subsystem: Red Hat, Inc. Virtio block device
Physical Slot: 0
Flags: bus master, fast devsel, latency 0, IRQ 22
Memory at c0000000 (32-bit, non-prefetchable) [size=4K]
Memory at 800000000 (64-bit, prefetchable) [size=16K]
Capabilities: [dc] MSI-X: Enable+ Count=2 Masked-
Capabilities: [c8] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [b4] Vendor Specific Information: VirtIO: Notify
Capabilities: [a4] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [94] Vendor Specific Information: VirtIO: ISR
Capabilities: [84] Vendor Specific Information: VirtIO: CommonCfg
Capabilities: [7c] Power Management version 3
Capabilities: [40] Express Endpoint, MSI 00
Kernel driver in use: virtio-pci
44:01.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 10
Memory at c0881000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=44, secondary=45, subordinate=45, sec-latency=0
I/O behind bridge: 00008000-00008fff [size=4K]
Memory behind bridge: c0600000-c07fffff [size=2M]
Prefetchable memory behind bridge: 0000000800200000-00000008002fffff [size=1M]
Capabilities: [54] Express Root Port (Slot+), MSI 00
Capabilities: [48] MSI-X: Enable+ Count=1 Masked-
Capabilities: [40] Subsystem: Red Hat, Inc. QEMU PCIe Root port
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Access Control Services
Kernel driver in use: pcieport
44:02.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 11
Memory at c0880000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=44, secondary=46, subordinate=46, sec-latency=0
I/O behind bridge: 00007000-00007fff [size=4K]
Memory behind bridge: c0400000-c05fffff [size=2M]
Prefetchable memory behind bridge: 0000000800300000-00000008003fffff [size=1M]
Capabilities: [54] Express Root Port (Slot+), MSI 00
Capabilities: [48] MSI-X: Enable+ Count=1 Masked-
Capabilities: [40] Subsystem: Red Hat, Inc. QEMU PCIe Root port
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Access Control Services
Kernel driver in use: pcieport
45:00.0 Ethernet controller: Red Hat, Inc. Virtio network device (rev 01)
Subsystem: Red Hat, Inc. Virtio network device
Physical Slot: 0-1
Flags: bus master, fast devsel, latency 0, IRQ 10
Memory at c0600000 (32-bit, non-prefetchable) [size=4K]
Memory at 800200000 (64-bit, prefetchable) [size=16K]
Expansion ROM at c0680000 [disabled] [size=512K]
Capabilities: [dc] MSI-X: Enable+ Count=3 Masked-
Capabilities: [c8] Vendor Specific Information: VirtIO: <unknown>
Capabilities: [b4] Vendor Specific Information: VirtIO: Notify
Capabilities: [a4] Vendor Specific Information: VirtIO: DeviceCfg
Capabilities: [94] Vendor Specific Information: VirtIO: ISR
Capabilities: [84] Vendor Specific Information: VirtIO: CommonCfg
Capabilities: [7c] Power Management version 3
Capabilities: [40] Express Endpoint, MSI 00
Kernel driver in use: virtio-pci
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02 \
-netdev user,id=mynet1,hostfwd=tcp::10023-:22 \
-device virtio-net-pci,netdev=mynet1,mac=02:02:02:02:02:03 \
\
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0xf \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x1 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device pcie-root-port,port=0x6,chassis=9,id=pci.19,bus=pci.2,addr=0x2 \
-device virtio-net-pci,bus=pci.19,addr=0x0
root@ubuntu:~# lspci -t
-+-[0000:44]-+-01.0-[45]----00.0
| \-02.0-[46]----00.0
\-[0000:00]-+-00.0
+-01.0
+-02.0-[01]----00.0
+-03.0
+-0f.0
+-1f.0
+-1f.2
\-1f.3
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86386sec preferred_lft 86386sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86388sec preferred_lft 14388sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
5: enp70s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
root@ubuntu:~# lspci -tvv
-+-[0000:44]-+-01.0-[45]----00.0 Red Hat, Inc. Virtio network device
| \-02.0-[46]----00.0 Red Hat, Inc. Virtio network device
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-01.0 Red Hat, Inc. Virtio network device
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0xf \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x1 \
-device virtio-net-pci,bus=pci.11,addr=0x7 \
-device pcie-root-port,port=0x6,chassis=9,id=pci.19,bus=pci.2,addr=0x2 \
-device virtio-net-pci,bus=pci.19,addr=0x7
root@ubuntu:~# lspci -tvv
-+-[0000:44]-+-01.0-[45]--
| \-02.0-[46]--
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-01.0 Red Hat, Inc. Virtio network device
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86385sec preferred_lft 86385sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86387sec preferred_lft 14387sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x1 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device pcie-root-port,port=0x6,chassis=9,id=pci.19,bus=pci.2,addr=0x2 \
-device virtio-net-pci,bus=pci.19,addr=0x0
root@ubuntu:~# lspci -tv
-+-[0000:44]-+-01.0-[45]----00.0 Red Hat, Inc. Virtio network device
| \-02.0-[46]----00.0 Red Hat, Inc. Virtio network device
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-01.0 Red Hat, Inc. Virtio network device
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86380sec preferred_lft 86380sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86383sec preferred_lft 14383sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
5: enp70s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02 \
-netdev user,id=mynet1,hostfwd=tcp::10023-:22 \
-device virtio-net-pci,netdev=mynet1,mac=02:02:02:02:02:03 \
\
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0xf \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x05 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device pcie-root-port,port=0x6,chassis=9,id=pci.19,bus=pci.2,addr=0x09 \
-device virtio-net-pci,bus=pci.19,addr=0x0
(qemu) info pci
Bus 68, device 5, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 10.
BUS 68.
secondary bus 69.
subordinate bus 69.
IO range [0x8000, 0x8fff]
memory range [0xc0600000, 0xc07fffff]
prefetchable memory range [0x800200000, 0x8002fffff]
BAR0: 32 bit memory at 0xc0881000 [0xc0881fff].
id "pci.11"
Bus 69, device 0, function 0:
Ethernet controller: PCI device 1af4:1041
PCI subsystem 1af4:1100
IRQ 10.
BAR1: 32 bit memory at 0xc0600000 [0xc0600fff].
BAR4: 64 bit prefetchable memory at 0x800200000 [0x800203fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 68, device 9, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 10.
BUS 68.
secondary bus 70.
subordinate bus 70.
IO range [0x7000, 0x7fff]
memory range [0xc0400000, 0xc05fffff]
prefetchable memory range [0x800300000, 0x8003fffff]
BAR0: 32 bit memory at 0xc0880000 [0xc0880fff].
id "pci.19"
Bus 70, device 0, function 0:
Ethernet controller: PCI device 1af4:1041
PCI subsystem 1af4:1100
IRQ 10.
BAR1: 32 bit memory at 0xc0400000 [0xc0400fff].
BAR4: 64 bit prefetchable memory at 0x800300000 [0x800303fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 0, function 0:
Host bridge: PCI device 8086:29c0
PCI subsystem 1af4:1100
id ""
Bus 0, device 1, function 0:
Ethernet controller: PCI device 1af4:1000
PCI subsystem 1af4:0001
IRQ 10.
BAR0: I/O at 0x1040 [0x105f].
BAR1: 32 bit memory at 0xc0283000 [0xc0283fff].
BAR4: 64 bit prefetchable memory at 0x800100000 [0x800103fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 2, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 11.
BUS 0.
secondary bus 1.
subordinate bus 1.
IO range [0x6000, 0x6fff]
memory range [0xc0000000, 0xc01fffff]
prefetchable memory range [0x800000000, 0x8000fffff]
BAR0: 32 bit memory at 0xc0282000 [0xc0282fff].
id "pci.1"
Bus 1, device 0, function 0:
SCSI controller: PCI device 1af4:1042
PCI subsystem 1af4:1100
IRQ 11.
BAR1: 32 bit memory at 0xc0000000 [0xc0000fff].
BAR4: 64 bit prefetchable memory at 0x800000000 [0x800003fff].
id "virtio-disk0"
Bus 0, device 3, function 0:
Ethernet controller: PCI device 1af4:1000
PCI subsystem 1af4:0001
IRQ 11.
BAR0: I/O at 0x1060 [0x107f].
BAR1: 32 bit memory at 0xc0281000 [0xc0281fff].
BAR4: 64 bit prefetchable memory at 0x800104000 [0x800107fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 15, function 0:
Host bridge: PCI device 1b36:000b
PCI subsystem 1af4:1100
id "pci.2"
Bus 0, device 31, function 0:
ISA bridge: PCI device 8086:2918
PCI subsystem 1af4:1100
id ""
Bus 0, device 31, function 2:
SATA controller: PCI device 8086:2922
PCI subsystem 1af4:1100
IRQ 10.
BAR4: I/O at 0x1080 [0x109f].
BAR5: 32 bit memory at 0xc0280000 [0xc0280fff].
id ""
Bus 0, device 31, function 3:
SMBus: PCI device 8086:2930
PCI subsystem 1af4:1100
IRQ 10.
BAR4: I/O at 0x1000 [0x103f].
id ""
(qemu)
(qemu)
ubuntu login: root (automatic login)
Last login: Thu Jan 27 03:17:11 UTC 2022 on ttyS0
root@ubuntu:~# lspci -tv
-+-[0000:44]-+-05.0-[45]----00.0 Red Hat, Inc. Virtio network device
| \-09.0-[46]----00.0 Red Hat, Inc. Virtio network device
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-01.0 Red Hat, Inc. Virtio network device
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86307sec preferred_lft 86307sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86310sec preferred_lft 14310sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
5: enp70s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
DIFF: https://blob.b-cdn.net/Screen-Shot-2022-01-27-04-30-17.77-1643254221.png
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02 \
-netdev user,id=mynet1,hostfwd=tcp::10023-:22 \
-device virtio-net-pci,netdev=mynet1,mac=02:02:02:02:02:03 \
\
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0xf \
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x05 \
-device virtio-net-pci,bus=pci.11,addr=0x0 \
-device virtio-net-pci,bus=pci.11,addr=0x1
(qemu) info pci
Bus 68, device 5, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 10.
BUS 68.
secondary bus 69.
subordinate bus 69.
IO range [0x7000, 0x7fff]
memory range [0xc0400000, 0xc05fffff]
prefetchable memory range [0x800200000, 0x8002fffff]
BAR0: 32 bit memory at 0xc0680000 [0xc0680fff].
id "pci.11"
Bus 69, device 0, function 0:
Ethernet controller: PCI device 1af4:1041
PCI subsystem 1af4:1100
IRQ 10.
BAR1: 32 bit memory at 0xc0401000 [0xc0401fff].
BAR4: 64 bit prefetchable memory at 0x800204000 [0x800207fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 69, device 1, function 0:
Ethernet controller: PCI device 1af4:1041
PCI subsystem 1af4:1100
IRQ 11.
BAR1: 32 bit memory at 0xc0400000 [0xc0400fff].
BAR4: 64 bit prefetchable memory at 0x800200000 [0x800203fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 0, function 0:
Host bridge: PCI device 8086:29c0
PCI subsystem 1af4:1100
id ""
Bus 0, device 1, function 0:
Ethernet controller: PCI device 1af4:1000
PCI subsystem 1af4:0001
IRQ 10.
BAR0: I/O at 0x1040 [0x105f].
BAR1: 32 bit memory at 0xc0283000 [0xc0283fff].
BAR4: 64 bit prefetchable memory at 0x800100000 [0x800103fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 2, function 0:
PCI bridge: PCI device 1b36:000c
IRQ 11.
BUS 0.
secondary bus 1.
subordinate bus 1.
IO range [0x6000, 0x6fff]
memory range [0xc0000000, 0xc01fffff]
prefetchable memory range [0x800000000, 0x8000fffff]
BAR0: 32 bit memory at 0xc0282000 [0xc0282fff].
id "pci.1"
Bus 1, device 0, function 0:
SCSI controller: PCI device 1af4:1042
PCI subsystem 1af4:1100
IRQ 11.
BAR1: 32 bit memory at 0xc0000000 [0xc0000fff].
BAR4: 64 bit prefetchable memory at 0x800000000 [0x800003fff].
id "virtio-disk0"
Bus 0, device 3, function 0:
Ethernet controller: PCI device 1af4:1000
PCI subsystem 1af4:0001
IRQ 11.
BAR0: I/O at 0x1060 [0x107f].
BAR1: 32 bit memory at 0xc0281000 [0xc0281fff].
BAR4: 64 bit prefetchable memory at 0x800104000 [0x800107fff].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0007fffe].
id ""
Bus 0, device 15, function 0:
Host bridge: PCI device 1b36:000b
PCI subsystem 1af4:1100
id "pci.2"
Bus 0, device 31, function 0:
ISA bridge: PCI device 8086:2918
PCI subsystem 1af4:1100
id ""
Bus 0, device 31, function 2:
SATA controller: PCI device 8086:2922
PCI subsystem 1af4:1100
IRQ 10.
BAR4: I/O at 0x1080 [0x109f].
BAR5: 32 bit memory at 0xc0280000 [0xc0280fff].
id ""
Bus 0, device 31, function 3:
SMBus: PCI device 8086:2930
PCI subsystem 1af4:1100
IRQ 10.
BAR4: I/O at 0x1000 [0x103f].
id ""
(qemu)
ubuntu login: root (automatic login)
Last login: Thu Jan 27 03:26:33 UTC 2022 on ttyS0
root@ubuntu:~# lspci -tv
-+-[0000:44]---05.0-[45]----00.0 Red Hat, Inc. Virtio network device
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-01.0 Red Hat, Inc. Virtio network device
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s1
valid_lft 86371sec preferred_lft 86371sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86373sec preferred_lft 14373sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02,bus=pcie.0,addr=0x3 \
-netdev user,id=mynet1,hostfwd=tcp::10023-:22 \
-device virtio-net-pci,netdev=mynet1,mac=02:02:02:02:02:03,bus=pcie.0,addr=0x4 \
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 86384sec preferred_lft 86384sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86386sec preferred_lft 14386sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
root@ubuntu:~# lspci -tv
-+-[0000:44]---05.0-[45]----00.0 Red Hat, Inc. Virtio network device
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-04.0 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller
-device pxb-pcie,bus_nr=68,id=pci.2,bus=pcie.0,addr=0xf,numa_node=1 \
\
-netdev user,id=mynet0,hostfwd=tcp::10022-:22 \
-device virtio-net-pci,netdev=mynet0,mac=02:02:02:02:02:02,bus=pcie.0,addr=0x3 \
-netdev user,id=mynet1,hostfwd=tcp::10023-:22 \
-device virtio-net-pci,netdev=mynet1,mac=02:02:02:02:02:03,bus=pcie.0,addr=0x4 \
\
-device pcie-root-port,port=0x5,chassis=5,id=pci.11,bus=pci.2,addr=0x05 \
-device virtio-net-pci,bus=pci.11,addr=0x0
root@ubuntu:~# lspci -tv
-+-[0000:44]---05.0-[45]----00.0 Red Hat, Inc. Virtio network device
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-04.0 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 86127sec preferred_lft 86127sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86130sec preferred_lft 14130sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp69s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
lstopo
Machine (31GB total)
Package L#0
NUMANode L#0 (P#0 16GB)
L3 L#0 (16MB)
L2 L#0 (512KB) + L1d L#0 (64KB) + L1i L#0 (64KB) + Core L#0 + PU L#0 (P#0)
L2 L#1 (512KB) + L1d L#1 (64KB) + L1i L#1 (64KB) + Core L#1 + PU L#1 (P#1)
Package L#1
NUMANode L#1 (P#1 16GB)
L3 L#1 (16MB)
L2 L#2 (512KB) + L1d L#2 (64KB) + L1i L#2 (64KB) + Core L#2 + PU L#2 (P#2)
L2 L#3 (512KB) + L1d L#3 (64KB) + L1i L#3 (64KB) + Core L#3 + PU L#3 (P#3)
HostBridge
PCIBridge
PCI 45:00.0 (Ethernet)
Net "enp69s0"
HostBridge
PCIBridge
PCI 01:00.0 (SCSI)
Block "vda"
PCI 00:03.0 (Ethernet)
Net "enp0s3"
PCI 00:04.0 (Ethernet)
Net "enp0s4"
PCI 00:1f.2 (SATA)
Block "sr0"
root@ubuntu:~# ip -c a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:02:02:02:02:02 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 86365sec preferred_lft 86365sec
inet6 fec0::2:2ff:fe02:202/64 scope site dynamic mngtmpaddr noprefixroute
valid_lft 86368sec preferred_lft 14368sec
inet6 fe80::2:2ff:fe02:202/64 scope link
valid_lft forever preferred_lft forever
3: enp0s4f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:02:02:02:02:03 brd ff:ff:ff:ff:ff:ff
4: enp0s4f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
5: enp0s4f2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
6: enp0s4f3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:58 brd ff:ff:ff:ff:ff:ff
7: enp0s4f4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:59 brd ff:ff:ff:ff:ff:ff
8: enp0s4f5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:5a brd ff:ff:ff:ff:ff:ff
9: enp0s4f6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:5b brd ff:ff:ff:ff:ff:ff
10: enp0s4f7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:5c brd ff:ff:ff:ff:ff:ff
11: enp69s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:5d brd ff:ff:ff:ff:ff:ff
12: enp69s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:5e brd ff:ff:ff:ff:ff:ff
13: enp69s0f2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:5f brd ff:ff:ff:ff:ff:ff
14: enp69s0f3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:60 brd ff:ff:ff:ff:ff:ff
15: enp69s0f4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:61 brd ff:ff:ff:ff:ff:ff
16: enp69s0f5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:62 brd ff:ff:ff:ff:ff:ff
17: enp69s0f6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:63 brd ff:ff:ff:ff:ff:ff
18: enp69s0f7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 52:54:00:12:34:64 brd ff:ff:ff:ff:ff:ff
root@ubuntu:~# lstopo
Machine (31GB total)
Package L#0
NUMANode L#0 (P#0 16GB)
L3 L#0 (16MB)
L2 L#0 (512KB) + L1d L#0 (64KB) + L1i L#0 (64KB) + Core L#0 + PU L#0 (P#0)
L2 L#1 (512KB) + L1d L#1 (64KB) + L1i L#1 (64KB) + Core L#1 + PU L#1 (P#1)
Package L#1
NUMANode L#1 (P#1 16GB)
L3 L#1 (16MB)
L2 L#2 (512KB) + L1d L#2 (64KB) + L1i L#2 (64KB) + Core L#2 + PU L#2 (P#2)
L2 L#3 (512KB) + L1d L#3 (64KB) + L1i L#3 (64KB) + Core L#3 + PU L#3 (P#3)
HostBridge
PCIBridge
PCI 45:00.0 (Ethernet)
Net "enp69s0f0"
PCI 45:00.1 (Ethernet)
Net "enp69s0f1"
PCI 45:00.2 (Ethernet)
Net "enp69s0f2"
PCI 45:00.3 (Ethernet)
Net "enp69s0f3"
PCI 45:00.4 (Ethernet)
Net "enp69s0f4"
PCI 45:00.5 (Ethernet)
Net "enp69s0f5"
PCI 45:00.6 (Ethernet)
Net "enp69s0f6"
PCI 45:00.7 (Ethernet)
Net "enp69s0f7"
HostBridge
PCIBridge
PCI 01:00.0 (SCSI)
Block "vda"
PCI 00:03.0 (Ethernet)
Net "enp0s3"
PCI 00:04.0 (Ethernet)
Net "enp0s4f0"
PCI 00:04.1 (Ethernet)
Net "enp0s4f1"
PCI 00:04.2 (Ethernet)
Net "enp0s4f2"
PCI 00:04.3 (Ethernet)
Net "enp0s4f3"
PCI 00:04.4 (Ethernet)
Net "enp0s4f4"
PCI 00:04.5 (Ethernet)
Net "enp0s4f5"
PCI 00:04.6 (Ethernet)
Net "enp0s4f6"
PCI 00:04.7 (Ethernet)
Net "enp0s4f7"
PCI 00:1f.2 (SATA)
Block "sr0"
root@ubuntu:~# lspci -tv
-+-[0000:44]---05.0-[45]--+-00.0 Red Hat, Inc. Virtio network device
| +-00.1 Red Hat, Inc. Virtio network device
| +-00.2 Red Hat, Inc. Virtio network device
| +-00.3 Red Hat, Inc. Virtio network device
| +-00.4 Red Hat, Inc. Virtio network device
| +-00.5 Red Hat, Inc. Virtio network device
| +-00.6 Red Hat, Inc. Virtio network device
| \-00.7 Red Hat, Inc. Virtio network device
\-[0000:00]-+-00.0 Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
+-02.0-[01]----00.0 Red Hat, Inc. Virtio block device
+-03.0 Red Hat, Inc. Virtio network device
+-04.0 Red Hat, Inc. Virtio network device
+-04.1 Red Hat, Inc. Virtio network device
+-04.2 Red Hat, Inc. Virtio network device
+-04.3 Red Hat, Inc. Virtio network device
+-04.4 Red Hat, Inc. Virtio network device
+-04.5 Red Hat, Inc. Virtio network device
+-04.6 Red Hat, Inc. Virtio network device
+-04.7 Red Hat, Inc. Virtio network device
+-0f.0 Red Hat, Inc. QEMU PCIe Expander bridge
+-1f.0 Intel Corporation 82801IB (ICH9) LPC Interface Controller
+-1f.2 Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
\-1f.3 Intel Corporation 82801I (ICH9 Family) SMBus Controller