summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSExport/BlockDevice
diff options
context:
space:
mode:
Diffstat (limited to 'installer/OpenSLX/OSExport/BlockDevice')
-rw-r--r--installer/OpenSLX/OSExport/BlockDevice/AoE.pm11
-rw-r--r--installer/OpenSLX/OSExport/BlockDevice/Base.pm13
-rw-r--r--installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm11
-rw-r--r--installer/OpenSLX/OSExport/BlockDevice/NBD.pm11
4 files changed, 13 insertions, 33 deletions
diff --git a/installer/OpenSLX/OSExport/BlockDevice/AoE.pm b/installer/OpenSLX/OSExport/BlockDevice/AoE.pm
index d3916d6a..cc7866b5 100644
--- a/installer/OpenSLX/OSExport/BlockDevice/AoE.pm
+++ b/installer/OpenSLX/OSExport/BlockDevice/AoE.pm
@@ -41,17 +41,6 @@ sub new
return bless $self, $class;
}
-sub initialize
-{
- my $self = shift;
- my $engine = shift;
- my $fs = shift;
-
- $self->{'engine'} = $engine;
- $self->{'fs'} = $fs;
- return;
-}
-
sub getExportPort
{
my $self = shift;
diff --git a/installer/OpenSLX/OSExport/BlockDevice/Base.pm b/installer/OpenSLX/OSExport/BlockDevice/Base.pm
index d2395e30..6469c2f4 100644
--- a/installer/OpenSLX/OSExport/BlockDevice/Base.pm
+++ b/installer/OpenSLX/OSExport/BlockDevice/Base.pm
@@ -18,6 +18,8 @@ use warnings;
our $VERSION = 1.01; # API-version . implementation-version
+use Scalar::Util qw( weaken );
+
use OpenSLX::Basics;
################################################################################
@@ -30,6 +32,17 @@ sub new
sub initialize
{
+ my $self = shift;
+ my $engine = shift;
+ my $fs = shift;
+
+ $self->{'engine'} = $engine;
+ weaken($self->{'engine'});
+ # avoid circular reference between block-device and its engine
+
+ $self->{'fs'} = $fs;
+ weaken($self->{'fs'});
+ # avoid circular reference between block-device and its file-system
}
sub getExportPort
diff --git a/installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm b/installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm
index 8dcc340b..1ad9471e 100644
--- a/installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm
+++ b/installer/OpenSLX/OSExport/BlockDevice/DNBD2.pm
@@ -35,17 +35,6 @@ sub new
return bless $self, $class;
}
-sub initialize
-{
- my $self = shift;
- my $engine = shift;
- my $fs = shift;
-
- $self->{'engine'} = $engine;
- $self->{'fs'} = $fs;
- return;
-}
-
sub getExportPort
{
my $self = shift;
diff --git a/installer/OpenSLX/OSExport/BlockDevice/NBD.pm b/installer/OpenSLX/OSExport/BlockDevice/NBD.pm
index 73694fbc..58378751 100644
--- a/installer/OpenSLX/OSExport/BlockDevice/NBD.pm
+++ b/installer/OpenSLX/OSExport/BlockDevice/NBD.pm
@@ -35,17 +35,6 @@ sub new
return bless $self, $class;
}
-sub initialize
-{
- my $self = shift;
- my $engine = shift;
- my $fs = shift;
-
- $self->{'engine'} = $engine;
- $self->{'fs'} = $fs;
- return;
-}
-
sub getExportPort
{
my $self = shift;