[libvirt] [PATCH v7 01/23] snapshot: Drop pointless function virDomainMomentIsCurrentName
Eric Blake
eblake at redhat.com
Wed Mar 27 13:20:37 UTC 2019
On 3/27/19 6:38 AM, Ján Tomko wrote:
> On Wed, Mar 27, 2019 at 05:10:32AM -0500, Eric Blake wrote:
>> The qemu driver already had a full-blown virDomainMomentObjPtr to
>> check against, and the test driver ought to have one since we get
>> better error checking that the user passed in a valid object. Removes
>> a helper function added in commit commit 4819f54b.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>> @@ -6249,14 +6249,19 @@
>> testDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
>> {
>> virDomainObjPtr vm = NULL;
>> int ret;
>
> ret = -1;
>
> otherwise clang complains:
> test/test_driver.c:6259:9: error: variable 'ret' is used uninitialized
> whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
> if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> test/test_driver.c:6266:12: note: uninitialized use occurs here
> return ret;
> ^~~
> test/test_driver.c:6259:5: note: remove the 'if' if its condition is
> always false
> if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> test/test_driver.c:6251:12: note: initialize the variable 'ret' to
> silence this warning
> int ret;
> ^
> = 0
> 1 error generated.
>
> Jano
Yep, fixed and pushed 1-3 to get them out of the way.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190327/7238f5db/attachment-0001.sig>
More information about the libvir-list
mailing list