tools: fix double error reporting in virt-login-shell
tools: fix double error reporting in virt-login-shell

The public API entry points will call virDispatchError which
will print to stderr by default. We then jump to a cleanup
path which calls virDispatchError again.

We tried to stop the entry points printing to stderr, but
incorrectly called virSetErrorFunc. It needs a real function
that is a no-op, not a NULL function.

Once we fix virSetErrorFunc, then we need to use fprintf in
the cleanup path instead of virDispatchError.

Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Signed-off-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>

crobinso/libvirt,crobinso/libvirt,olafhering/libvirt,andreabolognani/libvirt,nertpinx/libvirt,libvirt/libvirt,nertpinx/libvirt,crobinso/libvirt,zippy2/libvirt,zippy2/libvirt,jardasgit/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,zippy2/libvirt,jardasgit/libvirt,jardasgit/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,crobinso/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,libvirt/libvirt,andreabolognani/libvirt,olafhering/libvirt,libvirt/libvirt,jfehlig/libvirt,nertpinx/libvirt,libvirt/libvirt,jardasgit/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,zippy2/libvirt,olafhering/libvirt,olafhering/libvirt,nertpinx/libvirt