mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 00:13:52 +01:00
zfs: ResumeToken: parse embedok, largeblockok, savedok if available
Developed for #285 but ultimately not used for it.
This commit is contained in:
parent
efe7b17d21
commit
70bbdfe760
@ -18,11 +18,14 @@ import (
|
|||||||
|
|
||||||
// NOTE: Update ZFSSendARgs.Validate when changing fields (potentially SECURITY SENSITIVE)
|
// NOTE: Update ZFSSendARgs.Validate when changing fields (potentially SECURITY SENSITIVE)
|
||||||
type ResumeToken struct {
|
type ResumeToken struct {
|
||||||
HasFromGUID, HasToGUID bool
|
HasFromGUID, HasToGUID bool
|
||||||
FromGUID, ToGUID uint64
|
FromGUID, ToGUID uint64
|
||||||
ToName string
|
ToName string
|
||||||
HasCompressOK, CompressOK bool
|
HasCompressOK, CompressOK bool
|
||||||
HasRawOk, RawOK bool
|
HasRawOk, RawOK bool
|
||||||
|
HasLargeBlockOK, LargeBlockOK bool
|
||||||
|
HasEmbedOk, EmbedOK bool
|
||||||
|
HasSavedOk, SavedOk bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var resumeTokenNVListRE = regexp.MustCompile(`\t(\S+) = (.*)`)
|
var resumeTokenNVListRE = regexp.MustCompile(`\t(\S+) = (.*)`)
|
||||||
@ -240,6 +243,24 @@ func ParseResumeToken(ctx context.Context, token string) (*ResumeToken, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ResumeTokenParsingError
|
return nil, ResumeTokenParsingError
|
||||||
}
|
}
|
||||||
|
case "embedok":
|
||||||
|
rt.HasEmbedOk = true
|
||||||
|
rt.EmbedOK, err = strconv.ParseBool(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, ResumeTokenParsingError
|
||||||
|
}
|
||||||
|
case "largeblockok":
|
||||||
|
rt.HasLargeBlockOK = true
|
||||||
|
rt.LargeBlockOK, err = strconv.ParseBool(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, ResumeTokenParsingError
|
||||||
|
}
|
||||||
|
case "savedok":
|
||||||
|
rt.HasSavedOk = true
|
||||||
|
rt.SavedOk, err = strconv.ParseBool(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, ResumeTokenParsingError
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user