Skip to content

Commit fd2e6ae

Browse files
mayastor-borstiagolobocastro
andcommitted
Merge #1852
1852: Cherry-pick PR 1851 to release/2.8 r=tiagolobocastro a=tiagolobocastro Removes the [ ] from the ip address for nvmx. Sets the correct address family. todo: probably we should refactor the builders to use proper types rather than just strings... Co-authored-by: Tiago Castro <[email protected]>
2 parents 356b30a + 3f44bea commit fd2e6ae

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

.github/workflows/bdd.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717
submodules: 'recursive'
18-
- uses: DeterminateSystems/nix-installer-action@v14
19-
- uses: DeterminateSystems/magic-nix-cache-action@v8
18+
- uses: cachix/[email protected]
2019
- name: Pre-populate nix-shell
2120
run: |
2221
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)

.github/workflows/image-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
with:
1616
submodules: 'recursive'
17-
- uses: DeterminateSystems/nix-installer-action@v14
18-
- uses: DeterminateSystems/magic-nix-cache-action@v8
17+
- uses: cachix/install-nix-action@v31.3.0
18+
1919
- name: Test building the release images
2020
run: ./scripts/release.sh --skip-publish --build-bins

.github/workflows/image.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ jobs:
2626
if [ "${{ github.ref_type }}" == "tag" ]; then
2727
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
2828
fi
29-
- uses: DeterminateSystems/nix-installer-action@v14
30-
- uses: DeterminateSystems/magic-nix-cache-action@v8
29+
- uses: cachix/[email protected]
3130
- name: Login to Docker Hub
3231
uses: docker/login-action@v3
3332
with:

.github/workflows/lint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
with:
1616
submodules: 'recursive'
17-
- uses: DeterminateSystems/nix-installer-action@v14
18-
- uses: DeterminateSystems/magic-nix-cache-action@v8
17+
- uses: cachix/[email protected]
1918
- name: Pre-populate nix-shell
2019
run: |
2120
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)

.github/workflows/unit-int.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717
submodules: 'recursive'
18-
- uses: DeterminateSystems/nix-installer-action@v14
19-
- uses: DeterminateSystems/magic-nix-cache-action@v8
18+
- uses: cachix/[email protected]
2019
- name: Pre-populate nix-shell
2120
run: |
2221
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)

io-engine/src/bdev/nvmx/controller.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ pub(crate) mod options {
11021102
}
11031103

11041104
pub(crate) mod transport {
1105-
use std::{ffi::CStr, fmt::Debug};
1105+
use std::{ffi::CStr, fmt::Debug, str::FromStr};
11061106

11071107
use spdk_rs::{ffihelper::copy_str_with_null, libspdk::spdk_nvme_transport_id};
11081108

@@ -1213,6 +1213,9 @@ pub(crate) mod transport {
12131213

12141214
/// the address to connect to
12151215
pub fn with_traddr(mut self, traddr: &str) -> Self {
1216+
if std::net::Ipv6Addr::from_str(traddr).is_ok() {
1217+
self.adrfam = AdressFamily::NvmfAdrfamIpv6;
1218+
}
12161219
self.traddr = traddr.to_string();
12171220
self
12181221
}
@@ -1232,7 +1235,7 @@ pub(crate) mod transport {
12321235
pub fn build(self) -> NvmeTransportId {
12331236
let trtype = String::from(TransportId::TCP);
12341237
let mut trid = spdk_nvme_transport_id {
1235-
adrfam: AdressFamily::NvmfAdrfamIpv4 as u32,
1238+
adrfam: self.adrfam as u32,
12361239
trtype: TransportId::TCP as u32,
12371240
..Default::default()
12381241
};

io-engine/src/bdev/nvmx/uri.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,14 @@ impl TryFrom<&Url> for NvmfDeviceTemplate {
161161

162162
let hostnqn = parameters.remove("hostnqn");
163163

164+
let host = host
165+
.trim_start_matches("[")
166+
.trim_end_matches("]")
167+
.to_string();
164168
Ok(NvmfDeviceTemplate {
165169
name: url[url::Position::BeforeHost..url::Position::AfterPath].to_string(),
166170
alias: url.to_string(),
167-
host: host.to_string(),
171+
host,
168172
port: url.port().unwrap_or(DEFAULT_NVMF_PORT),
169173
subnqn: segments[0].to_string(),
170174
prchk_flags,

0 commit comments

Comments
 (0)