From 8e8584054610c7e77f921b5c2585f0b02119101b Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 3 Oct 2013 14:58:56 +0200 Subject: [PATCH] virt-install: allow to specify "startupPolicy" for --disk Signed-off-by: Giuseppe Scrivano --- man/virt-install.pod | 5 +++++ tests/clitest.py | 2 ++ virtinst/cli.py | 1 + 3 files changed, 8 insertions(+) diff --git a/man/virt-install.pod b/man/virt-install.pod index 74caf021..930623e9 100644 --- a/man/virt-install.pod +++ b/man/virt-install.pod @@ -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 + +It defines what to do with the disk if the source file is not accessible. See +possible values in L + =back See the examples section for some uses. This option deprecates C<--file>, diff --git a/tests/clitest.py b/tests/clitest.py index fbd8e205..0abd8d18 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -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") diff --git a/virtinst/cli.py b/virtinst/cli.py index 573f3269..b6e7e57c 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -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: