From a45c63b6087d7d3d720594d77e1eedc4cd4096ee Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 00:23:23 +0000 Subject: [PATCH] fix(deps): update patch digest dependencies --- go.mod | 6 +-- go.sum | 6 +++ .../RoaringBitmap/roaring/README.md | 2 +- .../RoaringBitmap/roaring/arraycontainer.go | 52 +++++++++++++++++-- .../RoaringBitmap/roaring/runcontainer.go | 1 + .../go-spdk-helper/pkg/spdk/client/basic.go | 49 +++++++++++++++++ .../go-spdk-helper/pkg/spdk/types/aio.go | 2 +- .../go-spdk-helper/pkg/spdk/types/bdev.go | 10 ++-- .../go-spdk-helper/pkg/spdk/types/nvme.go | 9 ++-- .../go-spdk-helper/pkg/spdk/types/virtio.go | 12 +++++ .../go-spdk-helper/pkg/util/device.go | 2 +- vendor/modules.txt | 6 +-- 12 files changed, 136 insertions(+), 21 deletions(-) create mode 100644 vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/virtio.go diff --git a/go.mod b/go.mod index 8fe8dde14..44c6693ed 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/longhorn/longhorn-instance-manager go 1.21 require ( - github.com/RoaringBitmap/roaring v1.9.0 + github.com/RoaringBitmap/roaring v1.9.1 github.com/google/uuid v1.6.0 github.com/longhorn/backupstore v0.0.0-20240219094812-3a87ee02df77 github.com/longhorn/go-common-libs v0.0.0-20240319112414-b75404dc7fbc - github.com/longhorn/go-spdk-helper v0.0.0-20240319142717-116729b98b89 + github.com/longhorn/go-spdk-helper v0.0.0-20240326185024-d05637da5978 github.com/longhorn/longhorn-engine v1.6.0-dev-20240105.0.20240126141003-067f67803ee8 - github.com/longhorn/longhorn-spdk-engine v0.0.0-20240319114738-c9046e18cf8c + github.com/longhorn/longhorn-spdk-engine v0.0.0-20240326225129-c0ac4cbe90cb github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.3 github.com/urfave/cli v1.22.14 diff --git a/go.sum b/go.sum index 22e6762d3..ba08d5aae 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,8 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/RoaringBitmap/roaring v1.9.0 h1:lwKhr90/j0jVXJyh5X+vQN1VVn77rQFfYnh6RDRGCcE= github.com/RoaringBitmap/roaring v1.9.0/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= +github.com/RoaringBitmap/roaring v1.9.1 h1:LXcSqGGGMKm+KAzUyWn7ZeREqoOkoMX+KwLOK1thc4I= +github.com/RoaringBitmap/roaring v1.9.1/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= github.com/aws/aws-sdk-go v1.46.1 h1:U26quvBWFZMQuultLw5tloW4GnmWaChEwMZNq8uYatw= github.com/aws/aws-sdk-go v1.46.1/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -83,12 +85,16 @@ github.com/longhorn/go-spdk-helper v0.0.0-20240315133419-fd71aaab4a11 h1:qfr6EjG github.com/longhorn/go-spdk-helper v0.0.0-20240315133419-fd71aaab4a11/go.mod h1:ByXr0dR+YNz0H1+k8aBXjSzQ7R2Y2UI6f4+d90YTM/M= github.com/longhorn/go-spdk-helper v0.0.0-20240319142717-116729b98b89 h1:NdWVJURZRFnyLDIpw/Ocx9bsQCdHpBkr0BOuQQCyPtg= github.com/longhorn/go-spdk-helper v0.0.0-20240319142717-116729b98b89/go.mod h1:do6+0y096uk/gW1d5iOKMuebFcf/OiIhyOtIUVamReU= +github.com/longhorn/go-spdk-helper v0.0.0-20240326185024-d05637da5978 h1:SjpYD1tILj/go2wSpHwmHSwFmzoOpIKjQwAtZyFcWik= +github.com/longhorn/go-spdk-helper v0.0.0-20240326185024-d05637da5978/go.mod h1:WGm84AyXymx7L0CqOw8KEr9okywD+Cj5xZi+eKeOoiU= github.com/longhorn/longhorn-engine v1.6.0-dev-20240105.0.20240126141003-067f67803ee8 h1:Oj5bAlKBzS+qPxA8lfpUcbllrVjnHVCuhPcQv/V98xw= github.com/longhorn/longhorn-engine v1.6.0-dev-20240105.0.20240126141003-067f67803ee8/go.mod h1:Snkv3gy4AUOhZSYMI7g7lVX/OOB8DTo28eJwsEfbAwM= github.com/longhorn/longhorn-spdk-engine v0.0.0-20240315010143-da2a02e86462 h1:eVMZH4r+v1NwBbsuxdTmiJD4odWQ0GmuYgS1KN93nss= github.com/longhorn/longhorn-spdk-engine v0.0.0-20240315010143-da2a02e86462/go.mod h1:2gpXwMvzw/wZhsTSPRP453W5mO+TNDqEdPDJv7h8VWo= github.com/longhorn/longhorn-spdk-engine v0.0.0-20240319114738-c9046e18cf8c h1:q1aK/uRlLDQZwDr3ADBsNvFjeb0OwbkppysHajQaogk= github.com/longhorn/longhorn-spdk-engine v0.0.0-20240319114738-c9046e18cf8c/go.mod h1:14Br2xN1itgG0bmg/uHCgVFIb3ccBAa0RAzLn3MP1G0= +github.com/longhorn/longhorn-spdk-engine v0.0.0-20240326225129-c0ac4cbe90cb h1:3n20Ufdz5UXCv7N2WMp0pXAmlpTxk1V3KRDRO8DDCT0= +github.com/longhorn/longhorn-spdk-engine v0.0.0-20240326225129-c0ac4cbe90cb/go.mod h1:XX36oZpuOnXWo/Qjyrd0oXBZdFN4sqz2S68A6pXnNNI= github.com/longhorn/nsfilelock v0.0.0-20200723175406-fa7c83ad0003 h1:Jw9uANsGcHTxp6HcC++/vN17LfeuDmozHI2j6DoZf5E= github.com/longhorn/nsfilelock v0.0.0-20200723175406-fa7c83ad0003/go.mod h1:0CLeXlf59Lg6C0kjLSDf47ft73Dh37CwymYRKWwAn04= github.com/longhorn/sparse-tools v0.0.0-20230408015858-c849def39d3c h1:EAE/cBOWZUL9CDiI4xbOr1IudQUa2e6u/pdScytEcvo= diff --git a/vendor/github.com/RoaringBitmap/roaring/README.md b/vendor/github.com/RoaringBitmap/roaring/README.md index 8c780afd6..acd3058b7 100644 --- a/vendor/github.com/RoaringBitmap/roaring/README.md +++ b/vendor/github.com/RoaringBitmap/roaring/README.md @@ -43,7 +43,7 @@ The ``roaring`` Go library is used by * [M3](https://github.com/m3db/m3) * [trident](https://github.com/NetApp/trident) * [Husky](https://www.datadoghq.com/blog/engineering/introducing-husky/) - +* [FrostDB](https://github.com/polarsignals/frostdb) This library is used in production in several systems, it is part of the [Awesome Go collection](https://awesome-go.com). diff --git a/vendor/github.com/RoaringBitmap/roaring/arraycontainer.go b/vendor/github.com/RoaringBitmap/roaring/arraycontainer.go index a575caff8..80fa676ef 100644 --- a/vendor/github.com/RoaringBitmap/roaring/arraycontainer.go +++ b/vendor/github.com/RoaringBitmap/roaring/arraycontainer.go @@ -664,10 +664,54 @@ func (ac *arrayContainer) iandNot(a container) container { } func (ac *arrayContainer) iandNotRun16(rc *runContainer16) container { - rcb := rc.toBitmapContainer() - acb := ac.toBitmapContainer() - acb.iandNotBitmapSurely(rcb) - *ac = *(acb.toArrayContainer()) + // Fast path: if either the array container or the run container is empty, the result is the array. + if ac.isEmpty() || rc.isEmpty() { + // Empty + return ac + } + // Fast path: if the run container is full, the result is empty. + if rc.isFull() { + ac.content = ac.content[:0] + return ac + } + current_run := 0 + // All values in [start_run, end_end] are part of the run + start_run := rc.iv[current_run].start + end_end := start_run + rc.iv[current_run].length + // We are going to read values in the array at index i, and we are + // going to write them at index pos. So we do in-place processing. + // We always have that pos <= i by construction. So we can either + // overwrite a value just read, or a value that was previous read. + pos := 0 + i := 0 + for ; i < len(ac.content); i++ { + if ac.content[i] < start_run { + // the value in the array appears before the run [start_run, end_end] + ac.content[pos] = ac.content[i] + pos++ + } else if ac.content[i] <= end_end { + // nothing to do, the value is in the array but also in the run. + } else { + // We have the value in the array after the run. We cannot tell + // whether we need to keep it or not. So let us move to another run. + if current_run+1 < len(rc.iv) { + current_run++ + start_run = rc.iv[current_run].start + end_end = start_run + rc.iv[current_run].length + i-- // retry with the same i + } else { + // We have exhausted the number of runs. We can keep the rest of the values + // from i to len(ac.content) - 1 inclusively. + break // We are done, the rest of the array will be kept + } + } + } + for ; i < len(ac.content); i++ { + ac.content[pos] = ac.content[i] + pos++ + } + // We 'shink' the slice. + ac.content = ac.content[:pos] return ac } diff --git a/vendor/github.com/RoaringBitmap/roaring/runcontainer.go b/vendor/github.com/RoaringBitmap/roaring/runcontainer.go index f4829a62d..7098ba28f 100644 --- a/vendor/github.com/RoaringBitmap/roaring/runcontainer.go +++ b/vendor/github.com/RoaringBitmap/roaring/runcontainer.go @@ -47,6 +47,7 @@ import ( // runContainer16 does run-length encoding of sets of // uint16 integers. type runContainer16 struct { + // iv is a slice of sorted, non-overlapping, non-adjacent intervals. iv []interval16 } diff --git a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/client/basic.go b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/client/basic.go index 038162f16..6b4ee9623 100644 --- a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/client/basic.go +++ b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/client/basic.go @@ -4,6 +4,8 @@ import ( "encoding/json" "strings" + "github.com/pkg/errors" + spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types" ) @@ -1045,3 +1047,50 @@ func (c *Client) LogGetPrintLevel() (string, error) { return strings.Trim(string(level), "\"\n"), nil } + +// BdevVirtioAttachController creates new initiator Virtio SCSI or Virtio Block and expose all found bdevs. +// +// "name": Required. Use this name as base for new created bdevs. +// +// "trtype": Required. Transport type, "user" or "pci". +// +// "traddr": Required. Transport type specific target address: e.g. UNIX domain socket path or BDF. +// +// "devType": Required. Device type, "scsi" or "blk". +func (c *Client) BdevVirtioAttachController(name, trtype, traddr, devType string) ([]string, error) { + req := spdktypes.BdevVirtioAttachControllerRequest{ + Name: name, + Trtype: trtype, + Traddr: traddr, + DevType: devType, + } + + cmdOutput, err := c.jsonCli.SendCommand("bdev_virtio_attach_controller", req) + if err != nil { + return nil, err + } + + var disks []string + err = json.Unmarshal([]byte(cmdOutput), &disks) + if err != nil { + return nil, errors.Wrapf(err, "failed to unmarshal disks: %s", cmdOutput) + } + + return disks, nil +} + +// BdevVirtioDetachController removes a Virtio device. +// +// "name": Required. Use this name as base for new created bdevs. +func (c *Client) BdevVirtioDetachController(name string) (deleted bool, err error) { + req := spdktypes.BdevVirtioDetachControllerRequest{ + Name: name, + } + + cmdOutput, err := c.jsonCli.SendCommand("bdev_virtio_detach_controller", req) + if err != nil { + return false, err + } + + return deleted, json.Unmarshal(cmdOutput, &deleted) +} diff --git a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/aio.go b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/aio.go index 015ade311..404e305c2 100644 --- a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/aio.go +++ b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/aio.go @@ -15,7 +15,7 @@ type BdevAioDriverSpecificInfo struct { type BdevAioCreateRequest struct { Name string `json:"name"` Filename string `json:"filename"` - BlockSize uint64 `json:"block_size"` + BlockSize uint64 `json:"block_size,omitzero"` } type BdevAioDeleteRequest struct { diff --git a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/bdev.go b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/bdev.go index 27c40da85..3ae95f72d 100644 --- a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/bdev.go +++ b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/bdev.go @@ -3,10 +3,12 @@ package types type BdevProductName string const ( - BdevProductNameAio = BdevProductName("AIO disk") - BdevProductNameLvol = BdevProductName("Logical Volume") - BdevProductNameRaid = BdevProductName("Raid Volume") - BdevProductNameNvme = BdevProductName("NVMe disk") + BdevProductNameAio = BdevProductName("AIO disk") + BdevProductNameLvol = BdevProductName("Logical Volume") + BdevProductNameRaid = BdevProductName("Raid Volume") + BdevProductNameNvme = BdevProductName("NVMe disk") + BdevProductNameVirtioBlk = BdevProductName("VirtioBlk Disk") + BdevProductNameVirtioScsi = BdevProductName("Virtio SCSI Disk") ) type BdevType string diff --git a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/nvme.go b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/nvme.go index 76afe25df..b7fe46911 100644 --- a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/nvme.go +++ b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/nvme.go @@ -21,10 +21,11 @@ const ( type BdevDriverSpecificNvme []NvmeNamespaceInfo type NvmeNamespaceInfo struct { - CtrlrData NvmeCtrlrData `json:"ctrlr_data"` - NsData NvmeNsData `json:"ns_data"` - Trid NvmeTransportID `json:"trid"` - VS NvmeVendorSpecific `json:"vs"` + PciAddress string `json:"pci_address,omitempty"` + CtrlrData NvmeCtrlrData `json:"ctrlr_data"` + NsData NvmeNsData `json:"ns_data"` + Trid NvmeTransportID `json:"trid"` + VS NvmeVendorSpecific `json:"vs"` } type NvmeCtrlrData struct { diff --git a/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/virtio.go b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/virtio.go new file mode 100644 index 000000000..2d240aac9 --- /dev/null +++ b/vendor/github.com/longhorn/go-spdk-helper/pkg/spdk/types/virtio.go @@ -0,0 +1,12 @@ +package types + +type BdevVirtioAttachControllerRequest struct { + Name string `json:"name"` + Trtype string `json:"trtype"` + Traddr string `json:"traddr"` + DevType string `json:"dev_type"` +} + +type BdevVirtioDetachControllerRequest struct { + Name string `json:"name"` +} diff --git a/vendor/github.com/longhorn/go-spdk-helper/pkg/util/device.go b/vendor/github.com/longhorn/go-spdk-helper/pkg/util/device.go index ae44188f5..45478b7fe 100644 --- a/vendor/github.com/longhorn/go-spdk-helper/pkg/util/device.go +++ b/vendor/github.com/longhorn/go-spdk-helper/pkg/util/device.go @@ -102,7 +102,7 @@ func DetectDevice(path string, executor *commonNs.Executor) (*KernelDevice, erro */ opts := []string{ - "-l", "-n", path, "-o", "NAME,MAJ:MIN", + path, "-n", "-o", "NAME,MAJ:MIN", "--nodeps", } output, err := executor.Execute(nil, lsblkBinary, opts, types.ExecuteTimeout) diff --git a/vendor/modules.txt b/vendor/modules.txt index 1ed5aea53..63110d3f2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -23,7 +23,7 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/uuid ## explicit; go 1.16 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal -# github.com/RoaringBitmap/roaring v1.9.0 +# github.com/RoaringBitmap/roaring v1.9.1 ## explicit; go 1.14 github.com/RoaringBitmap/roaring github.com/RoaringBitmap/roaring/internal @@ -157,7 +157,7 @@ github.com/longhorn/go-common-libs/sync github.com/longhorn/go-common-libs/sys github.com/longhorn/go-common-libs/types github.com/longhorn/go-common-libs/utils -# github.com/longhorn/go-spdk-helper v0.0.0-20240319142717-116729b98b89 +# github.com/longhorn/go-spdk-helper v0.0.0-20240326185024-d05637da5978 ## explicit; go 1.21 github.com/longhorn/go-spdk-helper/pkg/jsonrpc github.com/longhorn/go-spdk-helper/pkg/nvme @@ -178,7 +178,7 @@ github.com/longhorn/longhorn-engine/pkg/types github.com/longhorn/longhorn-engine/pkg/util github.com/longhorn/longhorn-engine/pkg/util/disk github.com/longhorn/longhorn-engine/proto/ptypes -# github.com/longhorn/longhorn-spdk-engine v0.0.0-20240319114738-c9046e18cf8c +# github.com/longhorn/longhorn-spdk-engine v0.0.0-20240326225129-c0ac4cbe90cb ## explicit; go 1.21 github.com/longhorn/longhorn-spdk-engine/pkg/api github.com/longhorn/longhorn-spdk-engine/pkg/client