virt-install: allow to specify "startupPolicy" for --disk

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2013-10-03 14:58:56 +02:00
parent f5a7476497
commit 8e85840546
3 changed files with 8 additions and 0 deletions

View File

@ -517,6 +517,11 @@ Serial number of the emulated disk device. This is used in linux guests
to set /dev/disk/by-id symlinks. An example serial number might be:
WD-WMAP9A966149
=item B<startup_policy>
It defines what to do with the disk if the source file is not accessible. See
possible values in L<http://www.libvirt.org/formatdomain.html#elementsDisks>
=back
See the examples section for some uses. This option deprecates C<--file>,

View File

@ -655,6 +655,8 @@ c.add_invalid("--disk %(COLLIDE)s") # Colliding storage without --force
c.add_invalid("--disk /dev/default-pool/backing.img") # Colliding storage via backing store
c.add_invalid("--disk %(DIR)s,device=cdrom") # Dir without floppy
c.add_invalid("--disk %(EXISTIMG1)s,driver_name=foobar,driver_type=foobaz") # Unknown driver name and type options (as of 1.0.0)
c.add_valid("--disk path=%(EXISTIMG1)s,startup_policy=optional") # Existing disk, startupPolicy
c.add_invalid("--disk path=%(EXISTIMG1)s,startup_policy=Foo") # Existing disk, invalid startupPolicy
c = vinst.add_category("redirdev", "--noautoconsole --nographics --nodisks --pxe")

View File

@ -1462,6 +1462,7 @@ def parse_disk(guest, optstr, dev=None, validate=True):
set_param("error_policy", "error_policy")
set_param("serial", "serial")
set_param("target", "target")
set_param("sourceStartupPolicy", "startup_policy")
_check_leftover_opts(opts)
if validate: