resources: virt: Update to new function signature
This changed in git master, and is now more idiomatic.
This commit is contained in:
@@ -78,9 +78,8 @@ func NewVirtRes(name string, uri, state string, transient bool, cpus uint, memor
|
|||||||
// Init runs some startup code for this resource.
|
// Init runs some startup code for this resource.
|
||||||
func (obj *VirtRes) Init() error {
|
func (obj *VirtRes) Init() error {
|
||||||
if !libvirtInitialized {
|
if !libvirtInitialized {
|
||||||
// TODO: update if https://github.com/rgbkrk/libvirt-go/pull/115 gets merged.
|
if err := libvirt.EventRegisterDefaultImpl(); err != nil {
|
||||||
if i := libvirt.EventRegisterDefaultImpl(); i != 0 {
|
return errors.Wrapf(err, "EventRegisterDefaultImpl failed")
|
||||||
return fmt.Errorf("EventRegisterDefaultImpl failed with: %d", i)
|
|
||||||
}
|
}
|
||||||
libvirtInitialized = true
|
libvirtInitialized = true
|
||||||
}
|
}
|
||||||
@@ -140,9 +139,8 @@ func (obj *VirtRes) Watch(processChan chan event.Event) error {
|
|||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
//log.Printf("EventRunDefaultImpl started!")
|
//log.Printf("EventRunDefaultImpl started!")
|
||||||
// TODO: update if https://github.com/rgbkrk/libvirt-go/pull/115 gets merged.
|
if err := libvirt.EventRunDefaultImpl(); err != nil {
|
||||||
if i := libvirt.EventRunDefaultImpl(); i != 0 {
|
errorChan <- errors.Wrapf(err, "EventRunDefaultImpl failed")
|
||||||
errorChan <- fmt.Errorf("EventRunDefaultImpl failed with: %d", i)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//log.Printf("EventRunDefaultImpl looped!")
|
//log.Printf("EventRunDefaultImpl looped!")
|
||||||
|
|||||||
Reference in New Issue
Block a user