• J
    test: Adjust cleanup/error paths for nodedev test APIs · c4ff1a18
    John Ferlan 提交于
     - In testDestroyVport rather than use a cleanup label, just return -1
       immediately since nothing else is needed.
    
     - In testStoragePoolDestroy, if !privpool, then just return -1 since
       nothing else will happen anyway.
    
     - Rather than "goto cleanup;" on failure to virNodeDeviceObjFindByName
       an @obj, just return directly.  This then allows the cleanup: label code
       to not have to check "if (obj)" before calling virNodeDeviceObjUnlock.
       This also simplifies some exit logic...
    
     - In testNodeDeviceObjFindByName use an error: label to handle the failure
       and don't do the ncaps++ within the VIR_STRDUP() source target index.
       Only increment ncaps after success. Easier on eyes at error label too.
    
     - In testNodeDeviceDestroy use "cleanup" rather than "out" for the goto
    Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
    c4ff1a18
test_driver.c 198.0 KB