summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2012-08-07 11:38:59 -0700
committerAndy Grover <agrover@redhat.com>2012-08-07 11:38:59 -0700
commit7e7870004066c27d075788028d69c84fb6d86c23 (patch)
tree7ffef8a0927cbd4cc2c94577c9c5b26bee1bd904
parentd7b27b5e3085da5ca89a43b0fdd07340b0d9a118 (diff)
downloadrtslib-fb-2.1.fb20.tar.gz
Update sbp spec to return proper guidv2.1.fb20
Check is_local and return first guid where is_local is 1. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--specs/sbp.spec10
1 files changed, 7 insertions, 3 deletions
diff --git a/specs/sbp.spec b/specs/sbp.spec
index 1e09ba6..a1fea94 100644
--- a/specs/sbp.spec
+++ b/specs/sbp.spec
@@ -6,10 +6,14 @@ features = ()
# Non-standard module naming scheme
kernel_module = "sbp_target"
-# This *will* return the first local 1394 device's guid, but until
-# 3.6 when is_local is available, return an arbitrary value
+# We need a single unique value to create the target.
+# Return the first local 1394 device's guid.
def wwns():
- return ["1234567890abcdef"]
+ import os
+ for fname in glob("/sys/bus/firewire/devices/fw*/is_local"):
+ if bool(int(fread(fname))):
+ guid_path = os.path.dirname(fname) + "/guid"
+ return [fread(guid_path)[2:]]
# The configfs group
configfs_group = "sbp"