locking: Remove unnecessary setting of lockspace

In virLockSpaceProtocolDispatchNew() the returned value of lockspace from
virLockDaemonFindLockSpace() is overwritten by the virLockSpaceNew() return.
Coverity complains that it's unused.

In virLockSpaceProtocolDispatchCreateLockSpace() lockspace is also overwritten
in a similar manner resulting in the same Coverity message.
This commit is contained in:
John Ferlan 2013-01-15 13:38:16 -05:00 committed by Peter Krempa
parent a75d762fcd
commit e8cd571b2c

View File

@ -227,7 +227,7 @@ virLockSpaceProtocolDispatchNew(virNetServerPtr server ATTRIBUTE_UNUSED,
goto cleanup;
}
if ((lockspace = virLockDaemonFindLockSpace(lockDaemon, args->path))) {
if (virLockDaemonFindLockSpace(lockDaemon, args->path) != NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Lockspace for path %s already exists"),
args->path);
@ -406,7 +406,7 @@ virLockSpaceProtocolDispatchCreateLockSpace(virNetServerPtr server ATTRIBUTE_UNU
goto cleanup;
}
if ((lockspace = virLockDaemonFindLockSpace(lockDaemon, args->path))) {
if (virLockDaemonFindLockSpace(lockDaemon, args->path) != NULL) {
virReportError(VIR_ERR_OPERATION_INVALID,
_("Lockspace for path %s already exists"),
args->path);