mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-26 00:10:19 +00:00
- Enable all hardware targets before adding virtual ones.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3443 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2082,7 +2082,7 @@ sub applyTargetAssignments {
|
||||
|
||||
if (defined($$attributes{'HW_TARGET'})) {
|
||||
immediateExit("Hardware target '$target' for driver '$driver' does not exist.");
|
||||
}
|
||||
}
|
||||
|
||||
filterCreateAttributes($possible, $attributes, FALSE);
|
||||
|
||||
@@ -2290,6 +2290,18 @@ sub addVirtualTarget {
|
||||
my $target = shift;
|
||||
my $attributes = shift;
|
||||
|
||||
# Enable all hardware targets before creating virtual ones
|
||||
my $targets = $SCST->targets($driver);
|
||||
|
||||
foreach my $_target (@{$targets}) {
|
||||
my $attributes = $SCST->targetAttributes($driver, $_target);
|
||||
|
||||
if (defined($$attributes{'hw_target'}) &&
|
||||
!$$attributes{'enabled'}->{'value'}) {
|
||||
enableTarget($driver, $_target);
|
||||
}
|
||||
}
|
||||
|
||||
print "\t-> Creating target '$target' for driver '$driver': ";
|
||||
my $rc = $SCST->addVirtualTarget($driver, $target, $attributes);
|
||||
print "done.\n";
|
||||
|
||||
Reference in New Issue
Block a user