Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 27, 2013
@beanpole135 beanpole135 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).
@beanpole135 beanpole135 Merge branch 'master' of 6dd9592
8 src-qt4/life-preserver/LPBackend.cpp
@@ -161,11 +161,13 @@ bool LPBackend::datasetInfo(QString dataset, int& time, int& numToKeep){
// ==================
// Snapshop Management
// ==================
-bool LPBackend::newSnapshot(QString dataset, QString snapshotname){
+void LPBackend::newSnapshot(QString dataset, QString snapshotname){
+ //This needs to run externally - since the snapshot is simply added to the queue, and the replication
+ // afterwards may take a long time.
QString cmd = "lpreserver mksnap --replicate "+dataset+" "+snapshotname;
- int ret = LPBackend::runCmd(cmd);
+ QProcess::startDetached(cmd);
- return (ret == 0);
+ return;
bool LPBackend::removeSnapshot(QString dataset, QString snapshot){
2  src-qt4/life-preserver/LPBackend.h
@@ -25,7 +25,7 @@ class LPBackend{
static bool removeDataset(QString dataset);
static bool datasetInfo(QString dataset, int& time, int& numToKeep); //get current settings for a dataset
//Snapshop Management
- static bool newSnapshot(QString dataset, QString snapshotname);
+ static void newSnapshot(QString dataset, QString snapshotname);
static bool removeSnapshot(QString dataset, QString snapshot);
static bool revertSnapshot(QString dataset, QString snapshot); //revert to given snapshot
static QString revertSnapshotFile(QString dataset, QString snapshot, QString filepath);
6 src-qt4/life-preserver/LPTray.cpp
@@ -201,10 +201,8 @@ void LPTray::slotNewLogMessage(QString file){
if(file == "/var/log/lpreserver/lpreserver.log"){
//Backend Status Update
//get the last line from the log file
- QString log;
- while( !LFStream->atEnd() ){ log = LFStream->readLine(); }
- //Now parse the log line and do stuff with it
- parseLogMessage(log,initPhase);
+ //Now parse the log lines and do stuff with it
+ while( !LFStream->atEnd() ){ parseLogMessage(LFStream->readLine(), initPhase); }
//Replication status update
//get the last line from the file
8 src-qt4/life-preserver/mainUI.cpp
@@ -299,12 +299,8 @@ void mainUI::on_tool_newsnapshot_clicked(){
if(!ok || name.isEmpty()){ return; } //cancelled
qDebug() << "Creating a new snapshot:" << ds << name;
//Now create the new snapshot
- ok = LPBackend::newSnapshot(ds,name);
- if( ok ){
- QMessageBox::information(this,tr("Success"), tr("The new snapshot has been created"));
- }else{
- QMessageBox::warning(this,tr("Failure"), tr("The new snapshot could not be created"));
- }
+ LPBackend::newSnapshot(ds,name);
+ QMessageBox::information(this,tr("Snapshot Pending"), tr("The new snapshot creation has been added to the queue"));

No commit comments for this range

Something went wrong with that request. Please try again.