Changeset 773 in ProjectBuilder


Ignore:
Timestamp:
May 3, 2009, 8:52:30 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Fixes for test2v mode (src copied)
  • Add notion of usesnap to try solving VM snapshot usage
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r772 r773  
    11451145        $src="$src $ENV{'PBDESTDIR'}/pbscript";
    11461146    } elsif ($cmt =~ /V[EM]test/) {
    1147         $src="$src $ENV{'PBDESTDIR'}/pbtest";
     1147        $src="$src $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb $ENV{'PBETC'} $ENV{'PBDESTDIR'}/pbrc $ENV{'PBDESTDIR'}/pbscript $ENV{'PBDESTDIR'}/pbtest";
    11481148    } elsif ($cmt eq "Announce") {
    11491149        $src="$src $ENV{'PBTMP'}/pbscript";
     
    13541354        close(PASS);
    13551355        $cptarget = "$tpdir/$homedir/$tdir";
    1356         if ($cmt eq "ve") {
     1356        if ($cmt eq "VEbuild") {
    13571357            $cp2target = "$tpdir/$homedir/$bdir";
    13581358        }
     
    14681468
    14691469    foreach my $v (@$vm) {
    1470         # Launch VM/VE
    1471         ($vmexist,$vmpid) = pb_launchv($vtype,$v,0,$snapme);
     1470        # Launch VM/VE - Usage of snapshot disabled
     1471        ($vmexist,$vmpid) = pb_launchv($vtype,$v,0,$snapme,0);
    14721472
    14731473        if ($vtype eq "vm") {
     
    15011501    my $create = shift || 0;        # By default do not create a VM/VE
    15021502    my $snapme = shift || 0;        # By default do not snap a VM/VE
    1503 
    1504     pb_log(2,"DEBUG: pb_launchv($vtype,$v,$create,$snapme)\n");
     1503    my $usesnap = shift || 1;       # By default study the usage of the snapshot feature of VM/VE
     1504
     1505    # If creation or snapshot creation mode, no snapshot usable
     1506    if (($create == 1) || ($snapme == 1)) {
     1507        $usesnap = 0;
     1508    }
     1509
     1510    pb_log(2,"DEBUG: pb_launchv($vtype,$v,$create,$snapme,$usesnap)\n");
    15051511    die "No VM/VE defined, unable to launch" if (not defined $v);
    15061512    # Keep only the first VM in case many were given
     
    15311537            $ENV{'PBVMOPT'} .= " $vmopt->{$ENV{'PBPROJ'}}" if ($ENV{'PBVMOPT'} !~ / $vmopt->{$ENV{'PBPROJ'}}/);
    15321538        }
    1533         # Use snapshot feature when not creating VM
    1534         if ($create == 0) {
     1539
     1540        # Are we allowed to use snapshot feature
     1541        if ($usesnap == 1) {
    15351542            if ((defined $vmsnap->{$v}) && ($vmsnap->{$v} =~ /true/i)) {
    15361543                $ENV{'PBVMOPT'} .= "-snapshot ";
     
    15451552                # Configure the monitoring to automize the creation of the 'pb' snapshot
    15461553                $ENV{'PBVMOPT'} .= "-serial mon:telnet::$vmmonport->{$ENV{'PBPROJ'}},server,nowait ";
    1547                 # In that case no snapshot needed
     1554                # In that case no snapshot call needed
    15481555                $ENV{'PBVMOPT'} =~ s/-snapshot //;
    15491556            }
     
    20482055EOF
    20492056
    2050     # Launch the VM/VE
    2051     ($vmexist,$vmpid) = pb_launchv($vtype,$v,0);
     2057    # Launch the VM/VE - Usage of snapshot disabled
     2058    ($vmexist,$vmpid) = pb_launchv($vtype,$v,0,0,0);
    20522059
    20532060    if ($vtype eq "vm") {
     
    23382345
    23392346    # Force shutdown of VM/VE
    2340     $pbforce = 1;
    23412347    # Force snapshot of VM/VE
    2342     pb_script2v($pbscript,$vtype,$pbforce,$v,1);
     2348    pb_script2v($pbscript,$vtype,1,$v,1);
    23432349}
    23442350return;
Note: See TracChangeset for help on using the changeset viewer.