This is v2 of:
https://www.redhat.com/archives/libvir-list/2016-October/msg01151.html
diff to v1:
- Added udev rule (patch 18/19)
- Wire the beast into spec file
- Introduced a configure argument that suppress installation of this feature
One of the problems here is that this requires patched udev:
https://github.com/systemd/systemd/commit/4f985bd80278972912b80df1390f84d...
This is going to be part of systemd-232 release. Therefore, in my code I've put
checks for 232 version.
Michal Privoznik (19):
virseclabel.h: Include stdbool.h
virseclabel: Introduce virSecurityDeviceLabelDefNewLabel
security_dac: Pass manager to virSecurityDACSetImageLabel
security_dac: Pass manager to virSecurityDACRestoreFileLabelInternal
virudev: Introduce basic skeleton
virudev: Implement virUdevMgrAddLabel and virUdevMgrRemoveAllLabels
virudev: Introduce virUdevMgrDump
tests: Introduce virudevtest
virudev: Parse virUdevMgr from JSON
virudev: Introduce virUdevMgrLookupLabels
util: Introduce libvirt_udevhelper
security: Wire up virUdevMgr
qemu.conf: Introduce write_udev
qemu: Wire up virUdevMgr
qemu: Reload virUdevMgr on start
virudevtest: Introduce device filtering
qemu: Filter uninteresting paths for virUdevMgr
udev: Introduce rule
spec: Install udev helper/rule more cleanly
daemon/99-libvirt.rules | 12 +
daemon/Makefile.am | 22 +-
libvirt.spec.in | 26 ++
m4/virt-udev.m4 | 26 ++
po/POTFILES.in | 2 +
src/Makefile.am | 25 ++
src/libvirt_private.syms | 15 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 5 +
src/qemu/qemu_conf.c | 3 +
src/qemu/qemu_conf.h | 5 +
src/qemu/qemu_domain.c | 12 +-
src/qemu/qemu_domain.h | 3 +-
src/qemu/qemu_driver.c | 40 +-
src/qemu/qemu_hotplug.c | 35 +-
src/qemu/qemu_process.c | 47 ++-
src/qemu/qemu_process.h | 3 +
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/security/security_dac.c | 103 ++++--
src/security/security_manager.c | 16 +
src/security/security_manager.h | 5 +
src/security/security_selinux.c | 47 ++-
src/util/udevhelper.c | 137 +++++++
src/util/virseclabel.c | 14 +
src/util/virseclabel.h | 6 +
src/util/virudev.c | 588 ++++++++++++++++++++++++++++++
src/util/virudev.h | 63 ++++
tests/Makefile.am | 12 +
tests/virudevmock.c | 29 ++
tests/virudevtest.c | 312 ++++++++++++++++
tests/virudevtestdata/complex.json | 30 ++
tests/virudevtestdata/empty.json | 5 +
tests/virudevtestdata/simple-dac.json | 13 +
tests/virudevtestdata/simple-selinux.json | 13 +
34 files changed, 1619 insertions(+), 57 deletions(-)
create mode 100644 daemon/99-libvirt.rules
create mode 100644 src/util/udevhelper.c
create mode 100644 src/util/virudev.c
create mode 100644 src/util/virudev.h
create mode 100644 tests/virudevmock.c
create mode 100644 tests/virudevtest.c
create mode 100644 tests/virudevtestdata/complex.json
create mode 100644 tests/virudevtestdata/empty.json
create mode 100644 tests/virudevtestdata/simple-dac.json
create mode 100644 tests/virudevtestdata/simple-selinux.json
--
2.8.4