Skip to content

pci: add parent device address - #431

Merged
jaypipes merged 3 commits into
jaypipes:mainfrom
christoph-zededa:pci_parent
Dec 1, 2025
Merged

jaypipes merged 3 commits into
jaypipes:mainfrom
christoph-zededa:pci_parent

Conversation

@christoph-zededa

Copy link
Copy Markdown
Contributor

the parent device address is important, too (like IOMMU group), when using pci-passthrough as the both devices should be passed through together

Comment thread pkg/pci/pci.go
ID: d.ProgrammingInterface.ID,
Name: d.ProgrammingInterface.Name,
},
IOMMUGroup: d.IOMMUGroup,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot add this in #430 so I am trying to sneakily add it here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this into a separate commit

@christoph-zededa
christoph-zededa force-pushed the pci_parent branch 2 times, most recently from f809ed8 to f931ac1 Compare November 3, 2025 15:41
@christoph-zededa
christoph-zededa marked this pull request as ready for review November 3, 2025 15:41

@ffromani ffromani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine adding the parent address. Quick review, I'm probably overly cautious over backward compatibility

Comment thread pkg/pci/pci.go
Comment on lines +25 to +26
// The PCI address of the parent device
ParentAddress string `json:"parent_address"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm contemplating if we should add this at the end of the struct for abundant (excessive?) backward compatibility concerns. But OTOH we mostly (99%) serialize back/from YAML/JSON and clients just recompile, so it's probably OK

Comment thread pkg/pci/pci_linux.go Outdated
Comment on lines +120 to +124
if pciaddr.FromString(parentAddr) != nil {
return parentAddr
}

return ""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I prefer to keep the happy path on the left:

if pciaddr.FromString(parentAddr) == nil {
    return ""
}
return parentAddr

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay; I fixed it.

the parent device address is important, too (like IOMMU group),
when using pci-passthrough as the both devices should be passed
through together

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
Signed-off-by: Christoph Ostarek <christoph@zededa.com>

@jaypipes jaypipes left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks good to me, thank you @christoph-zededa :)

@jaypipes
jaypipes merged commit c5ac778 into jaypipes:main Dec 1, 2025

@europaul europaul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants