]> git.ipfire.org Git - thirdparty/libvirt.git/commit
test: Make common test*ObjFindByName helpers
authorJohn Ferlan <jferlan@redhat.com>
Sat, 4 Mar 2017 14:16:33 +0000 (09:16 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 6 Mar 2017 12:16:33 +0000 (07:16 -0500)
commit865f479dabb195415c94786400a5f1472b8b3190
tree3e017a1d2f6dcc4e8ac91d1324fc2add147259c5
parent5adbbdc1737e2d290c38a34f5fefe66da54bbf29
test: Make common test*ObjFindByName helpers

Rather than have continued repeated sequences of :

    testDriverLock()
    xxx = vir*ObjFindByName()
    testDriverUnlock()

    if (xxx == NULL) {
        virReportError
        goto cleanup;
    }

Make some common helpers which will use the pattern and make a single
reference using a single common error message.

Altered for Interfaces, Storage Pools, Storage Volumes, and Node Devices.

For each the common error message can now also indicate which 'name' was
not found. For Storage Volumes, the "new" error will be more specific
rather than just invalid argument.
src/test/test_driver.c