diff options
author | zheng <Zheng.chai@citrix.com> | 2016-04-25 16:00:38 +0800 |
---|---|---|
committer | zheng <Zheng.chai@citrix.com> | 2016-04-25 16:00:38 +0800 |
commit | 9cf1fde2f55d57f4ca5ab06d6aef64ca768640e5 (patch) | |
tree | b6b45d55470c3a99fb29d76fd920efa37402b73e | |
parent | f60e2a13174ec8705831cdaaf44b1b83efceeb61 (diff) | |
parent | e1986cb6bd305641606cb23f02119c4a12e23a45 (diff) | |
download | vyos-xe-guest-utilities-9cf1fde2f55d57f4ca5ab06d6aef64ca768640e5.tar.gz vyos-xe-guest-utilities-9cf1fde2f55d57f4ca5ab06d6aef64ca768640e5.zip |
Merge pull request #15 from cheng-z/CP-16739
CP-16739: Fix compile error of logger points
-rw-r--r-- | xenstoreclient/xenstore.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xenstoreclient/xenstore.go b/xenstoreclient/xenstore.go index 7b61670..77126f0 100644 --- a/xenstoreclient/xenstore.go +++ b/xenstoreclient/xenstore.go @@ -13,6 +13,7 @@ import ( "strconv" "strings" "sync" + "time" ) type Permission int @@ -375,7 +376,7 @@ func (xs *XenStore) UnWatch(path string, token string) (err error) { func (xs *XenStore) Watch(path string, token string) error { watcher := func() { - logger.Printf("Watch: Start") + xs.logger.Printf("Watch: Start") type XSData struct { *Packet Error error @@ -404,13 +405,13 @@ func (xs *XenStore) Watch(path string, token string) error { for { select { case <-xs.watchStopChan: - logger.Printf("Watch: receive stop signal, quit.\n") + xs.logger.Printf("Watch: receive stop signal, quit.\n") xs.watchStoppedChan <- struct{}{} xsReadStop <- true return case xsdata := <-xsDataChan: if xsdata.Error != nil { - logger.Printf("Watch: receive error: %#v", xsdata.Error) + xs.logger.Printf("Watch: receive error: %#v", xsdata.Error) return } switch xsdata.Packet.OpCode { @@ -418,10 +419,10 @@ func (xs *XenStore) Watch(path string, token string) error { parts := strings.SplitN(string(xsdata.Value), "\x00", 2) path := parts[0] token := parts[1] - logger.Printf("Get XS_WATCH_EVENT key:%s, token:%s\n", path, token) + xs.logger.Printf("Get XS_WATCH_EVENT key:%s, token:%s\n", path, token) xs.watchQueue.SetEventByKey(path, token) default: - logger.Printf("Get non watch event %#v\n", xsdata.Packet.OpCode) + xs.logger.Printf("Get non watch event %#v\n", xsdata.Packet.OpCode) var b bytes.Buffer xsdata.Packet.Write(&b) xs.nonWatchQueue <- b.Bytes() @@ -441,7 +442,7 @@ func (xs *XenStore) Watch(path string, token string) error { } _, err := xs.DO(req) if err != nil { - logger.Errorf("Watch failed with error %#v\n", err) + xs.logger.Printf("Watch failed with error %#v\n", err) return err } xs.watchQueue.AddChanByKey(path) @@ -542,5 +543,5 @@ func getDevPath() (devPath string, err error) { return devPath, err } } - return "", logger.Errorf("Cannot locate xenbus dev path in %v", devPaths) + return "", fmt.Errorf("Cannot locate xenbus dev path in %v", devPaths) } |