From 3831e9739c2a6326a6da89c900b82c9700c2d11d Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 19 Oct 2016 13:59:20 -0400 Subject: [PATCH] resources: virt: Update to new function signature This changed in git master, and is now more idiomatic. --- resources/virt.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/resources/virt.go b/resources/virt.go index 66ce21b1..39b8c9c4 100644 --- a/resources/virt.go +++ b/resources/virt.go @@ -78,9 +78,8 @@ func NewVirtRes(name string, uri, state string, transient bool, cpus uint, memor // Init runs some startup code for this resource. func (obj *VirtRes) Init() error { if !libvirtInitialized { - // TODO: update if https://github.com/rgbkrk/libvirt-go/pull/115 gets merged. - if i := libvirt.EventRegisterDefaultImpl(); i != 0 { - return fmt.Errorf("EventRegisterDefaultImpl failed with: %d", i) + if err := libvirt.EventRegisterDefaultImpl(); err != nil { + return errors.Wrapf(err, "EventRegisterDefaultImpl failed") } libvirtInitialized = true } @@ -140,9 +139,8 @@ func (obj *VirtRes) Watch(processChan chan event.Event) error { default: } //log.Printf("EventRunDefaultImpl started!") - // TODO: update if https://github.com/rgbkrk/libvirt-go/pull/115 gets merged. - if i := libvirt.EventRunDefaultImpl(); i != 0 { - errorChan <- fmt.Errorf("EventRunDefaultImpl failed with: %d", i) + if err := libvirt.EventRunDefaultImpl(); err != nil { + errorChan <- errors.Wrapf(err, "EventRunDefaultImpl failed") return } //log.Printf("EventRunDefaultImpl looped!")