/*
- * Copyright (c) [2016,2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
}
+ProxySnapshots::iterator
+ProxySnapshotsDbus::getDefault()
+{
+ pair<bool, unsigned int> tmp = command_get_default_snapshot(conn(), configName());
+
+ return tmp.first ? find(tmp.second) : end();
+}
+
+
ProxySnapshots::const_iterator
ProxySnapshotsDbus::getActive() const
{
/*
- * Copyright (c) [2016,2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
ProxySnapshotsDbus(ProxySnapperDbus* backref);
+ virtual iterator getDefault();
virtual const_iterator getDefault() const;
virtual const_iterator getActive() const;
/*
- * Copyright (c) [2016,2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
using namespace std;
+ProxySnapshots::iterator
+ProxySnapshotsLib::getDefault()
+{
+ Snapshots& snapshots = backref->snapper->getSnapshots();
+
+ Snapshots::iterator tmp = snapshots.getDefault();
+
+ return tmp != snapshots.end() ? find(tmp->getNum()) : end();
+}
+
+
ProxySnapshots::const_iterator
ProxySnapshotsLib::getDefault() const
{
- Snapshots& snapshots = backref->snapper->getSnapshots();
+ const Snapshots& snapshots = backref->snapper->getSnapshots();
Snapshots::const_iterator tmp = snapshots.getDefault();
/*
- * Copyright (c) [2016,2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
public:
+ virtual iterator getDefault();
virtual const_iterator getDefault() const;
virtual const_iterator getActive() const;
/*
- * Copyright (c) [2016-2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
const_iterator getCurrent() const { return proxy_snapshots.begin(); }
+ virtual iterator getDefault() = 0;
virtual const_iterator getDefault() const = 0;
virtual const_iterator getActive() const = 0;
/*
* Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016-2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
exit(EXIT_FAILURE);
}
- pair<bool, unsigned int> previous_default = filesystem->getDefault();
+ ProxySnapshots& snapshots = snapper->getSnapshots();
- if (previous_default.first && scd1.description == "rollback backup")
- scd1.description += sformat(" of #%d", previous_default.second);
+ ProxySnapshots::iterator previous_default = snapshots.getDefault();
- ProxySnapshots& snapshots = snapper->getSnapshots();
+ if (previous_default != snapshots.end() && scd1.description == "rollback backup")
+ scd1.description += sformat(" of #%d", previous_default->getNum());
ProxySnapshots::const_iterator snapshot1 = snapshots.end();
ProxySnapshots::const_iterator snapshot2 = snapshots.end();
cout << " " << sformat(_("(Snapshot %d.)"), snapshot2->getNum()) << endl;
}
- if (previous_default.first)
+ if (previous_default != snapshots.end() && previous_default->getCleanup().empty())
{
- ProxySnapshots::iterator it = snapshots.find(previous_default.second);
- if (it->getCleanup().empty())
- {
- SMD smd = it->getSmd();
- smd.cleanup = "number";
- snapper->modifySnapshot(it, smd);
- }
+ SMD smd = previous_default->getSmd();
+ smd.cleanup = "number";
+ snapper->modifySnapshot(previous_default, smd);
}
if (!quiet)
+-------------------------------------------------------------------
+Tue Mar 26 10:15:55 CET 2019 - aschnell@suse.com
+
+- fixed seg.fault during rollback if the previous default subvolume
+ is missing in the snapshot list (bsc#1130273)
+- version 0.8.3
+
-------------------------------------------------------------------
Tue Jan 22 11:05:01 CET 2019 - aschnell@suse.com
-------------------------------------------------------------------
Thu Nov 23 13:51:45 UTC 2017 - rbrown@suse.com
-- Replace references to /var/adm/fillup-templates with new
+- Replace references to /var/adm/fillup-templates with new
%_fillupdir macro (boo#1069468)
-------------------------------------------------------------------
/*
* Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016-2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
/**
* Query the number of the default snapshot. The first entry of the
- * pair indicates whether the default snapshot is a snapper snapshot.
+ * pair indicates whether the default snapshot is a snapper snapshot
+ * (not necessarily in the list of snapshots known to snapper).
* Currently only available for btrfs.
*/
virtual std::pair<bool, unsigned int> getDefault() const;
/*
* Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016,2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
}
+ Snapshots::iterator
+ Snapshots::getDefault()
+ {
+ std::pair<bool, unsigned int> tmp = snapper->getFilesystem()->getDefault();
+
+ return tmp.first ? find(tmp.second) : end();
+ }
+
+
Snapshots::const_iterator
Snapshots::getDefault() const
{
/*
* Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016,2018] SUSE LLC
+ * Copyright (c) [2016-2019] SUSE LLC
*
* All Rights Reserved.
*
* The default btrfs snapshot may not be controlled by snapper
* in which this function returns end().
*/
+ iterator getDefault();
+
const_iterator getDefault() const;
/**