qemu_hotplug: Create chardev files before attempting to relabel them
qemu_hotplug: Create chardev files before attempting to relabel them

When hotplugging a chardev, Libvirt opens corresponding
file/binds to a socket/does whatever necessary to obtain an FD
that is later passed to QEMU. However, due to wrong placement of
the function that does all of this
(qemuProcessPrepareHostBackendChardevHotplug()) it may happen
that a file is set seclabel on, only to be unlink()-ed and
created again (the former is done by
qemuSecuritySetChardevLabel(), the latter by aforementioned
function). The unlink()-ing is done for UNIX sockets with
mode='bind' and happens inside qemuOpenChrChardevUNIXSocket().
However, these steps can be swapped simply.

Fixes: ad81aa8ad07e52c9bd4840de84d2ed59998b4d2a
Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Kristina Hanicova <e70d889c982bbe3b9ce2841af457ca911bff1baa@redhat.com>

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