From 898eca2232289d3f64431bc3763da4b65bb3ae61 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 20 Jun 2007 18:04:19 +0000 Subject: * split export type into filesystem and (optional) blockdevice, closing ticket#139 * code-reformatting with perltidy git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1176 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSExport/BlockDevice/AoE.pm | 98 +++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 installer/OpenSLX/OSExport/BlockDevice/AoE.pm (limited to 'installer/OpenSLX/OSExport/BlockDevice/AoE.pm') diff --git a/installer/OpenSLX/OSExport/BlockDevice/AoE.pm b/installer/OpenSLX/OSExport/BlockDevice/AoE.pm new file mode 100644 index 00000000..c8aad4ec --- /dev/null +++ b/installer/OpenSLX/OSExport/BlockDevice/AoE.pm @@ -0,0 +1,98 @@ +# Copyright (c) 2006, 2007 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your suggestions, praise, or complaints to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org/ +# ----------------------------------------------------------------------------- +# AoE.pm +# - provides ATA-over-Ethernet specific overrides of the +# OpenSLX::OSExport::BlockDevice API. +# ----------------------------------------------------------------------------- +package OpenSLX::OSExport::BlockDevice::AoE; + +use vars qw($VERSION); +use base qw(OpenSLX::OSExport::BlockDevice::Base); +$VERSION = 1.01; # API-version . implementation-version + +use strict; +use Carp; +use File::Basename; +use OpenSLX::Basics; +use OpenSLX::ConfigDB qw(:support); +use OpenSLX::OSExport::BlockDevice::Base 1; +use OpenSLX::Utils; + +# +# +# N.B.: currently this is just a stub +# +# + + +################################################################################ +### interface methods +################################################################################ +sub new +{ + my $class = shift; + my $self = {'name' => 'aoe',}; + return bless $self, $class; +} + +sub initialize +{ + my $self = shift; + my $engine = shift; + my $fs = shift; + + $self->{'engine'} = $engine; + $self->{'fs'} = $fs; +} + +sub getExportPort +{ + my $self = shift; + my $openslxDB = shift; + + return $openslxDB->incrementGlobalCounter('next-nbd-server-port'); +} + +sub generateExportURI +{ + my $self = shift; + my $export = shift; + + my $server = + length($export->{server_ip}) + ? $export->{server_ip} + : generatePlaceholderFor('serverip'); + $server .= ":$export->{port}" if length($export->{port}); + + return "aoe://$server"; +} + +sub requiredBlockDeviceModules +{ + my $self = shift; + + return 'aoe'; +} + +sub showExportConfigInfo +{ + my $self = shift; + my $export = shift; + + print(('#' x 80) . "\n"); + print _tr( + "Please make sure you start a corresponding aoe-server:\n\t%s\n", + "... (don't know how this is done yet)" + ); + print(('#' x 80) . "\n"); +} + +1; -- cgit v1.2.3-55-g7522