[go PATCH 2/8] Add missing error reporting when setting typed parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 connect.go |  3 +++
 domain.go  | 24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/connect.go b/connect.go
index 8cc7cc7..5044def 100644
--- a/connect.go
+++ b/connect.go
@@ -2017,6 +2017,9 @@ func (c *Connect) SetMemoryParameters(params *NodeMemoryParameters, flags uint32
 	}
 
 	ret = C.virNodeSetMemoryParametersWrapper(c.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
diff --git a/domain.go b/domain.go
index 07b9697..b39de47 100644
--- a/domain.go
+++ b/domain.go
@@ -1312,6 +1312,9 @@ func (d *Domain) SetInterfaceParameters(device string, params *DomainInterfacePa
 	}
 
 	ret = C.virDomainSetInterfaceParametersWrapper(d.ptr, cdevice, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
@@ -2658,6 +2661,9 @@ func (d *Domain) SetBlkioParameters(params *DomainBlkioParameters, flags DomainM
 	}
 
 	ret = C.virDomainSetBlkioParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
@@ -2850,6 +2856,9 @@ func (d *Domain) SetBlockIoTune(disk string, params *DomainBlockIoTuneParameters
 	}
 
 	ret = C.virDomainSetBlockIoTuneWrapper(d.ptr, cdisk, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
@@ -3330,6 +3339,9 @@ func (d *Domain) SetMemoryParameters(params *DomainMemoryParameters, flags Domai
 	}
 
 	ret = C.virDomainSetMemoryParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
@@ -3408,6 +3420,9 @@ func (d *Domain) SetNumaParameters(params *DomainNumaParameters, flags DomainMod
 	}
 
 	ret = C.virDomainSetNumaParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
@@ -3605,6 +3620,9 @@ func (d *Domain) SetPerfEvents(params *DomainPerfEvents, flags DomainModificatio
 	}
 
 	ret = C.virDomainSetPerfEventsWrapper(d.ptr, cparams, nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
@@ -3799,6 +3817,9 @@ func (d *Domain) SetSchedulerParameters(params *DomainSchedulerParameters) error
 	}
 
 	ret = C.virDomainSetSchedulerParametersWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
@@ -3832,6 +3853,9 @@ func (d *Domain) SetSchedulerParametersFlags(params *DomainSchedulerParameters,
 	}
 
 	ret = C.virDomainSetSchedulerParametersFlagsWrapper(d.ptr, (*C.virTypedParameter)(unsafe.Pointer(&cparams[0])), nparams, C.uint(flags), &err)
+	if ret == -1 {
+		return makeError(&err)
+	}
 
 	return nil
 }
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux