Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azblk handler version 1 #540

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

azblk handler version 1 #540

wants to merge 1 commit into from

Conversation

caavery
Copy link

@caavery caavery commented Mar 14, 2019

The azure page blob handler is based on and serves as a user-space
alternative to khenidak's dysk kernel block driver
(https://github.com/khenidak/dysk).

An azblk target device will be exposed to the local host as a TCMU scsi
device via the target loopback driver (targetcli loopback transport).

azblk currently supports SAS access credentials, lease ids,
local read only permissions, http, and https.

Each azblk target device must be configured through a configuration
file whose default location is /etc/tcmu/azblk.conf.

Sample config file:

device =
(
{
name = "azblk1_http";
sas = "sp=rcwd&st=2019-02-22T15:00:55Z&se=2019-03-22T22:00:55Z&spr=https,http&sv=2018-03-28&sig=anIkHRlkadfjlkajdQVqIvENpLO9FL1zyQ%3D&sr=b";
lease = "48e29061-079d-446c-833c-5d884ab5ec1e";
url = "http://myazureaccount.blob.core.windows.net/test/test1.vhd";
},
{
name = "azblk2_https";
sas = "sp=rcwd&st=2019-03-07T13:43:02Z&se=2019-04-04T20:43:02Z&spr=https,http&sv=2018-03-28&sig=MW3SK5h99alskdfjlkjnvV3xz%2BLLcAhDVI%3D&sr=b";
readonly = 1;
url = "https://myazureaccount.blob.core.windows.net/test/test2.vhd";
}
);

Signed-off-by: Cathy Avery cavery@redhat.com

The azure page blob handler is based on and serves as a user-space
alternative to khenidak's dysk kernel block driver
(https://github.com/khenidak/dysk).

An azblk target device will be exposed to the local host as a TCMU scsi
device via the target loopback driver (targetcli loopback transport).

azblk currently supports SAS access credentials, lease ids,
local read only permissions, http, and https.

Each azblk target device must be configured through a configuration
file whose default location is /etc/tcmu/azblk.conf.

Sample config file:

device =
(
  {
    name = "azblk1_http";
    sas = "sp=rcwd&st=2019-02-22T15:00:55Z&se=2019-03-22T22:00:55Z&spr=https,http&sv=2018-03-28&sig=anIkHRlkadfjlkajdQVqIvENpLO9FL1zyQ%3D&sr=b";
    lease = "48e29061-079d-446c-833c-5d884ab5ec1e";
    url = "http://myazureaccount.blob.core.windows.net/test/test1.vhd";
  },
  {
    name = "azblk2_https";
    sas = "sp=rcwd&st=2019-03-07T13:43:02Z&se=2019-04-04T20:43:02Z&spr=https,http&sv=2018-03-28&sig=MW3SK5h99alskdfjlkjnvV3xz%2BLLcAhDVI%3D&sr=b";
    readonly = 1;
    url = "https://myazureaccount.blob.core.windows.net/test/test2.vhd";
  }
);

Signed-off-by: Cathy Avery <cavery@redhat.com>
@@ -0,0 +1,1006 @@
/*
* Copyright (c) 2018 Red Hat, Inc.
*
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean 2019 here ?

curl_socket_t sockfd;
struct azblk_dev *ddev;
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

There has one extra white line :-)


return data_size;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Extra white line.

AZ_SAS_LEN);
goto error;
}
strncpy(ddev->cfg.sas, sas, len);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here we'd better to use the strlcpy as Mike has introduce it from BSD locally.
https://github.com/open-iscsi/tcmu-runner/blob/master/strlcpy.c

case CURLMSG_DONE:
azblk_multi_done(curl_multi, message);
break;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Extra white line here.

@lxbsz lxbsz changed the base branch from master to main August 10, 2022 00:22
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.

2 participants