]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix error reporting when fetching SCSI/LVM keys
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Dec 2012 19:10:51 +0000 (19:10 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 13 Dec 2012 15:26:57 +0000 (15:26 +0000)
commit41ac222e52e4435f72dba5f3ec0c4af8c9ceefae
treee4814d0d6d4cc353ba7a160a1fea152748a2fc87
parentf6b5ed5ef0979223dd20a569605c3d3b5c6854cc
Fix error reporting when fetching SCSI/LVM keys

The current  virStorageFileGet{LVM,SCSI}Key methods return
the key as the return value. Unfortunately it is desirable
for "NULL" to be a valid return value, as well as an error
indicator. Thus the returned key must instead be provided
as an out-parameter.

When we invoke lvs or scsi_id to extract ID for block devices,
we don't want virCommandWait logging errors messages. Thus we
must explicitly check 'status != 0', rather than letting
virCommandWait do it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/util/storage_file.c
src/util/storage_file.h