/[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 54 by dpavlin, Thu Jul 30 12:28:49 2009 UTC revision 67 by dpavlin, Thu Jul 30 21:31:30 2009 UTC
# Line 8  use File::Slurp; Line 8  use File::Slurp;
8    
9  use server;  use server;
10    
11    our $debug = server::debug;
12    
13  my $interfaces = read_file '/etc/network/interfaces';  my $interfaces = read_file '/etc/network/interfaces';
14    
15  if ( $interfaces !~ m{tap0.*$server::ip}s ) {  if ( $interfaces !~ m{tap0.*$server::ip}s ) {
# Line 34  if ( grep /tap0/, read_file '/proc/net/d Line 36  if ( grep /tap0/, read_file '/proc/net/d
36  }  }
37    
38  our $memory_size = 512;  our $memory_size = 512;
39  our $mac = '52:54:00:00:00:01';  our $mac = 'AC:DE:48:00:00:01'; # AC = private, AD = multicast, AE = local
40    
41  sub start {  sub start {
42    
# Line 42  sub start { Line 44  sub start {
44                  vdeq kvm -m $memory_size -net nic,vlan=1,macaddr=$mac                  vdeq kvm -m $memory_size -net nic,vlan=1,macaddr=$mac
45                  -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl                  -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl
46                  -boot n                  -boot n
47                    -monitor stdio
48          |;          |;
49    
50    
51            $kvm = "xterm -e $kvm" if $ENV{DISPLAY};
52    
53          $kvm =~ s{\s+}{ }gs;          $kvm =~ s{\s+}{ }gs;
54          warn $kvm;          warn $kvm;
55          system $kvm;          exec $kvm;
56    
57  }  }
58    

Legend:
Removed from v.54  
changed lines
  Added in v.67

  ViewVC Help
Powered by ViewVC 1.1.26