]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Fix qemuDomainObjTaint with virtlogd
authorJiri Denemark <jdenemar@redhat.com>
Thu, 5 Sep 2019 13:35:35 +0000 (15:35 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 5 Sep 2019 15:09:34 +0000 (17:09 +0200)
commitf709377301b919a9fcbfc366e33057f7848bee28
treeb3039e998779956424230e0efc12b707b5b95ffb
parent267699a03cc38810dcd40f4ddbf864bd0dc29d4e
qemu: Fix qemuDomainObjTaint with virtlogd

When virtlogd is used to capture QEMU's stdout, qemuDomainObjTaint would
always fail to write the message to the log file when QEMU is already
running (i.e., outside qemuProcessLaunch). This can happen during device
hotplug or by sending a custom QEMU guest agent command:

    warning : qemuDomainObjTaint:8757 : Domain id=9 name='blaf'
        uuid=9cfa4e37-2930-405b-bcb4-faac1829dad8 is tainted:
        custom-ga-command
    error : virLogHandlerDomainOpenLogFile:388 : Cannot open log file:
        '/var/log/libvirt/qemu/blaf.log': Device or resource busy
    error : virNetClientProgramDispatchError:172 : Cannot open log file:
        '/var/log/libvirt/qemu/blaf.log': Device or resource busy

The fix is easy, we just need to use the right API for appending a
message to QEMU log file instead of creating a new log context.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c