Revision 518

Date:
2010/07/21 19:01:46
Author:
dpavlin
Revision Log:
use DEV as bridge for kvm if specified
Files:

Legend:

 
Added
 
Removed
 
Modified
  • lib/PXElator/kvm.pm

     
    50 50 my $mac = sprintf('AC:DE:48:00:00:%02x', $nr);
    51 51 my $mon = port(10000,':');
    52 52 my $ser = port(11000,':');
    53 my $ip = client::ip_from_mac $mac;
    53 54
    55 my $bridge = client::conf( $ip, 'kvm.bridge', default => 'virtual' );
    56 $bridge = $ENV{DEV} if $ENV{DEV};
    57
    54 58 my $ifname = 'kvm' . $nr;
    55 59
    56 warn "# kvm start $nr $mac $mon $ser $ifname";
    60 warn "# kvm $ip start $nr $mac $mon $ser $ifname $bridge";
    57 61
    58 62 # system "ifconfig $ifname down";
    59 63 # system "brctl delif virtual $ifname";
     
    66 70 unless $ifconfig =~ m{$ifname};
    67 71 system "ifconfig $ifname up"
    68 72 unless $ifconfig =~ m{UP};
    69 system "brctl addif virtual $ifname"
    73 system "brctl addif $bridge $ifname"
    70 74 unless `brctl show` =~ m{$ifname};
    71 75
    72 my $ip = client::ip_from_mac $mac;
    73
    74 76 my $name = client::conf( $ip, 'hostname' );
    75 77 $name ||= $nr;
    76 78