On Wed, Oct 19, 2011 at 04:42:55PM +0200, Michal Privoznik wrote:
This is a 3rd version of patches [1].
Diff to v2 includes Daniel's review and some other improvements.
The aim of these patches is to mark CDROM and floppy optional,
thus they might get dropped during migration, domain startup,
restore, etc. The granularity is set on disk level, so user
can decide which cd-roms are important and which not.
There are 3 levels of optionality:
- mandatory - fail if missing for any reason (the default)
- requisite - fail if missing on boot up, drop if missing on
migrate/restore/revert
- optional - drop if missing at any start attempt.
To assign a disk one of these, just append 'on_missing' attribute
to its <source>.
If a domain is then eventually started (migrated, restored, whatever),
we check for source path being accessible (currently only qemu driver
is supported) from hypervisor's POV. This is done by virFileAccessibleAs()
function. Currently, only uid+gid are considered. Ideally, this
should be extended to SElinux labeling and cgroups.
1:
https://www.redhat.com/archives/libvir-list/2011-October/msg00032.html
Michal Privoznik (4):
conf: Introduce optional on_missing attribute for cdrom and floppy
util: Create virFileAccessibleAs function
qemu: implement on_missing
on_missing: Emit event on disk source dropping
daemon/remote.c | 37 ++++++++++
docs/formatdomain.html.in | 26 ++++++-
docs/schemas/domaincommon.rng | 22 +++++-
examples/domain-events/events-c/event-test.c | 27 +++++++-
examples/domain-events/events-python/event-test.py | 4 +
include/libvirt/libvirt.h.in | 28 +++++++
python/libvirt-override-virConnect.py | 9 +++
python/libvirt-override.c | 51 +++++++++++++
src/conf/domain_conf.c | 43 ++++++++++-
src/conf/domain_conf.h | 11 +++
src/conf/domain_event.c | 50 +++++++++++++
src/conf/domain_event.h | 7 ++
src/libvirt_private.syms | 4 +
src/qemu/qemu_domain.c | 73 +++++++++++++++++++
src/qemu/qemu_domain.h | 4 +
src/qemu/qemu_process.c | 4 +
src/remote/remote_driver.c | 34 +++++++++
src/remote/remote_protocol.x | 9 ++-
src/remote_protocol-structs | 5 ++
src/util/util.c | 76 ++++++++++++++++++++
src/util/util.h | 3 +
.../qemuxml2xmlout-disk-cdrom-empty.xml | 31 ++++++++
22 files changed, 548 insertions(+), 10 deletions(-)
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-cdrom-empty.xml
ACK to the patch set, error "something is tragically wrong" in patch
3 is rather uninformative, I agree it should not occur, but still could
you merge in something a bit more contectual here before the push :-) ?
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/