~ubuntu-branches/ubuntu/precise/tgt/precise

« back to all changes in this revision

Viewing changes to scripts/tgt-setup-lun

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-08-08 04:45:03 UTC
  • mfrom: (1.2.3 upstream) (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110808044503-kxrg8b262tbfiw7m
Tags: 1:1.0.17-1ubuntu1
* Merge from debian remaining changes: 
  - debian/usptart: Add upstart job.
  - Dropped:
    - debian/patches/CVE-2011-0001.patch: No longer needed, use debian instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
 
121
121
err_exit()
122
122
{
 
123
        if ((new_tgt == 0)); then
 
124
                exit 1
 
125
        fi
 
126
 
123
127
        echo "Deleting new target, tid=$tid"
124
128
        tgtadm --lld $lld_name --op delete --mode target --tid $tid
125
129
        res=$?
196
200
        fi
197
201
        tid=$(tgtadm --lld $lld_name --op show --mode target | grep $tgt_name | cut -d" " -f2)
198
202
        tid=${tid%:}
 
203
        new_tgt=0
199
204
else
200
205
        find_vacant_tgt_id
201
206
        tid=$?
209
214
                echo "Error: failed to create target (name=$tgt_name, tid=$tid)"
210
215
                exit 1
211
216
        fi
 
217
        new_tgt=1
212
218
fi
213
219
 
214
220
find_vacant_lun $tid