/[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

Contents of /lib/PXElator/kvm.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 85 - (show annotations)
Fri Jul 31 17:35:30 2009 UTC (11 years, 5 months ago) by dpavlin
File size: 599 byte(s)
report tap status

1 package kvm;
2
3 use warnings;
4 use strict;
5 use autodie;
6
7 use server;
8
9 our $memory_size = 512;
10 our $mac = 'AC:DE:48:00:00:01'; # AC = private, AD = multicast, AE = local
11 our $monitor = 'tcp:' . $server::ip . ':10000,server,nowait';
12
13 sub start_options { qw/monitor/ }
14
15 sub monitor {
16 exec "xterm -e nc $server::ip 10000";
17 }
18
19 use network;
20
21 sub start {
22
23 warn 'tap ', network::tap();
24
25 my $kvm = qq|
26 vdeq kvm -m $memory_size -net nic,vlan=1,macaddr=$mac
27 -net vde,vlan=1,sock=/var/run/vde2/tap0.ctl
28 -boot n
29 -monitor $monitor
30 |;
31 $kvm =~ s{\s+}{ }gs;
32
33 warn $kvm;
34 exec $kvm;
35
36 }
37
38 warn 'loaded';
39
40 1;

  ViewVC Help
Powered by ViewVC 1.1.26