2006-08-19 13:40:16 by steve
Allow MAC address to be specified for the initial network interface.
This commit is contained in:
@@ -446,7 +446,7 @@ Install an X11 server, using VNC and XDM
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-create-image,v 1.80 2006-08-18 13:16:55 steve Exp $
|
||||
$Id: xen-create-image,v 1.81 2006-08-19 13:40:16 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -901,6 +901,7 @@ sub parseCommandLineArguments
|
||||
"gateway=s", \$CONFIG{'gateway'},
|
||||
"hostname=s", \$CONFIG{'hostname'},
|
||||
"ip=s@", \$CONFIG{'ip'},
|
||||
"mac=s", \$CONFIG{'mac'},
|
||||
"netmask=s", \$CONFIG{'netmask'},
|
||||
"p2p=s", \$CONFIG{'p2p'},
|
||||
|
||||
@@ -939,7 +940,7 @@ sub parseCommandLineArguments
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Revision: 1.80 $';
|
||||
my $REVISION = '$Revision: 1.81 $';
|
||||
|
||||
if ( $REVISION =~ /1.([0-9.]+) / )
|
||||
{
|
||||
@@ -1294,16 +1295,52 @@ sub showSummery
|
||||
#
|
||||
# Show each IP address added.
|
||||
#
|
||||
# Note we only allow the first IP address to have a MAC address specified.
|
||||
#
|
||||
my $ips = $CONFIG{'ip'};
|
||||
my $mac = $CONFIG{'mac'};
|
||||
my $count = 1;
|
||||
|
||||
#
|
||||
# Print out each network address, and if there is a mac address
|
||||
# associated with it then use it too.
|
||||
#
|
||||
foreach my $i ( @$ips )
|
||||
{
|
||||
logprint( "IP Address $count : $i\n" );
|
||||
$count += 1;
|
||||
my $m = undef;
|
||||
|
||||
if ( ( $count == 1 ) && ( defined( $mac ) ) )
|
||||
{
|
||||
$m = $mac;
|
||||
}
|
||||
|
||||
logprint( "IP Address $count : $i" );
|
||||
if ( defined( $m ) )
|
||||
{
|
||||
logprint( " [MAC: $m]" );
|
||||
}
|
||||
logprint( "\n" );
|
||||
|
||||
$count += 1;
|
||||
}
|
||||
|
||||
#
|
||||
# mac address setting still works even for DHCP, but in that
|
||||
# case only the first one works.
|
||||
#
|
||||
if ( $CONFIG{'dhcp'} )
|
||||
{
|
||||
if ( defined( $CONFIG{'mac'} ) )
|
||||
{
|
||||
|
||||
logprint( "IP Address : DHCP [MAC: $CONFIG{'mac'}]\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
logprint( "IP Address : DHCP\n" );
|
||||
}
|
||||
}
|
||||
|
||||
$CONFIG{'dhcp'} && logprint( "IP Address : DHCP\n" );
|
||||
$CONFIG{'netmask'} && logprint( "Netmask : $CONFIG{'netmask'}\n" );
|
||||
$CONFIG{'gateway'} && logprint( "Gateway : $CONFIG{'gateway'}\n" );
|
||||
$CONFIG{'p2p'} && logprint( "Point to Point : $CONFIG{'p2p'}\n" );
|
||||
|
||||
3
debian/changelog
vendored
3
debian/changelog
vendored
@@ -6,6 +6,9 @@
|
||||
(Closes: #383736)
|
||||
- Improved documentation on custom variables in the Xen configuration
|
||||
file in the manpage for xt-create-xen-config
|
||||
- Allow the MAC address to be set for the first network interface,
|
||||
regardless of DHCP/static addressing.
|
||||
(Closes: #383492)
|
||||
|
||||
xen-tools (2.3-1) unstable; urgency=high
|
||||
|
||||
|
||||
21
etc/xm.tmpl
21
etc/xm.tmpl
@@ -43,11 +43,28 @@ name = '{$hostname}'
|
||||
{ if ( $dhcp )
|
||||
{
|
||||
$OUT .= "dhcp = 'dhcp'\n";
|
||||
$OUT .= "vif = [ '' ]";
|
||||
|
||||
# Setup the mac address, if present.
|
||||
my $m = '';
|
||||
if ( $mac )
|
||||
{
|
||||
$m = "mac=$mac"
|
||||
}
|
||||
|
||||
$OUT .= "vif = [ '$m' ]";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "vif = [ 'ip=$ip1' ]";
|
||||
#
|
||||
# Setup the mac address, if present.
|
||||
#
|
||||
my $m = '';
|
||||
if ( $mac )
|
||||
{
|
||||
$m = "mac=$mac"
|
||||
}
|
||||
|
||||
$OUT .= "vif = [ 'ip=$ip1,$m' ]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user