mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Check return status for virUUIDGenerate
Although legal, a few paths were not checking a return value < 0 for failure instead they checked a non zero failure. Clean them all up to be consistent. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
31daccf5a5
commit
da613819e9
@ -18801,7 +18801,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
||||
* also serve as the uuid. */
|
||||
tmp = virXPathString("string(./uuid[1])", ctxt);
|
||||
if (!tmp) {
|
||||
if (virUUIDGenerate(def->uuid)) {
|
||||
if (virUUIDGenerate(def->uuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("Failed to generate UUID"));
|
||||
goto error;
|
||||
|
@ -1619,7 +1619,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
|
||||
/* Extract network uuid */
|
||||
tmp = virXPathString("string(./uuid[1])", ctxt);
|
||||
if (!tmp) {
|
||||
if (virUUIDGenerate(def->uuid)) {
|
||||
if (virUUIDGenerate(def->uuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("Failed to generate UUID"));
|
||||
goto error;
|
||||
|
@ -177,7 +177,7 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
|
||||
|
||||
uuidstr = virXPathString("string(./uuid)", ctxt);
|
||||
if (!uuidstr) {
|
||||
if (virUUIDGenerate(def->uuid)) {
|
||||
if (virUUIDGenerate(def->uuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("Failed to generate UUID"));
|
||||
goto cleanup;
|
||||
|
@ -1019,7 +1019,7 @@ openvzSetUUID(int vpsid)
|
||||
{
|
||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||
|
||||
if (virUUIDGenerate(uuid)) {
|
||||
if (virUUIDGenerate(uuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Failed to generate UUID"));
|
||||
return -1;
|
||||
|
@ -202,7 +202,7 @@ xenConfigGetUUID(virConfPtr conf, const char *name, unsigned char *uuid)
|
||||
}
|
||||
|
||||
if (!(val = virConfGetValue(conf, name))) {
|
||||
if (virUUIDGenerate(uuid)) {
|
||||
if (virUUIDGenerate(uuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("Failed to generate UUID"));
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user