diff --git a/go.mod b/go.mod index ddeecb655c..13cf6ac02a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/distribution/distribution v2.8.1+incompatible github.com/google/go-containerregistry v0.20.3 github.com/hashicorp/go-multierror v1.1.1 - github.com/jaypipes/ghw v0.19.1 + github.com/jaypipes/ghw v0.20.0 github.com/joho/godotenv v1.5.1 github.com/mitchellh/mapstructure v1.5.0 github.com/onsi/ginkgo/v2 v2.27.2 diff --git a/go.sum b/go.sum index a304160856..eaf5bb47f1 100644 --- a/go.sum +++ b/go.sum @@ -153,8 +153,8 @@ github.com/itchyny/gojq v0.12.16 h1:yLfgLxhIr/6sJNVmYfQjTIv0jGctu6/DgDoivmxTr7g= github.com/itchyny/gojq v0.12.16/go.mod h1:6abHbdC2uB9ogMS38XsErnfqJ94UlngIJGlRAIj4jTM= github.com/itchyny/timefmt-go v0.1.6 h1:ia3s54iciXDdzWzwaVKXZPbiXzxxnv1SPGFfM/myJ5Q= github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJGxm9/mAERQg= -github.com/jaypipes/ghw v0.19.1 h1:Lhybk6aadgEJqIxeS0h07UOL/EgMGIdxbAy6V8J7RgY= -github.com/jaypipes/ghw v0.19.1/go.mod h1:GPrvwbtPoxYUenr74+nAnWbardIZq600vJDD5HnPsPE= +github.com/jaypipes/ghw v0.20.0 h1:8efvHHtyrj0P4qVZ9KE43iW9tMThKoh6dEOo38f3a4w= +github.com/jaypipes/ghw v0.20.0/go.mod h1:GPrvwbtPoxYUenr74+nAnWbardIZq600vJDD5HnPsPE= github.com/jaypipes/pcidb v1.1.1 h1:QmPhpsbmmnCwZmHeYAATxEaoRuiMAJusKYkUncMC0ro= github.com/jaypipes/pcidb v1.1.1/go.mod h1:x27LT2krrUgjf875KxQXKB0Ha/YXLdZRVmw6hH0G7g8= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= diff --git a/vendor/github.com/jaypipes/ghw/pkg/block/block.go b/vendor/github.com/jaypipes/ghw/pkg/block/block.go index 088060185f..016b5c7de4 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/block/block.go +++ b/vendor/github.com/jaypipes/ghw/pkg/block/block.go @@ -251,7 +251,7 @@ type Disk struct { type Partition struct { // Disk is a pointer to the `Disk` struct that houses this partition. Disk *Disk `json:"-"` - // Name is the system name given to the partition, e.g. "sda1". + // Name is the system given or user given name to the partition, e.g. "sda1". Name string `json:"name"` // Label is the human-readable label given to the partition. On Linux, this // is derived from the `ID_PART_ENTRY_NAME` udev entry. diff --git a/vendor/github.com/jaypipes/ghw/pkg/block/block_windows.go b/vendor/github.com/jaypipes/ghw/pkg/block/block_windows.go index 09f44a3a18..cbb052a853 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/block/block_windows.go +++ b/vendor/github.com/jaypipes/ghw/pkg/block/block_windows.go @@ -85,7 +85,7 @@ type win32LogicalDiskToPartition struct { Dependent *string } -const wqlLogicalDisk = "SELECT Caption, CreationClassName, Description, DeviceID, FileSystem, FreeSpace, Name, Size, SystemName, VolumeSerialNumber FROM Win32_LogicalDisk" +const wqlLogicalDisk = "SELECT Caption, CreationClassName, Description, DeviceID, FileSystem, FreeSpace, Name, Size, SystemName, VolumeName, VolumeSerialNumber FROM Win32_LogicalDisk" type win32LogicalDisk struct { Caption *string @@ -97,6 +97,7 @@ type win32LogicalDisk struct { Name *string Size *uint64 SystemName *string + VolumeName *string VolumeSerialNumber *string } @@ -175,7 +176,7 @@ func (i *Info) load() error { // Appending Partition p := &Partition{ Disk: disk, - Name: strings.TrimSpace(*logicaldisk.Caption), + Name: strings.TrimSpace(*logicaldisk.VolumeName), Label: strings.TrimSpace(*logicaldisk.Caption), SizeBytes: *logicaldisk.Size, MountPoint: *logicaldisk.DeviceID, diff --git a/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go b/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go index 2453597d73..4afdc3f61d 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go +++ b/vendor/github.com/jaypipes/ghw/pkg/pci/pci.go @@ -36,6 +36,9 @@ type Device struct { // architecture is not NUMA. Node *topology.Node `json:"node,omitempty"` Driver string `json:"driver"` + // for IOMMU Groups see also: + // https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-iommu-deep-dive + IOMMUGroup string `json:"iommu_group"` } type devIdent struct { diff --git a/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go b/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go index 0bdf659d07..879df436dd 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/pci/pci_linux.go @@ -95,6 +95,17 @@ func getDeviceNUMANode(ctx *context.Context, pciAddr *pciaddr.Address) *topology } } +func getDeviceIommuGroup(ctx *context.Context, pciAddr *pciaddr.Address) string { + paths := linuxpath.New(ctx) + iommuGroupPath := filepath.Join(paths.SysBusPciDevices, pciAddr.String(), "iommu_group") + + dest, err := os.Readlink(iommuGroupPath) + if err != nil { + return "" + } + return filepath.Base(dest) +} + func getDeviceDriver(ctx *context.Context, pciAddr *pciaddr.Address) string { paths := linuxpath.New(ctx) driverPath := filepath.Join(paths.SysBusPciDevices, pciAddr.String(), "driver") @@ -331,6 +342,7 @@ func (info *Info) GetDevice(address string) *Device { device.Node = getDeviceNUMANode(info.ctx, pciAddr) } device.Driver = getDeviceDriver(info.ctx, pciAddr) + device.IOMMUGroup = getDeviceIommuGroup(info.ctx, pciAddr) return device } diff --git a/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_pci_linux.go b/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_pci_linux.go index e7aa7d265d..0c2c68b395 100644 --- a/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_pci_linux.go +++ b/vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_pci_linux.go @@ -62,6 +62,7 @@ func scanPCIDeviceRoot(root string) (fileSpecs []string, pciRoots []string) { "class", "device", "driver", + "iommu_group", "irq", "local_cpulist", "modalias", diff --git a/vendor/modules.txt b/vendor/modules.txt index fce5a32ca5..645807763b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -252,7 +252,7 @@ github.com/itchyny/gojq # github.com/itchyny/timefmt-go v0.1.6 ## explicit; go 1.20 github.com/itchyny/timefmt-go -# github.com/jaypipes/ghw v0.19.1 +# github.com/jaypipes/ghw v0.20.0 ## explicit; go 1.21 github.com/jaypipes/ghw github.com/jaypipes/ghw/pkg/accelerator