tests: avoid test failure on rawhide gnutls
tests: avoid test failure on rawhide gnutls

I hit a VERY weird testsuite failure on rawhide, which included
_binary_ output to stderr, followed by a hang waiting for me
to type something! (Here, using ^@ for NUL):

$ ./commandtest
TEST: commandtest
      WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
.WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
.WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
.8^@^@^@8^@^@^@^A^@^@^@^Bay^A^@^@^@)PRIVATE-GNOME-KEYRING-PKCS11-PROTOCOL-V-1

I finally traced it to the fact that gnome-keyring, called via
gnutls_global_init which is turn called by virNetTLSInit, opens
an internal fd that it expects to communicate to via a
pthread_atfork handler (never mind that it violates POSIX by
using non-async-signal-safe functions in that handler:
https://bugzilla.redhat.com/show_bug.cgi?id=772320).

Our problem stems from the fact that we pulled the rug out from
under the library's expectations by closing an fd that it had
just opened.  While we aren't responsible for fixing the bugs
in that pthread_atfork handler, we can at least avoid the bugs
by not closing the fd in the first place.

* tests/commandtest.c (mymain): Avoid closing fds that were opened
by virInitialize.

agx/libvirt,iam-TJ/libvirt,jfehlig/libvirt,novel/fbsd-libvirt,olafhering/libvirt,zippy2/libvirt,rmarwaha/libvirt,cbosdo/libvirt,agx/libvirt,bjzhang/libvirt,andreabolognani/libvirt,agx/libvirt,andreabolognani/libvirt,nertpinx/libvirt,wiedi/libvirt,zhlcindy/libvirt-1.1.4-maintain,jfehlig/libvirt,iam-TJ/libvirt,novel/fbsd-libvirt,wiedi/libvirt,bjzhang/libvirt,trainstack/libvirt,shugaoye/libvirt,taget/libvirt,zippy2/libvirt,elmarco/libvirt,rmarwaha/libvirt,libvirt/libvirt,rlaager/libvirt,fabianfreyer/libvirt,eskultety/libvirt,taget/libvirt,zhlcindy/libvirt-1.1.4-maintain,datto/libvirt,VenkatDatta/libvirt,eskultety/libvirt,novel/fbsd-libvirt,iam-TJ/libvirt,novel/fbsd-libvirt,emaste/libvirt,shugaoye/libvirt,rmarwaha/libvirt,rmarwaha/libvirt1,novel/fbsd-libvirt,rmarwaha/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,cbosdo/libvirt,jardasgit/libvirt,bjzhang/libvirt,dumbbell/libvirt,andreabolognani/libvirt,danwent/libvirt-ovs,jeckersb/libvirt,olafhering/libvirt,dumbbell/libvirt,zhlcindy/libvirt-1.1.4-maintain,warewolf/libvirt,crobinso/libvirt,taget/libvirt,zippy2/libvirt,taget/libvirt,emaste/libvirt,datto/libvirt,zippy2/libvirt,warewolf/libvirt,jeckersb/libvirt,jardasgit/libvirt,rmarwaha/libvirt1,warewolf/libvirt,danwent/libvirt-ovs,nertpinx/libvirt,eskultety/libvirt,elmarco/libvirt,eskultety/libvirt,crobinso/libvirt,trainstack/libvirt,cbosdo/libvirt,rmarwaha/libvirt,jardasgit/libvirt,siboulet/libvirt-openvz,trainstack/libvirt,foomango/libvirt,fabianfreyer/libvirt,rlaager/libvirt,shugaoye/libvirt,eskultety/libvirt,nertpinx/libvirt,emaste/libvirt,VenkatDatta/libvirt,wiedi/libvirt,taget/libvirt,zhlcindy/libvirt-1.1.4-maintain,datto/libvirt,elmarco/libvirt,iam-TJ/libvirt,foomango/libvirt,novel/fbsd-libvirt,VenkatDatta/libvirt,jardasgit/libvirt,wiedi/libvirt,elmarco/libvirt,jeckersb/libvirt,VenkatDatta/libvirt,emaste/libvirt,rlaager/libvirt,libvirt/libvirt,iam-TJ/libvirt,emaste/libvirt,agx/libvirt,olafhering/libvirt,dumbbell/libvirt,rlaager/libvirt,VenkatDatta/libvirt,trainstack/libvirt,iam-TJ/libvirt,nertpinx/libvirt,nertpinx/libvirt,dumbbell/libvirt,warewolf/libvirt,siboulet/libvirt-openvz,datto/libvirt,emaste/libvirt,olafhering/libvirt,danwent/libvirt-ovs,iam-TJ/libvirt,jeckersb/libvirt,warewolf/libvirt,libvirt/libvirt,agx/libvirt,wiedi/libvirt,shugaoye/libvirt,wiedi/libvirt,trainstack/libvirt,rmarwaha/libvirt1,foomango/libvirt,bjzhang/libvirt,trainstack/libvirt,siboulet/libvirt-openvz,jfehlig/libvirt,novel/fbsd-libvirt,warewolf/libvirt,zhlcindy/libvirt-1.1.4-maintain,datto/libvirt,libvirt/libvirt,bjzhang/libvirt,andreabolognani/libvirt,siboulet/libvirt-openvz,andreabolognani/libvirt,dumbbell/libvirt,foomango/libvirt,cbosdo/libvirt,dumbbell/libvirt,jeckersb/libvirt,shugaoye/libvirt,rmarwaha/libvirt,cbosdo/libvirt,jfehlig/libvirt,novel/fbsd-libvirt,warewolf/libvirt,rmarwaha/libvirt1,danwent/libvirt-ovs,danwent/libvirt-ovs,fabianfreyer/libvirt,jeckersb/libvirt,jeckersb/libvirt,rmarwaha/libvirt1,elmarco/libvirt,crobinso/libvirt,rlaager/libvirt,crobinso/libvirt,foomango/libvirt,emaste/libvirt,rmarwaha/libvirt1,trainstack/libvirt,wiedi/libvirt,fabianfreyer/libvirt,novel/fbsd-libvirt,siboulet/libvirt-openvz