Changeset 845aaf6


Ignore:
Timestamp:
Aug 27, 2013 8:07:42 AM (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
6dd9592
Parents:
2ac57ce
Message:

Setup the new snapshot process as an external process and update the message appropriately. Also make sure that we parse every single line in the log, just to make sure that we don't miss an important message (keep it quiet during the initial startup phase though).

Location:
src-qt4/life-preserver
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/LPBackend.cpp

    r2ac57ce r845aaf6  
    162162//    Snapshop Management 
    163163// ================== 
    164 bool LPBackend::newSnapshot(QString dataset, QString snapshotname){ 
     164void LPBackend::newSnapshot(QString dataset, QString snapshotname){ 
     165  //This needs to run externally - since the snapshot is simply added to the queue, and the replication 
     166  //   afterwards may take a long time. 
    165167  QString cmd = "lpreserver mksnap --replicate "+dataset+" "+snapshotname; 
    166   int ret = LPBackend::runCmd(cmd); 
    167     
    168   return (ret == 0); 
     168  QProcess::startDetached(cmd); 
     169    
     170  return; 
    169171} 
    170172 
  • src-qt4/life-preserver/LPBackend.h

    r2ac57ce r845aaf6  
    2626        static bool datasetInfo(QString dataset, int& time, int& numToKeep); //get current settings for a dataset 
    2727        //Snapshop Management 
    28         static bool newSnapshot(QString dataset, QString snapshotname); 
     28        static void newSnapshot(QString dataset, QString snapshotname); 
    2929        static bool removeSnapshot(QString dataset, QString snapshot); 
    3030        static bool revertSnapshot(QString dataset, QString snapshot); //revert to given snapshot 
  • src-qt4/life-preserver/LPTray.cpp

    r539d8eb r845aaf6  
    202202    //Backend Status Update 
    203203    //get the last line from the log file 
    204     QString log; 
    205     while( !LFStream->atEnd() ){ log = LFStream->readLine(); } 
    206     //Now parse the log line and do stuff with it 
    207     parseLogMessage(log,initPhase); 
     204    //Now parse the log lines and do stuff with it 
     205    while( !LFStream->atEnd() ){ parseLogMessage(LFStream->readLine(), initPhase); } 
    208206  }else{ 
    209207    //Replication status update 
  • src-qt4/life-preserver/mainUI.cpp

    r539d8eb r845aaf6  
    300300  qDebug() << "Creating a new snapshot:" << ds << name; 
    301301  //Now create the new snapshot 
    302   ok = LPBackend::newSnapshot(ds,name); 
    303   if( ok ){ 
    304     QMessageBox::information(this,tr("Success"), tr("The new snapshot has been created")); 
    305   }else{ 
    306     QMessageBox::warning(this,tr("Failure"), tr("The new snapshot could not be created")); 
    307   } 
     302  LPBackend::newSnapshot(ds,name); 
     303  QMessageBox::information(this,tr("Snapshot Pending"), tr("The new snapshot creation has been added to the queue")); 
    308304  setupUI(); 
    309305} 
Note: See TracChangeset for help on using the changeset viewer.