Ticket #68: autogui.patch
File autogui.patch, 2.1 KB (added by , 14 years ago) |
---|
-
/
old new if ($action =~ /^cms2build$/) { 467 467 pb_cms2build(); 468 468 pb_build2v("vm","build"); 469 469 } elsif ($action =~ /^launchvm$/) { 470 pb_launchv("vm",$ENV{'PBV'},0); 470 # launch vm with disabled default no gui 471 pb_launchv("vm",$ENV{'PBV'},0,1); 471 472 } elsif ($action =~ /^launchve$/) { 472 473 pb_launchv("ve",$ENV{'PBV'},0); 473 474 } elsif ($action =~ /^script2vm$/) { … … if ($action =~ /^cms2build$/) { 479 480 } elsif ($action =~ /^newve$/) { 480 481 pb_launchv("ve",$ENV{'PBV'},1); 481 482 } elsif ($action =~ /^newvm$/) { 482 pb_launchv("vm",$ENV{'PBV'},1); 483 # launch vm with disabled default no gui 484 pb_launchv("vm",$ENV{'PBV'},1,1); 483 485 pb_log(0, "Please ensure that sshd is running in your VM by default\n"); 484 486 pb_log(0, "and that it allows remote root login (PermitRootLogin yes in /etc/ssh/sshd_config)\n"); 485 487 pb_log(0, "Also ensure that network is up, firewalling correctly configured, and perl and scp/ssh installed\n"); … … sub pb_launchv { 1596 1598 my $vtype = shift; 1597 1599 my $v = shift; 1598 1600 my $create = shift || 0; # By default do not create a VM/VE 1601 my $enablegui = shift || 0; # By default, append -nogrpahic to vmcmd ($enablegui = 0) 1599 1602 my $snapme = shift || 0; # By default do not snap a VM/VE 1600 1603 my $usesnap = shift || 1; # By default study the usage of the snapshot feature of VM/VE 1601 1604 … … sub pb_launchv { 1604 1607 $usesnap = 0; 1605 1608 } 1606 1609 1607 pb_log(2,"DEBUG: pb_launchv($vtype,$v,$create,$ snapme,$usesnap)\n");1610 pb_log(2,"DEBUG: pb_launchv($vtype,$v,$create,$enablegui,$snapme,$usesnap)\n"); 1608 1611 die "No VM/VE defined, unable to launch" if (not defined $v); 1609 1612 # Keep only the first VM in case many were given 1610 1613 $v =~ s/,.*//; … … sub pb_launchv { 1636 1639 $ENV{'PBVMOPT'} .= " $vmopt->{$ENV{'PBPROJ'}}" if ($ENV{'PBVMOPT'} !~ / $vmopt->{$ENV{'PBPROJ'}}/); 1637 1640 } 1638 1641 1642 # disable defaultNoGui 1643 if ($enablegui == 0) { 1644 if (($vmtype eq "kvm") || ($vmtype eq "qemu")) { 1645 $ENV{'PBVMOPT'} .= " -nographic "; 1646 } 1647 } 1648 1639 1649 # Are we allowed to use snapshot feature 1640 1650 if ($usesnap == 1) { 1641 1651 if ((defined $vmsnap->{$v}) && ($vmsnap->{$v} =~ /true/i)) {