#907440 libvirt-daemon: libvirtd spams host logs with `cant open .../memory.memsw.usage_in_bytes'

Package:
libvirt-daemon
Source:
libvirt
Description:
Virtualization daemon
Submitter:
Date:
2021-02-26 18:33:05 UTC
Severity:
minor
#907440#5
Date:
2018-08-28 03:19:12 UTC
From:
To:
Dear Maintainer,
I'm running lots of containerised systems using libvirt-lxc.  The systems run
on a machine with more than 300Gb RAM, and no swap.  So I haven't enabled swap
accounting on the host kernel.

Every few seconds, I see a pair of messages like this in the logs for each
container on the system:
   Aug 28 12:00:21 hostname libvirtd[39700]: 2018-08-28 02:00:21.467+0000: 39707: error : virFileReadAll:1434 : Failed to open file '/sys/fs/cgroup/memory/machine/lxc-41320-containername.libvirt-lxc/memory.memsw.usage_in_bytes': No such file or directory
   Aug 28 12:00:21 hostname libvirtd[39700]: 2018-08-28 02:00:21.467+0000: 39707: error : virCgroupGetValueStr:819 : Unable to read from '/sys/fs/cgroup/memory/machine/lxc-41320-containername.libvirt-lxc/memory.memsw.usage_in_bytes': No such file or directory

I expect a single warning message when each container is started, then nothing.
The swap accounting files aren't magically going to appear without a reboot.

Peter C

#907440#10
Date:
2021-02-26 18:28:30 UTC
From:
To:
I can confirm this is the case, and that this bug has lingered without
a reply for two years and a half already :-(

The log flooding happens only when virt-manager is open (because it
keeps polling several files for displaying the guests' status). The
messages also appear when querying for specific information using
virsh:

    # dommemstat --domain sirf
    error: Failed to get memory statistics for domain sirf
    error: Unable to read from '/sys/fs/cgroup/memory/machine/lxc-29895-sirf.libvirt-lxc/memory.memsw.usage_in_bytes': No such file or directory

Curiously, when querying for full domain information, the data y
scorrectly returned:

    virsh # dominfo --domain lafa
    Id:             38611
    Name:           lafa
    UUID:           0d4041d2-327b-42f0-8433-6aeb05beb36b
    OS Type:        exe
    State:          running
    CPU(s):         1
    CPU time:       2374.6s
    Max memory:     2097152 KiB
    Used memory:    1740144 KiB
    Persistent:     yes
    Autostart:      enable
    Managed save:   no
    Security model: apparmor
    Security DOI:   0