qemu: process: Report better error when virtlogd connection fails

When connecting to virtlogd fails e.g. due to wrong libvirtd selinux
process label we'd report an utterly useless error message:

$ virsh start upstream
error: Failed to start domain upstream
error: Cannot recv data: Connection reset by peer

Use virLastErrorPrefixMessage in the correct place to give a better
sense of what's going on:

$ virsh start upstream
error: Failed to start domain upstream
error: can't connect to virtlogd: Cannot recv data: Connection reset by peer

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2019-06-11 13:58:29 +02:00
parent 5fa5cc37fe
commit d9536f5cff

View File

@ -6641,8 +6641,10 @@ qemuProcessLaunch(virConnectPtr conn,
VIR_DEBUG("Creating domain log file");
if (!(logCtxt = qemuDomainLogContextNew(driver, vm,
QEMU_DOMAIN_LOG_CONTEXT_MODE_START)))
QEMU_DOMAIN_LOG_CONTEXT_MODE_START))) {
virLastErrorPrefixMessage("%s", _("can't connect to virtlogd"));
goto cleanup;
}
logfile = qemuDomainLogContextGetWriteFD(logCtxt);
if (qemuProcessGenID(vm, flags) < 0)