From e5a84d74a2789a917bf394f15de9989ec48fded0 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 17 Oct 2011 16:54:03 +0200 Subject: [PATCH] conf: Introduce optional startupPolicy attribute for cdrom and floppy This attribute says what to do with cdrom (or floppy) if the source is missing. It accepts: - 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. However, this patch introduces only XML part of this new functionality. --- docs/formatdomain.html.in | 26 ++++++++++- docs/schemas/domaincommon.rng | 22 ++++++++-- src/conf/domain_conf.c | 43 +++++++++++++++++-- src/conf/domain_conf.h | 11 +++++ src/libvirt_private.syms | 2 + .../qemuxml2xmlout-disk-cdrom-empty.xml | 31 +++++++++++++ 6 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-cdrom-empty.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index dc6b1526c..fcffb2518 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -891,7 +891,7 @@ <devices> <disk type='file' snapshot='external'> <driver name="tap" type="aio" cache="default"/> - <source file='/var/lib/xen/images/fv0'/> + <source file='/var/lib/xen/images/fv0'/ startupPolicy='optional'> <target dev='hda' bus='ide'/> <boot order='2'/> <encryption type='...'> @@ -962,7 +962,29 @@ "network", the source may have zero or more host sub-elements used to specify the hosts to connect. - Since 0.0.3 + Since 0.0.3 + For "file" disk type which represents cdrom or floppy + (the device attribute) it is possible to define + policy what to do with disk if source is not accessible. + This is done by startupPolicy attribute accepting + these values: + + + + + + + + + + + + + +
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
+ Since 0.9.7 +
target
The target element controls the bus / device under which the disk is exposed to the guest diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index cd1a067a8..08cc64f6d 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -665,6 +665,17 @@ + + + + + mandatory + requisite + optional + + + +