From a3f004af63f3f4fa2a8ec14accaaf2d769adb47a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 03:09:07 +0000 Subject: [PATCH] fix(deps): update github.com/longhorn/longhorn-spdk-engine digest to 20be505 --- go.mod | 2 +- go.sum | 4 +- .../longhorn-spdk-engine/pkg/spdk/backup.go | 16 +++---- .../longhorn-spdk-engine/pkg/spdk/disk.go | 26 +++++------ .../pkg/spdk/disk/aio/aio.go | 4 +- .../pkg/spdk/disk/nvme/nvme.go | 8 ++-- .../pkg/spdk/disk/types.go | 44 +++++++++---------- .../pkg/spdk/disk/virtio-blk/virtio-blk.go | 8 ++-- .../pkg/spdk/disk/virtio-scsi/virtio-scsi.go | 8 ++-- .../longhorn-spdk-engine/pkg/spdk/engine.go | 24 +++++----- .../longhorn-spdk-engine/pkg/spdk/replica.go | 26 +++++------ .../longhorn-spdk-engine/pkg/spdk/restore.go | 8 ++-- .../longhorn-spdk-engine/pkg/spdk/server.go | 6 +-- .../longhorn-spdk-engine/pkg/spdk/util.go | 8 ++-- .../longhorn-spdk-engine/pkg/util/block.go | 6 +-- vendor/modules.txt | 2 +- 16 files changed, 100 insertions(+), 100 deletions(-) diff --git a/go.mod b/go.mod index 7264710f7..9ee286b73 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/longhorn/go-common-libs v0.0.0-20240914083622-928beb30c12e github.com/longhorn/go-spdk-helper v0.0.0-20240914113221-00dca154c1bd github.com/longhorn/longhorn-engine v1.8.0-dev-20240908 - github.com/longhorn/longhorn-spdk-engine v0.0.0-20240914104432-ac00cae1940b + github.com/longhorn/longhorn-spdk-engine v0.0.0-20240920070107-20be505a19b7 github.com/longhorn/types v0.0.0-20240902072916-1bf23d310acb github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index 3e6295b24..47c314c5a 100644 --- a/go.sum +++ b/go.sum @@ -115,8 +115,8 @@ github.com/longhorn/go-spdk-helper v0.0.0-20240914113221-00dca154c1bd h1:+MLsqZQ github.com/longhorn/go-spdk-helper v0.0.0-20240914113221-00dca154c1bd/go.mod h1:1152auLGA688IoxHoC7+Z2xEwQKl1pTr4K3rBsdgUwA= github.com/longhorn/longhorn-engine v1.8.0-dev-20240908 h1:pEUQEGnFyYC2B20W3Ak48RuYYkwLxBmiGHHTYwT3Tp8= github.com/longhorn/longhorn-engine v1.8.0-dev-20240908/go.mod h1:V7Xiua0i9swgX8m69qSbFZyJ0qQaARnaUlkbdM5Vsls= -github.com/longhorn/longhorn-spdk-engine v0.0.0-20240914104432-ac00cae1940b h1:Gu9LnZbg1e2cNbS+r/vTZfMH0gasg0PXhcr1wZqZVY4= -github.com/longhorn/longhorn-spdk-engine v0.0.0-20240914104432-ac00cae1940b/go.mod h1:fhoOMM2pRmLqzlWVZDy3QRRq/83DmduIgcxoZ+AFKTI= +github.com/longhorn/longhorn-spdk-engine v0.0.0-20240920070107-20be505a19b7 h1:FChmXjYrAqh0GoEIn27OU4BlN90G1xDgOxzSUvGJHS0= +github.com/longhorn/longhorn-spdk-engine v0.0.0-20240920070107-20be505a19b7/go.mod h1:fhoOMM2pRmLqzlWVZDy3QRRq/83DmduIgcxoZ+AFKTI= github.com/longhorn/sparse-tools v0.0.0-20240907135423-37af3c64d59d h1:iNrrGcE9TLcaayQgOkdEZDvlzKCWMNhXXJD2d2K4Wyo= github.com/longhorn/sparse-tools v0.0.0-20240907135423-37af3c64d59d/go.mod h1:iUJCZtOKG/9xv2rfrUAYZntFTzP5dZtvy4Kwe6dMcUc= github.com/longhorn/types v0.0.0-20240902072916-1bf23d310acb h1:8CoW5YYn+SC43o5zFR+wscOd3SgF6rQZjrkXOkJfZPM= diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/backup.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/backup.go index 6fd29c80e..c08dfe0ca 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/backup.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/backup.go @@ -13,10 +13,10 @@ import ( "github.com/longhorn/backupstore" btypes "github.com/longhorn/backupstore/types" - commonBitmap "github.com/longhorn/go-common-libs/bitmap" - commonNet "github.com/longhorn/go-common-libs/net" - commonNs "github.com/longhorn/go-common-libs/ns" - commonTypes "github.com/longhorn/go-common-libs/types" + commonbitmap "github.com/longhorn/go-common-libs/bitmap" + commonnet "github.com/longhorn/go-common-libs/net" + commonns "github.com/longhorn/go-common-libs/ns" + commontypes "github.com/longhorn/go-common-libs/types" "github.com/longhorn/go-spdk-helper/pkg/nvme" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" helpertypes "github.com/longhorn/go-spdk-helper/pkg/types" @@ -58,13 +58,13 @@ type Backup struct { controllerName string initiator *nvme.Initiator devFh *os.File - executor *commonNs.Executor + executor *commonns.Executor log logrus.FieldLogger } // NewBackup creates a new backup instance -func NewBackup(spdkClient *spdkclient.Client, backupName, volumeName, snapshotName string, replica *Replica, superiorPortAllocator *commonBitmap.Bitmap) (*Backup, error) { +func NewBackup(spdkClient *spdkclient.Client, backupName, volumeName, snapshotName string, replica *Replica, superiorPortAllocator *commonbitmap.Bitmap) (*Backup, error) { log := logrus.WithFields(logrus.Fields{ "backupName": backupName, "volumeName": volumeName, @@ -73,7 +73,7 @@ func NewBackup(spdkClient *spdkclient.Client, backupName, volumeName, snapshotNa log.Info("Initializing backup") - podIP, err := commonNet.GetIPForPod() + podIP, err := commonnet.GetIPForPod() if err != nil { return nil, err } @@ -83,7 +83,7 @@ func NewBackup(spdkClient *spdkclient.Client, backupName, volumeName, snapshotNa return nil, err } - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return nil, errors.Wrapf(err, "failed to create executor") } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk.go index 9de484afe..32952493a 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk.go @@ -10,7 +10,7 @@ import ( grpcstatus "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" - commonTypes "github.com/longhorn/go-common-libs/types" + commontypes "github.com/longhorn/go-common-libs/types" "github.com/longhorn/go-spdk-helper/pkg/jsonrpc" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types" @@ -55,7 +55,7 @@ func svcDiskCreate(spdkClient *spdkclient.Client, diskName, diskUUID, diskPath, return nil, grpcstatus.Error(grpccodes.InvalidArgument, "disk name and disk path are required") } - exactDiskDriver, err := disk.GetDiskDriver(commonTypes.DiskDriver(diskDriver), diskPath) + exactDiskDriver, err := disk.GetDiskDriver(commontypes.DiskDriver(diskDriver), diskPath) if err != nil { return nil, errors.Wrapf(err, "failed to get disk driver for disk %s", diskName) } @@ -158,7 +158,7 @@ func svcDiskGet(spdkClient *spdkclient.Client, diskName, diskPath, diskDriver st } var targetBdev *spdktypes.BdevInfo - var exactDiskDriver commonTypes.DiskDriver + var exactDiskDriver commontypes.DiskDriver for i, bdev := range bdevs { switch bdev.ProductName { @@ -167,15 +167,15 @@ func svcDiskGet(spdkClient *spdkclient.Client, diskName, diskPath, diskDriver st targetBdev = &bdevs[i] diskPath = util.RemovePrefix(bdev.DriverSpecific.Aio.FileName, hostPrefix) } - exactDiskDriver = commonTypes.DiskDriverAio + exactDiskDriver = commontypes.DiskDriverAio case spdktypes.BdevProductNameVirtioBlk: - exactDiskDriver = commonTypes.DiskDriverVirtioBlk + exactDiskDriver = commontypes.DiskDriverVirtioBlk targetBdev = &bdevs[i] case spdktypes.BdevProductNameVirtioScsi: - exactDiskDriver = commonTypes.DiskDriverVirtioScsi + exactDiskDriver = commontypes.DiskDriverVirtioScsi targetBdev = &bdevs[i] case spdktypes.BdevProductNameNvme: - exactDiskDriver = commonTypes.DiskDriverNvme + exactDiskDriver = commontypes.DiskDriverNvme targetBdev = &bdevs[i] } if targetBdev != nil { @@ -195,7 +195,7 @@ func getDiskPath(path string) string { } func getDiskID(filename string) (string, error) { - executor, err := spdkutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := spdkutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return "", err } @@ -208,7 +208,7 @@ func getDiskID(filename string) (string, error) { return fmt.Sprintf("%d-%d", dev.Major, dev.Minor), nil } -func validateAioDiskCreation(spdkClient *spdkclient.Client, diskPath string, diskDriver commonTypes.DiskDriver) error { +func validateAioDiskCreation(spdkClient *spdkclient.Client, diskPath string, diskDriver commontypes.DiskDriver) error { diskID, err := getDiskID(getDiskPath(diskPath)) if err != nil { return errors.Wrap(err, "failed to get disk device number") @@ -233,7 +233,7 @@ func validateAioDiskCreation(spdkClient *spdkclient.Client, diskPath string, dis return nil } -func addBlockDevice(spdkClient *spdkclient.Client, diskName, diskUUID, originalDiskPath string, diskDriver commonTypes.DiskDriver, blockSize int64) (string, error) { +func addBlockDevice(spdkClient *spdkclient.Client, diskName, diskUUID, originalDiskPath string, diskDriver commontypes.DiskDriver, blockSize int64) (string, error) { log := logrus.WithFields(logrus.Fields{ "diskName": diskName, "diskUUID": diskUUID, @@ -243,7 +243,7 @@ func addBlockDevice(spdkClient *spdkclient.Client, diskName, diskUUID, originalD }) diskPath := originalDiskPath - if diskDriver == commonTypes.DiskDriverAio { + if diskDriver == commontypes.DiskDriverAio { if err := validateAioDiskCreation(spdkClient, diskPath, diskDriver); err != nil { return "", errors.Wrap(err, "failed to validate disk creation") } @@ -316,7 +316,7 @@ func addBlockDevice(spdkClient *spdkclient.Client, diskName, diskUUID, originalD return "", grpcstatus.Error(grpccodes.NotFound, fmt.Sprintf("cannot find lvstore with UUID %v", diskUUID)) } -func lvstoreToDisk(spdkClient *spdkclient.Client, diskPath, lvstoreName, lvstoreUUID string, diskDriver commonTypes.DiskDriver) (*spdkrpc.Disk, error) { +func lvstoreToDisk(spdkClient *spdkclient.Client, diskPath, lvstoreName, lvstoreUUID string, diskDriver commontypes.DiskDriver) (*spdkrpc.Disk, error) { lvstores, err := spdkClient.BdevLvolGetLvstore(lvstoreName, lvstoreUUID) if err != nil { return nil, errors.Wrapf(err, "failed to get lvstore with name %v and UUID %v", lvstoreName, lvstoreUUID) @@ -325,7 +325,7 @@ func lvstoreToDisk(spdkClient *spdkclient.Client, diskPath, lvstoreName, lvstore // A disk does not have a fsid, so we use the device number as the disk ID diskID := diskPath - if diskDriver == commonTypes.DiskDriverAio { + if diskDriver == commontypes.DiskDriverAio { diskID, err = getDiskID(getDiskPath(diskPath)) if err != nil { return nil, errors.Wrapf(err, "failed to get disk ID") diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/aio/aio.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/aio/aio.go index 74c77a0a7..86d3a272c 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/aio/aio.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/aio/aio.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" - commonTypes "github.com/longhorn/go-common-libs/types" + commontypes "github.com/longhorn/go-common-libs/types" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types" spdkutil "github.com/longhorn/go-spdk-helper/pkg/util" @@ -20,7 +20,7 @@ type DiskDriverAio struct { func init() { driver := &DiskDriverAio{} - disk.RegisterDiskDriver(string(commonTypes.DiskDriverAio), driver) + disk.RegisterDiskDriver(string(commontypes.DiskDriverAio), driver) } func (d *DiskDriverAio) DiskCreate(spdkClient *spdkclient.Client, diskName, diskPath string, blockSize uint64) (string, error) { diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/nvme/nvme.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/nvme/nvme.go index 4e82b5472..a2533b9c3 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/nvme/nvme.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/nvme/nvme.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" - commonTypes "github.com/longhorn/go-common-libs/types" + commontypes "github.com/longhorn/go-common-libs/types" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdksetup "github.com/longhorn/go-spdk-helper/pkg/spdk/setup" spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types" @@ -21,12 +21,12 @@ type DiskDriverNvme struct { func init() { driver := &DiskDriverNvme{} - disk.RegisterDiskDriver(string(commonTypes.DiskDriverNvme), driver) + disk.RegisterDiskDriver(string(commontypes.DiskDriverNvme), driver) } func (d *DiskDriverNvme) DiskCreate(spdkClient *spdkclient.Client, diskName, diskPath string, blockSize uint64) (string, error) { // TODO: validate the diskPath - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return "", errors.Wrapf(err, "failed to get the executor for NVMe disk create %v", diskPath) } @@ -58,7 +58,7 @@ func (d *DiskDriverNvme) DiskCreate(spdkClient *spdkclient.Client, diskName, dis } func (d *DiskDriverNvme) DiskDelete(spdkClient *spdkclient.Client, diskName, diskPath string) (deleted bool, err error) { - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return false, errors.Wrapf(err, "failed to get the executor for NVMe disk %v deletion", diskName) } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/types.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/types.go index c13523bbc..ae27e4f51 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/types.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/types.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" - commonTypes "github.com/longhorn/go-common-libs/types" + commontypes "github.com/longhorn/go-common-libs/types" spdksetup "github.com/longhorn/go-spdk-helper/pkg/spdk/setup" helpertypes "github.com/longhorn/go-spdk-helper/pkg/types" helperutil "github.com/longhorn/go-spdk-helper/pkg/util" @@ -31,7 +31,7 @@ const ( BlockDiskTypeLoop = BlockDiskType("loop") ) -func GetDiskDriver(diskDriver commonTypes.DiskDriver, diskPathOrBdf string) (commonTypes.DiskDriver, error) { +func GetDiskDriver(diskDriver commontypes.DiskDriver, diskPathOrBdf string) (commontypes.DiskDriver, error) { if isBDF(diskPathOrBdf) { return getDiskDriverForBDF(diskDriver, diskPathOrBdf) } @@ -39,8 +39,8 @@ func GetDiskDriver(diskDriver commonTypes.DiskDriver, diskPathOrBdf string) (com return getDiskDriverForPath(diskDriver, diskPathOrBdf) } -func getDiskDriverForBDF(diskDriver commonTypes.DiskDriver, bdf string) (commonTypes.DiskDriver, error) { - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) +func getDiskDriverForBDF(diskDriver commontypes.DiskDriver, bdf string) (commontypes.DiskDriver, error) { + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return "", errors.Wrapf(err, "failed to get the executor for disk driver detection") } @@ -51,10 +51,10 @@ func getDiskDriverForBDF(diskDriver commonTypes.DiskDriver, bdf string) (commonT } switch diskDriver { - case commonTypes.DiskDriverAuto: + case commontypes.DiskDriverAuto: diskPath := "" - if diskStatus.Driver != string(commonTypes.DiskDriverVfioPci) && - diskStatus.Driver != string(commonTypes.DiskDriverUioPciGeneric) { + if diskStatus.Driver != string(commontypes.DiskDriverVfioPci) && + diskStatus.Driver != string(commontypes.DiskDriverUioPciGeneric) { devName, err := util.GetDevNameFromBDF(bdf) if err != nil { return "", errors.Wrapf(err, "failed to get device name from BDF %s", bdf) @@ -62,14 +62,14 @@ func getDiskDriverForBDF(diskDriver commonTypes.DiskDriver, bdf string) (commonT diskPath = fmt.Sprintf("/dev/%s", devName) } return getDriverForAuto(diskStatus, diskPath) - case commonTypes.DiskDriverAio, commonTypes.DiskDriverNvme, commonTypes.DiskDriverVirtioScsi, commonTypes.DiskDriverVirtioBlk: + case commontypes.DiskDriverAio, commontypes.DiskDriverNvme, commontypes.DiskDriverVirtioScsi, commontypes.DiskDriverVirtioBlk: return diskDriver, nil default: - return commonTypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for BDF %s", diskDriver, bdf) + return commontypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for BDF %s", diskDriver, bdf) } } -func getDriverForAuto(diskStatus *helpertypes.DiskStatus, diskPath string) (commonTypes.DiskDriver, error) { +func getDriverForAuto(diskStatus *helpertypes.DiskStatus, diskPath string) (commontypes.DiskDriver, error) { // SPDK supports various types of disks, including NVMe, virtio-blk, and virtio-scsi. // // NVMe disks can be managed by either NVMe bdev or AIO bdev. @@ -80,34 +80,34 @@ func getDriverForAuto(diskStatus *helpertypes.DiskStatus, diskPath string) (comm // - If a block device uses the subsystems virtio and pci, it's a virtio-blk disk. // - If it uses the subsystems virtio, pci, and scsi, it's a virtio-scsi disk. switch diskStatus.Driver { - case string(commonTypes.DiskDriverNvme): - return commonTypes.DiskDriverNvme, nil - case string(commonTypes.DiskDriverVirtioPci): + case string(commontypes.DiskDriverNvme): + return commontypes.DiskDriverNvme, nil + case string(commontypes.DiskDriverVirtioPci): blockdevice, err := util.GetBlockDevice(diskPath) if err != nil { - return commonTypes.DiskDriverNone, errors.Wrapf(err, "failed to get blockdevice info for %s", diskPath) + return commontypes.DiskDriverNone, errors.Wrapf(err, "failed to get blockdevice info for %s", diskPath) } if slices.Contains(blockdevice.Subsystems, string(BlockDiskSubsystemVirtio)) && slices.Contains(blockdevice.Subsystems, string(BlockDiskSubsystemPci)) { - diskDriver := commonTypes.DiskDriverVirtioBlk + diskDriver := commontypes.DiskDriverVirtioBlk if slices.Contains(blockdevice.Subsystems, string(BlockDiskSubsystemScsi)) { - diskDriver = commonTypes.DiskDriverVirtioScsi + diskDriver = commontypes.DiskDriverVirtioScsi } return diskDriver, nil } - return commonTypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for disk path %s", diskStatus.Driver, diskPath) + return commontypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for disk path %s", diskStatus.Driver, diskPath) default: - return commonTypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for disk path %s", diskStatus.Driver, diskPath) + return commontypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for disk path %s", diskStatus.Driver, diskPath) } } -func getDiskDriverForPath(diskDriver commonTypes.DiskDriver, diskPath string) (commonTypes.DiskDriver, error) { +func getDiskDriverForPath(diskDriver commontypes.DiskDriver, diskPath string) (commontypes.DiskDriver, error) { switch diskDriver { - case commonTypes.DiskDriverAuto, commonTypes.DiskDriverAio: - return commonTypes.DiskDriverAio, nil + case commontypes.DiskDriverAuto, commontypes.DiskDriverAio: + return commontypes.DiskDriverAio, nil default: - return commonTypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for disk path %s", diskDriver, diskPath) + return commontypes.DiskDriverNone, fmt.Errorf("unsupported disk driver %s for disk path %s", diskDriver, diskPath) } } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-blk/virtio-blk.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-blk/virtio-blk.go index 24e43453a..47743bab5 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-blk/virtio-blk.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-blk/virtio-blk.go @@ -4,7 +4,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" - commonTypes "github.com/longhorn/go-common-libs/types" + commontypes "github.com/longhorn/go-common-libs/types" "github.com/longhorn/go-spdk-helper/pkg/jsonrpc" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdksetup "github.com/longhorn/go-spdk-helper/pkg/spdk/setup" @@ -19,12 +19,12 @@ type DiskDriverVirtioBlk struct { func init() { driver := &DiskDriverVirtioBlk{} - disk.RegisterDiskDriver(string(commonTypes.DiskDriverVirtioBlk), driver) + disk.RegisterDiskDriver(string(commontypes.DiskDriverVirtioBlk), driver) } func (d *DiskDriverVirtioBlk) DiskCreate(spdkClient *spdkclient.Client, diskName, diskPath string, blockSize uint64) (string, error) { // TODO: validate the diskPath - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return "", errors.Wrapf(err, "failed to get the executor for virtio-blk disk create %v", diskPath) } @@ -55,7 +55,7 @@ func (d *DiskDriverVirtioBlk) DiskCreate(spdkClient *spdkclient.Client, diskName } func (d *DiskDriverVirtioBlk) DiskDelete(spdkClient *spdkclient.Client, diskName, diskPath string) (deleted bool, err error) { - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return false, errors.Wrapf(err, "failed to get the executor for virtio-blk disk %v deletion", diskName) } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-scsi/virtio-scsi.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-scsi/virtio-scsi.go index 828a57d61..47ef5764e 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-scsi/virtio-scsi.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/disk/virtio-scsi/virtio-scsi.go @@ -4,7 +4,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" - commonTypes "github.com/longhorn/go-common-libs/types" + commontypes "github.com/longhorn/go-common-libs/types" "github.com/longhorn/go-spdk-helper/pkg/jsonrpc" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdksetup "github.com/longhorn/go-spdk-helper/pkg/spdk/setup" @@ -19,12 +19,12 @@ type DiskDriverVirtioScsi struct { func init() { driver := &DiskDriverVirtioScsi{} - disk.RegisterDiskDriver(string(commonTypes.DiskDriverVirtioScsi), driver) + disk.RegisterDiskDriver(string(commontypes.DiskDriverVirtioScsi), driver) } func (d *DiskDriverVirtioScsi) DiskCreate(spdkClient *spdkclient.Client, diskName, diskPath string, blockSize uint64) (string, error) { // TODO: validate the diskPath - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return "", errors.Wrapf(err, "failed to get the executor for virtio-scsi disk create %v", diskPath) } @@ -55,7 +55,7 @@ func (d *DiskDriverVirtioScsi) DiskCreate(spdkClient *spdkclient.Client, diskNam } func (d *DiskDriverVirtioScsi) DiskDelete(spdkClient *spdkclient.Client, diskName, diskPath string) (deleted bool, err error) { - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return false, errors.Wrapf(err, "failed to get the executor for virtio-scsi disk %v deletion", diskName) } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/engine.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/engine.go index 761d66d2b..0b16d5567 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/engine.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/engine.go @@ -13,10 +13,10 @@ import ( grpccodes "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" - commonBitmap "github.com/longhorn/go-common-libs/bitmap" - commonNet "github.com/longhorn/go-common-libs/net" - commonTypes "github.com/longhorn/go-common-libs/types" - commonUtils "github.com/longhorn/go-common-libs/utils" + commonbitmap "github.com/longhorn/go-common-libs/bitmap" + commonnet "github.com/longhorn/go-common-libs/net" + commontypes "github.com/longhorn/go-common-libs/types" + commonutils "github.com/longhorn/go-common-libs/utils" "github.com/longhorn/go-spdk-helper/pkg/jsonrpc" "github.com/longhorn/go-spdk-helper/pkg/nvme" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" @@ -102,7 +102,7 @@ func NewEngine(engineName, volumeName, frontend string, specSize uint64, engineU } } -func (e *Engine) Create(spdkClient *spdkclient.Client, replicaAddressMap map[string]string, portCount int32, superiorPortAllocator *commonBitmap.Bitmap, initiatorAddress, targetAddress string, upgradeRequired bool) (ret *spdkrpc.Engine, err error) { +func (e *Engine) Create(spdkClient *spdkclient.Client, replicaAddressMap map[string]string, portCount int32, superiorPortAllocator *commonbitmap.Bitmap, initiatorAddress, targetAddress string, upgradeRequired bool) (ret *spdkrpc.Engine, err error) { logrus.WithFields(logrus.Fields{ "portCount": portCount, "upgradeRequired": upgradeRequired, @@ -122,7 +122,7 @@ func (e *Engine) Create(spdkClient *spdkclient.Client, replicaAddressMap map[str } }() - podIP, err := commonNet.GetIPForPod() + podIP, err := commonnet.GetIPForPod() if err != nil { return nil, err } @@ -271,7 +271,7 @@ func (e *Engine) Create(spdkClient *spdkclient.Client, replicaAddressMap map[str return e.getWithoutLock(), nil } -func (e *Engine) handleFrontend(spdkClient *spdkclient.Client, portCount int32, superiorPortAllocator *commonBitmap.Bitmap, initiatorCreationRequired, upgradeRequired bool, initiatorAddress, targetAddress string) (err error) { +func (e *Engine) handleFrontend(spdkClient *spdkclient.Client, portCount int32, superiorPortAllocator *commonbitmap.Bitmap, initiatorCreationRequired, upgradeRequired bool, initiatorAddress, targetAddress string) (err error) { if !types.IsFrontendSupported(e.Frontend) { return fmt.Errorf("unknown frontend type %s", e.Frontend) } @@ -295,7 +295,7 @@ func (e *Engine) handleFrontend(spdkClient *spdkclient.Client, portCount int32, var port int32 if !upgradeRequired { - e.Nguid = commonUtils.RandomID(nvmeNguidLength) + e.Nguid = commonutils.RandomID(nvmeNguidLength) e.log.Info("Blindly stopping expose bdev for engine") if err := spdkClient.StopExposeBdev(e.Nqn); err != nil { @@ -375,7 +375,7 @@ func (e *Engine) handleFrontend(spdkClient *spdkclient.Client, portCount int32, return nil } -func (e *Engine) Delete(spdkClient *spdkclient.Client, superiorPortAllocator *commonBitmap.Bitmap) (err error) { +func (e *Engine) Delete(spdkClient *spdkclient.Client, superiorPortAllocator *commonbitmap.Bitmap) (err error) { e.log.Info("Deleting engine") requireUpdate := false @@ -546,7 +546,7 @@ func (e *Engine) ValidateAndUpdate(spdkClient *spdkclient.Client) (err error) { } }() - podIP, err := commonNet.GetIPForPod() + podIP, err := commonnet.GetIPForPod() if err != nil { return err } @@ -1379,7 +1379,7 @@ func (e *Engine) snapshotOperation(spdkClient *spdkclient.Client, inputSnapshotN } e.RUnlock() if devicePath != "" { - ne, err := helperutil.NewExecutor(commonTypes.HostProcDirectory) + ne, err := helperutil.NewExecutor(commontypes.HostProcDirectory) if err != nil { e.log.WithError(err).Errorf("WARNING: failed to get the executor for snapshot op %v with snapshot %s, will skip the sync and continue", snapshotOp, inputSnapshotName) } else { @@ -2225,7 +2225,7 @@ func (e *Engine) connectTarget(targetAddress string) error { } // DeleteTarget deletes the target -func (e *Engine) DeleteTarget(spdkClient *spdkclient.Client, superiorPortAllocator *commonBitmap.Bitmap) (err error) { +func (e *Engine) DeleteTarget(spdkClient *spdkclient.Client, superiorPortAllocator *commonbitmap.Bitmap) (err error) { e.log.Infof("Deleting target") if err := spdkClient.StopExposeBdev(e.Nqn); err != nil { diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/replica.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/replica.go index 72344b4e1..8fbc04639 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/replica.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/replica.go @@ -17,9 +17,9 @@ import ( "github.com/longhorn/backupstore" btypes "github.com/longhorn/backupstore/types" butil "github.com/longhorn/backupstore/util" - commonBitmap "github.com/longhorn/go-common-libs/bitmap" - commonNet "github.com/longhorn/go-common-libs/net" - commonUtils "github.com/longhorn/go-common-libs/utils" + commonbitmap "github.com/longhorn/go-common-libs/bitmap" + commonnet "github.com/longhorn/go-common-libs/net" + commonutils "github.com/longhorn/go-common-libs/utils" "github.com/longhorn/go-spdk-helper/pkg/jsonrpc" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types" @@ -76,7 +76,7 @@ type Replica struct { isRestoring bool restore *Restore - portAllocator *commonBitmap.Bitmap + portAllocator *commonbitmap.Bitmap // UpdateCh should not be protected by the replica lock UpdateCh chan interface{} @@ -562,7 +562,7 @@ func constructActiveChainFromSnapshotLvolMap(replicaName string, snapshotLvolMap } // Create initiates the replica, prepares the head lvol bdev then blindly exposes it for the replica. -func (r *Replica) Create(spdkClient *spdkclient.Client, portCount int32, superiorPortAllocator *commonBitmap.Bitmap) (ret *spdkrpc.Replica, err error) { +func (r *Replica) Create(spdkClient *spdkclient.Client, portCount int32, superiorPortAllocator *commonbitmap.Bitmap) (ret *spdkrpc.Replica, err error) { updateRequired := true r.Lock() @@ -646,7 +646,7 @@ func (r *Replica) Create(spdkClient *spdkclient.Client, portCount int32, superio r.State = types.InstanceStateStopped } - podIP, err := commonNet.GetIPForPod() + podIP, err := commonnet.GetIPForPod() if err != nil { return nil, err } @@ -657,13 +657,13 @@ func (r *Replica) Create(spdkClient *spdkclient.Client, portCount int32, superio return nil, err } // Always reserved the 1st port for replica expose and the rest for rebuilding - bitmap, err := commonBitmap.NewBitmap(r.PortStart+1, r.PortEnd) + bitmap, err := commonbitmap.NewBitmap(r.PortStart+1, r.PortEnd) if err != nil { return nil, err } r.portAllocator = bitmap - nguid := commonUtils.RandomID(nvmeNguidLength) + nguid := commonutils.RandomID(nvmeNguidLength) if err := spdkClient.StartExposeBdev(helpertypes.GetNQN(r.Name), headSvcLvol.UUID, nguid, podIP, strconv.Itoa(int(r.PortStart))); err != nil { return nil, err } @@ -675,7 +675,7 @@ func (r *Replica) Create(spdkClient *spdkclient.Client, portCount int32, superio return ServiceReplicaToProtoReplica(r), nil } -func (r *Replica) Delete(spdkClient *spdkclient.Client, cleanupRequired bool, superiorPortAllocator *commonBitmap.Bitmap) (err error) { +func (r *Replica) Delete(spdkClient *spdkclient.Client, cleanupRequired bool, superiorPortAllocator *commonbitmap.Bitmap) (err error) { updateRequired := false r.Lock() @@ -1060,7 +1060,7 @@ func (r *Replica) SnapshotRevert(spdkClient *spdkclient.Client, snapshotName str } r.IsExposed = false - nguid := commonUtils.RandomID(nvmeNguidLength) + nguid := commonutils.RandomID(nvmeNguidLength) if err := spdkClient.StartExposeBdev(helpertypes.GetNQN(r.Name), headLvolUUID, nguid, r.IP, strconv.Itoa(int(r.PortStart))); err != nil { return nil, err } @@ -1173,7 +1173,7 @@ func (r *Replica) RebuildingSrcStart(spdkClient *spdkclient.Client, dstReplicaNa if err != nil { return "", err } - nguid := commonUtils.RandomID(nvmeNguidLength) + nguid := commonutils.RandomID(nvmeNguidLength) if err := spdkClient.StartExposeBdev(helpertypes.GetNQN(snapLvol.Name), snapLvol.UUID, nguid, r.IP, strconv.Itoa(int(port))); err != nil { return "", err } @@ -1395,7 +1395,7 @@ func (r *Replica) RebuildingDstStart(spdkClient *spdkclient.Client, srcReplicaNa headSvcLvol := BdevLvolInfoToServiceLvol(&bdevLvolList[0]) r.ActiveChain[1] = headSvcLvol - nguid := commonUtils.RandomID(nvmeNguidLength) + nguid := commonutils.RandomID(nvmeNguidLength) if err := spdkClient.StartExposeBdev(helpertypes.GetNQN(r.Name), headSvcLvol.UUID, nguid, r.IP, strconv.Itoa(int(r.PortStart))); err != nil { return "", err } @@ -1860,7 +1860,7 @@ func (r *Replica) RebuildingDstSnapshotRevert(spdkClient *spdkclient.Client, sna dstRebuildingLvolAddress = r.rebuildingDstCache.rebuildingLvol.Alias if r.rebuildingDstCache.rebuildingPort != 0 { - nguid := commonUtils.RandomID(nvmeNguidLength) + nguid := commonutils.RandomID(nvmeNguidLength) if err := spdkClient.StartExposeBdev(helpertypes.GetNQN(r.rebuildingDstCache.rebuildingLvol.Name), r.rebuildingDstCache.rebuildingLvol.UUID, nguid, r.IP, strconv.Itoa(int(r.rebuildingDstCache.rebuildingPort))); err != nil { return "", err } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/restore.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/restore.go index 437208fc5..c2bc8abbd 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/restore.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/restore.go @@ -11,8 +11,8 @@ import ( "github.com/sirupsen/logrus" btypes "github.com/longhorn/backupstore/types" - commonNs "github.com/longhorn/go-common-libs/ns" - commonTypes "github.com/longhorn/go-common-libs/types" + commonns "github.com/longhorn/go-common-libs/ns" + commontypes "github.com/longhorn/go-common-libs/types" "github.com/longhorn/go-spdk-helper/pkg/nvme" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" helpertypes "github.com/longhorn/go-spdk-helper/pkg/types" @@ -39,7 +39,7 @@ type Restore struct { ip string port int32 - executor *commonNs.Executor + executor *commonns.Executor subsystemNQN string controllerName string initiator *nvme.Initiator @@ -58,7 +58,7 @@ func NewRestore(spdkClient *spdkclient.Client, lvolName, snapshotName, backupUrl "backupName": backupName, }) - executor, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + executor, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return nil, errors.Wrapf(err, "failed to create executor") } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/server.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/server.go index 13e185fa2..cae628351 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/server.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/server.go @@ -16,7 +16,7 @@ import ( "github.com/longhorn/backupstore" butil "github.com/longhorn/backupstore/util" - commonBitmap "github.com/longhorn/go-common-libs/bitmap" + commonbitmap "github.com/longhorn/go-common-libs/bitmap" "github.com/longhorn/go-spdk-helper/pkg/jsonrpc" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types" @@ -40,7 +40,7 @@ type Server struct { ctx context.Context spdkClient *spdkclient.Client - portAllocator *commonBitmap.Bitmap + portAllocator *commonbitmap.Bitmap replicaMap map[string]*Replica engineMap map[string]*Engine @@ -58,7 +58,7 @@ func NewServer(ctx context.Context, portStart, portEnd int32) (*Server, error) { return nil, err } - bitmap, err := commonBitmap.NewBitmap(portStart, portEnd) + bitmap, err := commonbitmap.NewBitmap(portStart, portEnd) if err != nil { return nil, err } diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/util.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/util.go index 8395ff870..0aabbe004 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/util.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/util.go @@ -14,14 +14,14 @@ import ( "github.com/longhorn/go-spdk-helper/pkg/nvme" helperutil "github.com/longhorn/go-spdk-helper/pkg/util" - commonNs "github.com/longhorn/go-common-libs/ns" - commonUtils "github.com/longhorn/go-common-libs/utils" + commonns "github.com/longhorn/go-common-libs/ns" + commonutils "github.com/longhorn/go-common-libs/utils" spdkclient "github.com/longhorn/go-spdk-helper/pkg/spdk/client" spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types" helpertypes "github.com/longhorn/go-spdk-helper/pkg/types" ) -func exposeSnapshotLvolBdev(spdkClient *spdkclient.Client, lvsName, lvolName, ip string, port int32, executor *commonNs.Executor) (subsystemNQN, controllerName string, err error) { +func exposeSnapshotLvolBdev(spdkClient *spdkclient.Client, lvsName, lvolName, ip string, port int32, executor *commonns.Executor) (subsystemNQN, controllerName string, err error) { bdevLvolList, err := spdkClient.BdevLvolGet(spdktypes.GetLvolAlias(lvsName, lvolName), 0) if err != nil { return "", "", err @@ -31,7 +31,7 @@ func exposeSnapshotLvolBdev(spdkClient *spdkclient.Client, lvsName, lvolName, ip } portStr := strconv.Itoa(int(port)) - nguid := commonUtils.RandomID(nvmeNguidLength) + nguid := commonutils.RandomID(nvmeNguidLength) err = spdkClient.StartExposeBdev(helpertypes.GetNQN(lvolName), bdevLvolList[0].UUID, nguid, ip, portStr) if err != nil { return "", "", errors.Wrapf(err, "failed to expose snapshot lvol bdev %v", lvolName) diff --git a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/util/block.go b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/util/block.go index 49a3874d7..d7a26a1cb 100644 --- a/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/util/block.go +++ b/vendor/github.com/longhorn/longhorn-spdk-engine/pkg/util/block.go @@ -10,13 +10,13 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" - commonTypes "github.com/longhorn/go-common-libs/types" + commontypes "github.com/longhorn/go-common-libs/types" "github.com/longhorn/go-spdk-helper/pkg/types" helperutil "github.com/longhorn/go-spdk-helper/pkg/util" ) func GetDevNameFromBDF(bdf string) (string, error) { - ne, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + ne, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return "", errors.Wrap(err, "failed to create executor") } @@ -61,7 +61,7 @@ type BlockDevices struct { } func GetBlockDevice(devPath string) (BlockDevice, error) { - ne, err := helperutil.NewExecutor(commonTypes.ProcDirectory) + ne, err := helperutil.NewExecutor(commontypes.ProcDirectory) if err != nil { return BlockDevice{}, errors.Wrap(err, "failed to create executor") } diff --git a/vendor/modules.txt b/vendor/modules.txt index 5a75e2650..7fe122f1e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -267,7 +267,7 @@ github.com/longhorn/longhorn-engine/pkg/sync 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-spdk-engine v0.0.0-20240914104432-ac00cae1940b +# github.com/longhorn/longhorn-spdk-engine v0.0.0-20240920070107-20be505a19b7 ## explicit; go 1.22.0 github.com/longhorn/longhorn-spdk-engine/pkg/api github.com/longhorn/longhorn-spdk-engine/pkg/client