On Fri, Feb 24, 2023 at 08:14:16AM +0100, Stefano Brivio wrote:On Thu, 23 Feb 2023 06:06:17 -0800 Andrea Bolognani <abologna(a)redhat.com> wrote:I strongly disagree with this assessment. This patch merely trades one set of issues for another one. In particular, for pc machine types we'd end up producing bus=pci.0,addr=0x10 for slot 10 instead of bus=pci.0,addr=0xa, because the addr=0x part is baked into the template. So the QEMU logic David mentioned above wouldn't kick in at all. More importantly, for q35 machines we'd start producing decimal bus numbers while still parsing the ones present in the original command line as hexadecimal, so things would stop lining up as soon as enough devices are present, meaning that the issue reported by Alona would still exist.On Thu, Feb 23, 2023 at 09:27:14AM +1100, David Gibson wrote:Andrea, allow me to do this: I would push this patch meanwhile, along with the changes for the DNS issue you reported, because that one might impact many users, and I think it makes sense to have a fix out soon. I start thinking it's also part of the issue Paul reported for Podman with pasta here: https://github.com/containers/podman/issues/17074 This patch itself can't hurt, and it changes exactly two letters.On Wed, Feb 22, 2023 at 02:40:32AM -0800, Andrea Bolognani wrote:Yeah, even if that happens to work I'd rather not rely on it, especially since a proper solution doesn't look like it would be a lot of additional effort. I've managed to reproduce the original issue in the context of KubeVirt. I'll hopefully have a patch ready soon.I don't think this is going to work. The problem is that, while PCI buses are indeed named with increasing numbers in integer format (pci.9, pci.10 and so on), PCI slots are addressed using hexadecimal format (0x9, 0xa and so on). libvirt uses this naming convention because it matches QEMU's.Actually, I think we're ok. PCI slots are addressed in hex by convention, but AFAICT if you *just* give a slot number, it will accept either decimal or hex (so addr=10 and addr=0xa are equivalent). That's *not* true if you use SS.F format to include the function number - then it expects hex only. But we're not doing that, so so always using decimal should be ok here. Source: set_pci_devfn() in the qemu source Obviously that's a pretty fragile hack, but that's 'qrap' for you.As soon as you have something less qrappy we'll go with that (you don't even need to rebase, I'll revert this one on the tree first).Patches fixing this issue, as well as a few additional ones, are now on the list. I'll follow up on that thread with some considerations related to testing the changes. -- Andrea Bolognani / Red Hat / Virtualization