zfs: ability to specify sources for zfsGet

fix use for Placeholder, leave rest as previous behavior
This commit is contained in:
Christian Schwarz
2018-09-05 19:44:35 -07:00
parent 975fdee217
commit 1323a30a0c
4 changed files with 78 additions and 10 deletions
+2 -2
View File
@@ -24,13 +24,13 @@ func ZFSGetReplicationCursor(fs *DatasetPath) (*FilesystemVersion, error) {
func ZFSSetReplicationCursor(fs *DatasetPath, snapname string) (guid uint64, err error) {
snapPath := fmt.Sprintf("%s@%s", fs.ToString(), snapname)
propsSnap, err := zfsGet(snapPath, []string{"createtxg", "guid"})
propsSnap, err := zfsGet(snapPath, []string{"createtxg", "guid"}, sourceAny)
if err != nil {
return 0, err
}
snapGuid, err := strconv.ParseUint(propsSnap.Get("guid"), 10, 64)
bookmarkPath := fmt.Sprintf("%s#%s", fs.ToString(), ReplicationCursorBookmarkName)
propsBookmark, err := zfsGet(bookmarkPath, []string{"createtxg"})
propsBookmark, err := zfsGet(bookmarkPath, []string{"createtxg"}, sourceAny)
_, bookmarkNotExistErr := err.(*DatasetDoesNotExist)
if err != nil && !bookmarkNotExistErr {
return 0, err