]> xenbits.xensource.com Git - libvirt.git/commit
storage: netfs: Handle backend errors
authorJohn Ferlan <jferlan@redhat.com>
Wed, 9 Apr 2014 16:17:39 +0000 (12:17 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 16 Apr 2014 11:32:17 +0000 (07:32 -0400)
commit4090e15399672c74227dcebc19d91b151d5d049f
tree7179eae68e7bf44e12cb8060531890492e157d46
parent8fb446754deda2f9d953eeb854a5aa050c8599f5
storage: netfs: Handle backend errors

Commit id '18642d10' caused a virt-test regression for NFS backend
storage error path checks when running the command:

    'virsh find-storage-pool-sources-as netfs Unknown  '

when the host did not have Gluster installed. Prior to the commit,
the test would fail with the error:

    error: internal error: Child process (/usr/sbin/showmount --no-headers
    --exports Unknown) unexpected exit status 1: clnt_create: RPC: Unknown host

After the commit, the error would be ignored, the call would succeed,
and an empty list of pool sources returned. This was tucked into the
commit message as an expected outcome.

When the target host does not have a GLUSTER_CLI this is a regression
over the previous release. Furthermore, even if Gluster CLI was present,
but had a failure to get devices, the API would return a failure even if
the NFS backend had found devices.

Modify the logic to return failure when the NFS backend check fails and
there's no GLUSTER_CLI or when both backend checks fail.

If either returns success and GLUSTER_CLI is defined, then fetch and return
a list of source devices even if it's empty
src/storage/storage_backend_fs.c