]> git.ipfire.org Git - thirdparty/libvirt.git/commit
build: add compiler attributes to virUUIDParse
authorEric Blake <eblake@redhat.com>
Wed, 12 Oct 2011 23:24:52 +0000 (17:24 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 13 Oct 2011 18:23:37 +0000 (12:23 -0600)
commit430156cf32a6c0db054a527fd1cdeebf90d1ce47
treef1e9d412bc23781c817be470d06aef8a8465f5ec
parent72851bb9ef0a6aef20141d0a13c36e5a1907a43a
build: add compiler attributes to virUUIDParse

Coverity complained that most, but not all, clients of virUUIDParse
were checking for errors.  Silence those coverity warnings by
explicitly marking the cases where we trust the input, and fixing
one instance that really should have been checking.  In particular,
this silences a rather large percentage of the warnings I saw on my
most recent Coverity analysis run.

* src/util/uuid.h (virUUIDParse): Enforce rules.
* src/util/uuid.c (virUUIDParse): Drop impossible check; at least
Coverity will detect if we break rules and pass NULL.
* src/xenapi/xenapi_driver.c (xenapiDomainCreateXML)
(xenapiDomainLookupByID, xenapiDomainLookupByName)
(xenapiDomainDefineXML): Ignore return when we trust data source.
* src/vbox/vbox_tmpl.c (nsIDtoChar, vboxIIDToUUID_v3_x)
(vboxCallbackOnMachineStateChange)
(vboxCallbackOnMachineRegistered, vboxStoragePoolLookupByName):
Likewise.
* src/node_device/node_device_hal.c (gather_system_cap): Likewise.
* src/xenxs/xen_sxpr.c (xenParseSxpr): Check for errors.
src/node_device/node_device_hal.c
src/util/uuid.c
src/util/uuid.h
src/vbox/vbox_tmpl.c
src/xenapi/xenapi_driver.c
src/xenxs/xen_sxpr.c