• D
    Generate a unique journald log for QEMU capabilities failure · 36ff4ed1
    Daniel P. Berrange 提交于
    When probing QEMU capabilities fails for a binary generate a
    log message with MESSAGE_ID==8ae2f3fb-2dbe-498e-8fbd-012d40afa361.
    
    This can be directly queried from journald based on the UUID
    instead of needing string grep. This lets tools like libguestfs'
    bug reporting tool trivially do automated sanity tests on the
    host they're running on.
    
     $ journalctl MESSAGE_ID=8ae2f3fb-2dbe-498e-8fbd-012d40afa361
     Feb 21 17:11:01 localhost.localdomain lt-libvirtd[9196]:
     Failed to probe capabilities for /bin/qemu-system-alpha:
     internal error: Child process (LC_ALL=C LD_LIBRARY_PATH=
     /home/berrange/src/virt/libvirt/src/.libs PATH=/usr/lib64/
     ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:
     /usr/bin:/root/bin HOME=/root USER=root LOGNAME=root
     /bin/qemu-system-alpha -help) unexpected exit status 127:
     /bin/qemu-system-alpha: error while loading shared libraries:
     libglapi.so.0: cannot open shared object file: No such file
     or directory
    
     $ journalctl MESSAGE_ID=8ae2f3fb-2dbe-498e-8fbd-012d40afa361 --output=json
     { ...snip...
      "LIBVIRT_SOURCE" : "file",
      "PRIORITY" : "3",
      "CODE_FILE" : "qemu/qemu_capabilities.c",
      "CODE_LINE" : "2770",
      "CODE_FUNC" : "virQEMUCapsLogProbeFailure",
      "MESSAGE_ID" : "8ae2f3fb-2dbe-498e-8fbd-012d40afa361",
      "LIBVIRT_QEMU_BINARY" : "/bin/qemu-system-xtensa",
      "MESSAGE" : "Failed to probe capabilities for /bin/qemu-system-xtensa:
       internal error: Child process (LC_ALL=C LD_LIBRARY_PATH=/home/berrange
       /src/virt/libvirt/src/.libs PATH=/usr/lib64/ccache:/usr/local/sbin:
       /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin HOME=/root
       USER=root LOGNAME=root /bin/qemu-system-xtensa -help) unexpected
       exit status 127: /bin/qemu-system-xtensa: error while loading shared
       libraries: libglapi.so.0: cannot open shared object file: No such
        file or directory\n" }
    Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
    36ff4ed1
logging.html.in 12.1 KB