journalctl: make "journalctl /dev/sda" work
authorMichal Sekletar <msekleta@redhat.com>
Mon, 1 Feb 2016 09:44:58 +0000 (10:44 +0100)
committerMichal Sekletar <msekleta@redhat.com>
Tue, 2 Feb 2016 15:46:28 +0000 (16:46 +0100)
commit795ab08f783e78e85f1493879f13ac44cb113b00
tree6956a70d565ef6665410640f79bb1d61fcc6d1eb
parentdcabda41558bf80724992d3973388af6974af5eb
journalctl: make "journalctl /dev/sda" work

Currently when journalctl is called with path to block device node we
add following match _KERNEL_DEVICE=b$MAJOR:$MINOR.

That is not sufficient to actually obtain logs about the disk because
dev_printk() kernel helper puts to /dev/kmsg information about the
device in following format, +$SUBSYSTEM:$ADDRESS,
e.g. "+pci:pci:0000:00:14.0".

Now we will walk upward the syspath and add match for every device in
format produced by dev_printk() as well as match for its device node if
it exists.
Makefile.am
src/journal/journalctl.c