[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/4] vl: Prioritize realizations of devices
From: |
Peter Xu |
Subject: |
Re: [PATCH 4/4] vl: Prioritize realizations of devices |
Date: |
Mon, 23 Aug 2021 17:31:46 -0400 |
On Mon, Aug 23, 2021 at 05:07:03PM -0400, Eduardo Habkost wrote:
> To give just one example:
>
> $ (echo 'info pci';echo quit;) | qemu-system-x86_64 -device virtio-net-pci
> -device e1000e -monitor stdio | tail -n 20
> Bus 0, device 4, function 0:
> Ethernet controller: PCI device 1af4:1000
> PCI subsystem 1af4:0001
> IRQ 0, pin A
> BAR0: I/O at 0xffffffffffffffff [0x001e].
> BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
> BAR4: 64 bit prefetchable memory at 0xffffffffffffffff [0x00003ffe].
> BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
> id ""
> Bus 0, device 5, function 0:
> Ethernet controller: PCI device 8086:10d3
> PCI subsystem 8086:0000
> IRQ 0, pin A
> BAR0: 32 bit memory at 0xffffffffffffffff [0x0001fffe].
> BAR1: 32 bit memory at 0xffffffffffffffff [0x0001fffe].
> BAR2: I/O at 0xffffffffffffffff [0x001e].
> BAR3: 32 bit memory at 0xffffffffffffffff [0x00003ffe].
> BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
> id ""
> (qemu) quit
> $ (echo 'info pci';echo quit;) | qemu-system-x86_64 -device e1000e -device
> virtio-net-pci -monitor stdio | tail -n 20
> Bus 0, device 4, function 0:
> Ethernet controller: PCI device 8086:10d3
> PCI subsystem 8086:0000
> IRQ 0, pin A
> BAR0: 32 bit memory at 0xffffffffffffffff [0x0001fffe].
> BAR1: 32 bit memory at 0xffffffffffffffff [0x0001fffe].
> BAR2: I/O at 0xffffffffffffffff [0x001e].
> BAR3: 32 bit memory at 0xffffffffffffffff [0x00003ffe].
> BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
> id ""
> Bus 0, device 5, function 0:
> Ethernet controller: PCI device 1af4:1000
> PCI subsystem 1af4:0001
> IRQ 0, pin A
> BAR0: I/O at 0xffffffffffffffff [0x001e].
> BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
> BAR4: 64 bit prefetchable memory at 0xffffffffffffffff [0x00003ffe].
> BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
> id ""
> (qemu) quit
>
>
> If the order of the -device arguments changes, the devices are assigned to
> different PCI slots.
Thanks for the example.
Initially I thought about this and didn't think it an issue (because serious
users will always specify addr=XXX for -device; I thought libvirt always does
that), but I do remember that guest OS could identify its hardware config with
devfn number, so nmcli may mess up its config with before/after this change
indeed..
I can use a custom sort to replace qsort() to guarantee that.
Do you have other examples in mind that I may have overlooked, especially I may
not be able to fix by a custom sort with only moving priority>=1 devices?
Thanks,
--
Peter Xu
- [PATCH 0/4] vl: Prioritize device realizations, Peter Xu, 2021/08/18
- [PATCH 1/4] qdev-monitor: Trace qdev creation, Peter Xu, 2021/08/18
- [PATCH 2/4] qemu-config: Allow in-place sorting of QemuOptsList, Peter Xu, 2021/08/18
- [PATCH 3/4] qdev: Export qdev_get_device_class(), Peter Xu, 2021/08/18
- [PATCH 4/4] vl: Prioritize realizations of devices, Peter Xu, 2021/08/18
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Eduardo Habkost, 2021/08/23
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Eduardo Habkost, 2021/08/23
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Peter Xu, 2021/08/23
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Markus Armbruster, 2021/08/25
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Markus Armbruster, 2021/08/25
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Peter Xu, 2021/08/25
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Peter Xu, 2021/08/25
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Markus Armbruster, 2021/08/26
- Re: [PATCH 4/4] vl: Prioritize realizations of devices, Igor Mammedov, 2021/08/26