All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Omar Sandoval <osandov@osandov.com>
Cc: Linux NVMe Mailinglist <linux-nvme@lists.infradead.org>,
	Linux Block Layer Mailinglist <linux-block@vger.kernel.org>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH blktests 2/3] nvme: add uuid parameter to _create_nvmet_subsystem
Date: Tue, 24 Apr 2018 10:12:50 -0600	[thread overview]
Message-ID: <20180424161251.6502-2-jthumshirn@suse.de> (raw)
In-Reply-To: <20180424161251.6502-1-jthumshirn@suse.de>

Add an optional UUID parameter to _create_nvmet_subsystem().

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 common/nvme | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/nvme b/common/nvme
index 506612f27297..c54b1eb8cee2 100644
--- a/common/nvme
+++ b/common/nvme
@@ -46,13 +46,19 @@ _remove_nvmet_port() {
 _create_nvmet_subsystem() {
 	local nvmet_subsystem="$1"
 	local blkdev="$2"
+	local uuid="00000000-0000-0000-0000-000000000000"
 	local nvmet_cfs="/sys/kernel/config/nvmet/"
 	local cfs_path="${nvmet_cfs}/subsystems/${nvmet_subsystem}"
 
+	if [[ $# -eq 3 ]]; then
+	    uuid="$3"
+	fi
+
 	mkdir -p "${cfs_path}"
 	echo 1 > "${cfs_path}/attr_allow_any_host"
 	mkdir "${cfs_path}/namespaces/1"
 	printf "%s" "$blkdev" > "${cfs_path}/namespaces/1/device_path"
+	printf "%s" "$uuid" > "${cfs_path}/namespaces/1/device_uuid"
 	printf 1 > "${cfs_path}/namespaces/1/enable"
 }
 
-- 
2.16.3

WARNING: multiple messages have this Message-ID (diff)
From: jthumshirn@suse.de (Johannes Thumshirn)
Subject: [PATCH blktests 2/3] nvme: add uuid parameter to _create_nvmet_subsystem
Date: Tue, 24 Apr 2018 10:12:50 -0600	[thread overview]
Message-ID: <20180424161251.6502-2-jthumshirn@suse.de> (raw)
In-Reply-To: <20180424161251.6502-1-jthumshirn@suse.de>

Add an optional UUID parameter to _create_nvmet_subsystem().

Signed-off-by: Johannes Thumshirn <jthumshirn at suse.de>
---
 common/nvme | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/nvme b/common/nvme
index 506612f27297..c54b1eb8cee2 100644
--- a/common/nvme
+++ b/common/nvme
@@ -46,13 +46,19 @@ _remove_nvmet_port() {
 _create_nvmet_subsystem() {
 	local nvmet_subsystem="$1"
 	local blkdev="$2"
+	local uuid="00000000-0000-0000-0000-000000000000"
 	local nvmet_cfs="/sys/kernel/config/nvmet/"
 	local cfs_path="${nvmet_cfs}/subsystems/${nvmet_subsystem}"
 
+	if [[ $# -eq 3 ]]; then
+	    uuid="$3"
+	fi
+
 	mkdir -p "${cfs_path}"
 	echo 1 > "${cfs_path}/attr_allow_any_host"
 	mkdir "${cfs_path}/namespaces/1"
 	printf "%s" "$blkdev" > "${cfs_path}/namespaces/1/device_path"
+	printf "%s" "$uuid" > "${cfs_path}/namespaces/1/device_uuid"
 	printf 1 > "${cfs_path}/namespaces/1/enable"
 }
 
-- 
2.16.3

  reply	other threads:[~2018-04-24 16:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-24 16:12 [PATCH blktests 1/3] nvme: fix counting available ports Johannes Thumshirn
2018-04-24 16:12 ` Johannes Thumshirn
2018-04-24 16:12 ` Johannes Thumshirn [this message]
2018-04-24 16:12   ` [PATCH blktests 2/3] nvme: add uuid parameter to _create_nvmet_subsystem Johannes Thumshirn
2018-04-24 16:12 ` [PATCH blktests 3/3] nvme: add a regression test for UUID ns descriptops Johannes Thumshirn
2018-04-24 16:12   ` Johannes Thumshirn
2018-04-25 15:30   ` Omar Sandoval
2018-04-25 15:30     ` Omar Sandoval
2018-04-25 15:52     ` Johannes Thumshirn
2018-04-25 15:52       ` Johannes Thumshirn
2018-04-25 15:58       ` Omar Sandoval
2018-04-25 15:58         ` Omar Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180424161251.6502-2-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=osandov@osandov.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.