src: set identity when opening secondary drivers
src: set identity when opening secondary drivers

The drivers can all call virGetConnectXXX to open a connection to a
secondary driver. For example, when creating a encrypted storage volume,
the storage driver has to open a secret driver connection, or when
starting a guest, the QEMU driver has to open the network driver to
lookup a virtual network.

When using monolithic libvirtd, the connection has the same effective
identity as the client, since everything is still in the same process.
When using the modular daemons, however, the remote daemon sees the
identity of the calling daemon. This is a mistake as it results in
the modular daemons seeing the client with elevated privileges.

We need to pass on the current identity explicitly when opening the
secondary drivers. This is the same thing that is done by daemon RPC
dispatcher code when it is directly forwarding top level API calls
from virtproxyd and other daemons.

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

zippy2/libvirt,zippy2/libvirt,crobinso/libvirt,libvirt/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt,olafhering/libvirt,jfehlig/libvirt,olafhering/libvirt,libvirt/libvirt,nertpinx/libvirt,libvirt/libvirt,nertpinx/libvirt,jfehlig/libvirt,nertpinx/libvirt,olafhering/libvirt,jfehlig/libvirt,libvirt/libvirt,crobinso/libvirt,nertpinx/libvirt,zippy2/libvirt,jfehlig/libvirt,nertpinx/libvirt,crobinso/libvirt