/[pxelator]/lib/PXElator/kvm.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/kvm.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 429 by dpavlin, Sun Sep 13 15:51:03 2009 UTC revision 512 by dpavlin, Wed Jul 21 17:50:32 2010 UTC
# Line 69  sub start { Line 69  sub start {
69          system "brctl addif virtual $ifname"          system "brctl addif virtual $ifname"
70                  unless `brctl show` =~ m{$ifname};                  unless `brctl show` =~ m{$ifname};
71    
72          my $name = client::conf( client::ip_from_mac $mac, 'hostname' );          my $ip = client::ip_from_mac $mac;
73    
74            my $name = client::conf( $ip, 'hostname' );
75          $name ||= $nr;          $name ||= $nr;
76    
77            my $kvm_bin = client::conf( $ip => 'kvm.bin' ) || 'kvm';
78            my $boot = client::conf( $ip, 'kvm.boot' ) || 'n'; # network by default
79    
80          my $kvm = qq|          my $kvm = qq|
81                  kvm                  $kvm_bin
82                  -name "$name"                  -name "$name"
83                  -m $memory_size -net nic,macaddr=$mac                  -m $memory_size -net nic,macaddr=$mac
84                  -net tap,ifname=$ifname,script=no                  -net tap,ifname=$ifname,script=no
85                  -boot n                  -boot $boot
86                  -monitor tcp:$mon,server,nowait                  -monitor tcp:$mon,server,nowait
87                  -serial  tcp:$ser,server,nowait                  -serial  tcp:$ser,server,nowait
88          |;          |;
# Line 94  sub start { Line 99  sub start {
99    
100  sub nr_from_mac {  sub nr_from_mac {
101          my $mac = shift;          my $mac = shift;
102          $mac =~ s{^.+:([0-9a-f]{2})$}{hex($1)}e;          $mac =~ s<^.+:([0-9a-f]{2})$><hex($1)>e;
103          $mac;          $mac;
104  }  }
105    

Legend:
Removed from v.429  
changed lines
  Added in v.512

  ViewVC Help
Powered by ViewVC 1.1.26