Our coding style specifies that only negative values are considered as
error. Check for return value of virDomainDiskInsert() properly,
following the style. Not that the function can now return anything other
than 0 or -1, but it just triggers my OCD.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
_("target %s already exists."), disk->dst);
return -1;
}
- if (virDomainDiskInsert(vmdef, disk))
+ if (virDomainDiskInsert(vmdef, disk) < 0)
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
_("target %s already exists."), disk->dst);
return -1;
}
- if (virDomainDiskInsert(vmdef, disk))
+ if (virDomainDiskInsert(vmdef, disk) < 0)
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
return -1;
if (qemuCheckDiskConfig(disk, NULL) < 0)
return -1;
- if (virDomainDiskInsert(vmdef, disk))
+ if (virDomainDiskInsert(vmdef, disk) < 0)
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;