Merge lp:~raharper/curtin/trunk.dirty-disks-in-early-command into lp:~curtin-dev/curtin/trunk

Proposed by Ryan Harper
Status: Merged
Merged at revision: 498
Proposed branch: lp:~raharper/curtin/trunk.dirty-disks-in-early-command
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 451 lines (+84/-16)
18 files modified
doc/topics/integration-testing.rst (+5/-0)
examples/tests/allindata.yaml (+4/-0)
examples/tests/basic.yaml (+1/-0)
examples/tests/bcache_basic.yaml (+1/-0)
examples/tests/dirty_disks_config.yaml (+10/-0)
examples/tests/lvm.yaml (+1/-0)
examples/tests/mdadm_bcache.yaml (+3/-0)
examples/tests/mdadm_bcache_complex.yaml (+3/-0)
examples/tests/mirrorboot-uefi.yaml (+0/-12)
examples/tests/mirrorboot.yaml (+2/-0)
examples/tests/raid10boot.yaml (+4/-0)
examples/tests/raid5boot.yaml (+3/-0)
examples/tests/raid6boot.yaml (+4/-0)
tests/vmtests/__init__.py (+30/-1)
tests/vmtests/test_basic.py (+2/-0)
tests/vmtests/test_bcache_basic.py (+2/-0)
tests/vmtests/test_mdadm_bcache.py (+2/-0)
tools/launch (+7/-3)
To merge this branch: bzr merge lp:~raharper/curtin/trunk.dirty-disks-in-early-command
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Scott Moser (community) Approve
Review via email: mp+323179@code.launchpad.net

Description of the change

vmtests: enable tests apply storage config to validate clear_holders path

Allow test classes with storage configurations to optionally run curtin
block-meta during the early stage to "dirty" the disks used in the
test-case. This exercises curtin's clear-holders path to closer match
MAAS redeploying systems with existing storage configurations. In some
cases, we need to run with multiple virtual processors to allow race
conditions to occur and exercise curtin's handling of these situations.

- Add class attribute 'nr_cpus' (integer) to control number of VCPUS used
  in the guest.
  Defaults to 1, allows CURTIN_VMTEST_NR_CPUS env to override for all tests.
- Add class attribute 'dirty_disks' (boolean) to control if a test class
  will enable running the early command.
  Defaults to False
- Add class attribute 'dirty_disk_config' (string) which is path to the
  generic early_command yaml blob used to run curtin block-meta with the
  test-case's storage config.
  Defaults to 'examples/tests/dirty_disks_config.yaml'
- tools/launch accepts --smp to control the number of VCPUS to use in the
  VM

To post a comment you must log in.
498. By Ryan Harper

Remove early_commands from bcache, enable via class attr, whitespace

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) :
review: Approve
499. By Ryan Harper

merge from trunk

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
500. By Ryan Harper

Add wipe: superblock to all storage configs

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
501. By Ryan Harper

Fix mising comma after smp entry in getops long_opts

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
502. By Ryan Harper

merge from trunk

503. By Ryan Harper

Use nr_cpus and dirty_disks to handle regression testing of mirrorboot-uefi

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
504. By Ryan Harper

merge from trunk

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/topics/integration-testing.rst'
--- doc/topics/integration-testing.rst 2017-04-21 18:09:54 +0000
+++ doc/topics/integration-testing.rst 2017-05-15 15:58:10 +0000
@@ -205,6 +205,11 @@
205 This modifies the invocation of nosetets to add '--processes' and other205 This modifies the invocation of nosetets to add '--processes' and other
206 necessary nose arguments (--process-timeout)206 necessary nose arguments (--process-timeout)
207207
208- ``CURTIN_VMTEST_NR_CPUS``: default ''
209
210 Allow environment to override the number of virtual cpus to allocate
211 in the target virtual machines.
212
208- ``IMAGE_DIR``: default /srv/images213- ``IMAGE_DIR``: default /srv/images
209214
210 Vmtest keeps a mirror of maas ephemeral images in this directory.215 Vmtest keeps a mirror of maas ephemeral images in this directory.
211216
=== modified file 'examples/tests/allindata.yaml'
--- examples/tests/allindata.yaml 2016-04-14 01:45:54 +0000
+++ examples/tests/allindata.yaml 2017-05-15 15:58:10 +0000
@@ -4,6 +4,7 @@
4 config:4 config:
5 - id: sda5 - id: sda
6 type: disk6 type: disk
7 wipe: superblock
7 ptable: gpt8 ptable: gpt
8 model: QEMU HARDDISK9 model: QEMU HARDDISK
9 path: /dev/vdb10 path: /dev/vdb
@@ -42,6 +43,7 @@
42 number: 6 # XXX: we really need to stop using id with DiskPartnum43 number: 6 # XXX: we really need to stop using id with DiskPartnum
43 - id: sdb44 - id: sdb
44 type: disk45 type: disk
46 wipe: superblock
45 ptable: gpt47 ptable: gpt
46 model: QEMU HARDDISK48 model: QEMU HARDDISK
47 path: /dev/vdc49 path: /dev/vdc
@@ -64,6 +66,7 @@
64 device: sdb66 device: sdb
65 - id: sdc67 - id: sdc
66 type: disk68 type: disk
69 wipe: superblock
67 ptable: gpt70 ptable: gpt
68 model: QEMU HARDDISK71 model: QEMU HARDDISK
69 path: /dev/vdd72 path: /dev/vdd
@@ -86,6 +89,7 @@
86 device: sdc89 device: sdc
87 - id: sdd90 - id: sdd
88 type: disk91 type: disk
92 wipe: superblock
89 ptable: gpt93 ptable: gpt
90 model: QEMU HARDDISK94 model: QEMU HARDDISK
91 path: /dev/vde95 path: /dev/vde
9296
=== modified file 'examples/tests/basic.yaml'
--- examples/tests/basic.yaml 2016-08-01 17:18:18 +0000
+++ examples/tests/basic.yaml 2017-05-15 15:58:10 +0000
@@ -25,6 +25,7 @@
25 type: format25 type: format
26 fstype: ext426 fstype: ext4
27 volume: sda127 volume: sda1
28 label: 'cloudimg-rootfs'
28 - id: sda2_home29 - id: sda2_home
29 type: format30 type: format
30 fstype: ext431 fstype: ext4
3132
=== modified file 'examples/tests/bcache_basic.yaml'
--- examples/tests/bcache_basic.yaml 2016-04-04 16:03:32 +0000
+++ examples/tests/bcache_basic.yaml 2017-05-15 15:58:10 +0000
@@ -1,4 +1,5 @@
1showtrace: true1showtrace: true
2
2storage:3storage:
3 config:4 config:
4 - id: id_rotary05 - id: id_rotary0
56
=== added file 'examples/tests/dirty_disks_config.yaml'
--- examples/tests/dirty_disks_config.yaml 1970-01-01 00:00:00 +0000
+++ examples/tests/dirty_disks_config.yaml 2017-05-15 15:58:10 +0000
@@ -0,0 +1,10 @@
1early_commands:
2 # running block-meta custom from the install environment
3 # inherits the CONFIG environment, so this works to actually prepare
4 # the disks exactly as in this config before the rest of the install
5 # will just blow it all away. We have clean out other environment
6 # that could unintentionally mess things up.
7 blockmeta: [env, -u, OUTPUT_FSTAB,
8 TARGET_MOUNT_POINT=/tmp/my.bdir/target,
9 WORKING_DIR=/tmp/my.bdir/work.d,
10 curtin, --showtrace, -v, block-meta, --umount, custom]
011
=== modified file 'examples/tests/lvm.yaml'
--- examples/tests/lvm.yaml 2016-04-04 16:03:32 +0000
+++ examples/tests/lvm.yaml 2017-05-15 15:58:10 +0000
@@ -4,6 +4,7 @@
4 config:4 config:
5 - id: sda5 - id: sda
6 type: disk6 type: disk
7 wipe: superblock
7 ptable: msdos8 ptable: msdos
8 model: QEMU HARDDISK9 model: QEMU HARDDISK
9 path: /dev/vdb10 path: /dev/vdb
1011
=== modified file 'examples/tests/mdadm_bcache.yaml'
--- examples/tests/mdadm_bcache.yaml 2016-04-17 22:35:20 +0000
+++ examples/tests/mdadm_bcache.yaml 2017-05-15 15:58:10 +0000
@@ -5,6 +5,7 @@
5 - grub_device: true5 - grub_device: true
6 id: sda6 id: sda
7 type: disk7 type: disk
8 wipe: superblock
8 ptable: gpt9 ptable: gpt
9 model: QEMU HARDDISK10 model: QEMU HARDDISK
10 path: /dev/vdb11 path: /dev/vdb
@@ -53,11 +54,13 @@
53 uuid: deadbeef-dead-beef-dead-deadbeefaaa654 uuid: deadbeef-dead-beef-dead-deadbeefaaa6
54 - id: sdb55 - id: sdb
55 type: disk56 type: disk
57 wipe: superblock
56 model: QEMU HARDDISK58 model: QEMU HARDDISK
57 path: /dev/vdc59 path: /dev/vdc
58 name: second_disk60 name: second_disk
59 - id: sdc61 - id: sdc
60 type: disk62 type: disk
63 wipe: superblock
61 ptable: gpt64 ptable: gpt
62 model: QEMU HARDDISK65 model: QEMU HARDDISK
63 path: /dev/vdd66 path: /dev/vdd
6467
=== modified file 'examples/tests/mdadm_bcache_complex.yaml'
--- examples/tests/mdadm_bcache_complex.yaml 2015-11-25 13:45:53 +0000
+++ examples/tests/mdadm_bcache_complex.yaml 2017-05-15 15:58:10 +0000
@@ -4,6 +4,7 @@
4 - grub_device: true4 - grub_device: true
5 id: sda5 id: sda
6 type: disk6 type: disk
7 wipe: superblock
7 ptable: gpt8 ptable: gpt
8 model: QEMU HARDDISK9 model: QEMU HARDDISK
9 path: /dev/vdb10 path: /dev/vdb
@@ -43,11 +44,13 @@
43 device: sda44 device: sda
44 - id: sdb45 - id: sdb
45 type: disk46 type: disk
47 wipe: superblock
46 model: QEMU HARDDISK48 model: QEMU HARDDISK
47 path: /dev/vdc49 path: /dev/vdc
48 name: second_disk50 name: second_disk
49 - id: sdc51 - id: sdc
50 type: disk52 type: disk
53 wipe: superblock
51 ptable: gpt54 ptable: gpt
52 model: QEMU HARDDISK55 model: QEMU HARDDISK
53 path: /dev/vdd56 path: /dev/vdd
5457
=== modified file 'examples/tests/mirrorboot-uefi.yaml'
--- examples/tests/mirrorboot-uefi.yaml 2017-05-03 02:10:47 +0000
+++ examples/tests/mirrorboot-uefi.yaml 2017-05-15 15:58:10 +0000
@@ -1,16 +1,4 @@
1showtrace: true1showtrace: true
2
3early_commands:
4 # running block-meta custom from the install environment
5 # inherits the CONFIG environment, so this works to actually prepare
6 # the disks exactly as in this config before the rest of the install
7 # will just blow it all away. We have to clean out the other
8 # environment that could unintentionally mess things up.
9 blockmeta: [env, -u, OUTPUT_FSTAB,
10 TARGET_MOUNT_POINT=/tmp/my.bdir/target,
11 WORKING_DIR=/tmp/my.bdir/work.d,
12 curtin, --showtrace, -v, block-meta, --umount, custom]
13
14storage:2storage:
15 config:3 config:
16 - grub_device: true4 - grub_device: true
175
=== modified file 'examples/tests/mirrorboot.yaml'
--- examples/tests/mirrorboot.yaml 2016-04-04 16:03:32 +0000
+++ examples/tests/mirrorboot.yaml 2017-05-15 15:58:10 +0000
@@ -4,6 +4,7 @@
4 config:4 config:
5 - id: sda5 - id: sda
6 type: disk6 type: disk
7 wipe: superblock
7 ptable: gpt8 ptable: gpt
8 model: QEMU HARDDISK9 model: QEMU HARDDISK
9 path: /dev/vdb10 path: /dev/vdb
@@ -20,6 +21,7 @@
20 device: sda21 device: sda
21 - id: sdb22 - id: sdb
22 type: disk23 type: disk
24 wipe: superblock
23 ptable: gpt25 ptable: gpt
24 model: QEMU HARDDISK26 model: QEMU HARDDISK
25 path: /dev/vdc27 path: /dev/vdc
2628
=== modified file 'examples/tests/raid10boot.yaml'
--- examples/tests/raid10boot.yaml 2016-04-04 16:03:32 +0000
+++ examples/tests/raid10boot.yaml 2017-05-15 15:58:10 +0000
@@ -4,6 +4,7 @@
4 config:4 config:
5 - id: sda5 - id: sda
6 type: disk6 type: disk
7 wipe: superblock
7 ptable: gpt8 ptable: gpt
8 model: QEMU HARDDISK9 model: QEMU HARDDISK
9 path: /dev/vdb10 path: /dev/vdb
@@ -20,6 +21,7 @@
20 device: sda21 device: sda
21 - id: sdb22 - id: sdb
22 type: disk23 type: disk
24 wipe: superblock
23 ptable: gpt25 ptable: gpt
24 model: QEMU HARDDISK26 model: QEMU HARDDISK
25 path: /dev/vdc27 path: /dev/vdc
@@ -30,6 +32,7 @@
30 device: sdb32 device: sdb
31 - id: sdc33 - id: sdc
32 type: disk34 type: disk
35 wipe: superblock
33 ptable: gpt36 ptable: gpt
34 model: QEMU HARDDISK37 model: QEMU HARDDISK
35 path: /dev/vdd38 path: /dev/vdd
@@ -40,6 +43,7 @@
40 device: sdc43 device: sdc
41 - id: sdd44 - id: sdd
42 type: disk45 type: disk
46 wipe: superblock
43 ptable: gpt47 ptable: gpt
44 model: QEMU HARDDISK48 model: QEMU HARDDISK
45 path: /dev/vde49 path: /dev/vde
4650
=== modified file 'examples/tests/raid5boot.yaml'
--- examples/tests/raid5boot.yaml 2016-04-04 16:03:32 +0000
+++ examples/tests/raid5boot.yaml 2017-05-15 15:58:10 +0000
@@ -4,6 +4,7 @@
4 config:4 config:
5 - id: sda5 - id: sda
6 type: disk6 type: disk
7 wipe: superblock
7 ptable: gpt8 ptable: gpt
8 model: QEMU HARDDISK9 model: QEMU HARDDISK
9 path: /dev/vdb10 path: /dev/vdb
@@ -20,6 +21,7 @@
20 device: sda21 device: sda
21 - id: sdb22 - id: sdb
22 type: disk23 type: disk
24 wipe: superblock
23 ptable: gpt25 ptable: gpt
24 model: QEMU HARDDISK26 model: QEMU HARDDISK
25 path: /dev/vdc27 path: /dev/vdc
@@ -30,6 +32,7 @@
30 device: sdb32 device: sdb
31 - id: sdc33 - id: sdc
32 type: disk34 type: disk
35 wipe: superblock
33 ptable: gpt36 ptable: gpt
34 model: QEMU HARDDISK37 model: QEMU HARDDISK
35 path: /dev/vdd38 path: /dev/vdd
3639
=== modified file 'examples/tests/raid6boot.yaml'
--- examples/tests/raid6boot.yaml 2016-04-04 16:03:32 +0000
+++ examples/tests/raid6boot.yaml 2017-05-15 15:58:10 +0000
@@ -4,6 +4,7 @@
4 config:4 config:
5 - id: sda5 - id: sda
6 type: disk6 type: disk
7 wipe: superblock
7 ptable: gpt8 ptable: gpt
8 model: QEMU HARDDISK9 model: QEMU HARDDISK
9 path: /dev/vdb10 path: /dev/vdb
@@ -20,6 +21,7 @@
20 device: sda21 device: sda
21 - id: sdb22 - id: sdb
22 type: disk23 type: disk
24 wipe: superblock
23 ptable: gpt25 ptable: gpt
24 model: QEMU HARDDISK26 model: QEMU HARDDISK
25 path: /dev/vdc27 path: /dev/vdc
@@ -30,6 +32,7 @@
30 device: sdb32 device: sdb
31 - id: sdc33 - id: sdc
32 type: disk34 type: disk
35 wipe: superblock
33 ptable: gpt36 ptable: gpt
34 model: QEMU HARDDISK37 model: QEMU HARDDISK
35 path: /dev/vdd38 path: /dev/vdd
@@ -40,6 +43,7 @@
40 device: sdc43 device: sdc
41 - id: sdd44 - id: sdd
42 type: disk45 type: disk
46 wipe: superblock
43 ptable: gpt47 ptable: gpt
44 model: QEMU HARDDISK48 model: QEMU HARDDISK
45 path: /dev/vde49 path: /dev/vde
4650
=== modified file 'tests/vmtests/__init__.py'
--- tests/vmtests/__init__.py 2017-04-21 20:08:30 +0000
+++ tests/vmtests/__init__.py 2017-05-15 15:58:10 +0000
@@ -333,6 +333,9 @@
333 boot_timeout = BOOT_TIMEOUT333 boot_timeout = BOOT_TIMEOUT
334 collect_scripts = []334 collect_scripts = []
335 conf_file = "examples/tests/basic.yaml"335 conf_file = "examples/tests/basic.yaml"
336 nr_cpus = None
337 dirty_disks = False
338 dirty_disk_config = "examples/tests/dirty_disks_config.yaml"
336 disk_block_size = 512339 disk_block_size = 512
337 disk_driver = 'virtio-blk'340 disk_driver = 'virtio-blk'
338 disk_to_check = {}341 disk_to_check = {}
@@ -507,6 +510,26 @@
507 bugnum, clsname)510 bugnum, clsname)
508511
509 @classmethod512 @classmethod
513 def get_config_smp(cls):
514 """Get number of cpus to use for guest"""
515
516 nr_cpus = None
517 if cls.nr_cpus:
518 nr_cpus = cls.nr_cpus
519 logger.debug('Setting cpus from class value: %s', nr_cpus)
520
521 env_cpus = os.environ.get("CURTIN_VMTEST_NR_CPUS", None)
522 if env_cpus:
523 nr_cpus = env_cpus
524 logger.debug('Setting cpus from '
525 ' env["CURTIN_VMTEST_NR_CPUS"] value: %s', nr_cpus)
526 if not nr_cpus:
527 nr_cpus = 1
528 logger.debug('Setting cpus to default value: %s', nr_cpus)
529
530 return str(nr_cpus)
531
532 @classmethod
510 def setUpClass(cls):533 def setUpClass(cls):
511 # check if we should skip due to host arch534 # check if we should skip due to host arch
512 if cls.arch in cls.arch_skip:535 if cls.arch in cls.arch_skip:
@@ -535,7 +558,8 @@
535 dowait = "--dowait"558 dowait = "--dowait"
536559
537 # create launch cmd560 # create launch cmd
538 cmd = ["tools/launch", "--arch=" + cls.arch, "-v", dowait]561 cmd = ["tools/launch", "--arch=" + cls.arch, "-v", dowait,
562 "--smp=" + cls.get_config_smp()]
539 if not cls.interactive:563 if not cls.interactive:
540 cmd.extend(["--silent", "--power=off"])564 cmd.extend(["--silent", "--power=off"])
541565
@@ -646,6 +670,10 @@
646 fp.write(json.dumps({'grub': {'update_nvram': True}}))670 fp.write(json.dumps({'grub': {'update_nvram': True}}))
647 configs.append(grub_config)671 configs.append(grub_config)
648672
673 if cls.dirty_disks and storage_config:
674 logger.debug("Injecting early_command to dirty storage devices")
675 configs.append(cls.dirty_disk_config)
676
649 excfg = os.environ.get("CURTIN_VMTEST_EXTRA_CONFIG", False)677 excfg = os.environ.get("CURTIN_VMTEST_EXTRA_CONFIG", False)
650 if excfg:678 if excfg:
651 configs.append(excfg)679 configs.append(excfg)
@@ -789,6 +817,7 @@
789 target_disks + extra_disks + nvme_disks +817 target_disks + extra_disks + nvme_disks +
790 ["--", "-drive",818 ["--", "-drive",
791 "file=%s,if=virtio,media=cdrom" % cls.td.seed_disk,819 "file=%s,if=virtio,media=cdrom" % cls.td.seed_disk,
820 "-smp", cls.get_config_smp(),
792 "-m", "1024"])821 "-m", "1024"])
793822
794 if not cls.interactive:823 if not cls.interactive:
795824
=== modified file 'tests/vmtests/test_basic.py'
--- tests/vmtests/test_basic.py 2017-04-26 16:14:04 +0000
+++ tests/vmtests/test_basic.py 2017-05-15 15:58:10 +0000
@@ -8,6 +8,8 @@
88
9class TestBasicAbs(VMBaseClass):9class TestBasicAbs(VMBaseClass):
10 interactive = False10 interactive = False
11 nr_cpus = 2
12 dirty_disks = True
11 conf_file = "examples/tests/basic.yaml"13 conf_file = "examples/tests/basic.yaml"
12 extra_disks = ['128G', '128G', '4G']14 extra_disks = ['128G', '128G', '4G']
13 nvme_disks = ['4G']15 nvme_disks = ['4G']
1416
=== modified file 'tests/vmtests/test_bcache_basic.py'
--- tests/vmtests/test_bcache_basic.py 2017-04-26 16:14:04 +0000
+++ tests/vmtests/test_bcache_basic.py 2017-05-15 15:58:10 +0000
@@ -9,6 +9,8 @@
9 "s390x", # lp:15650299 "s390x", # lp:1565029
10 ]10 ]
11 conf_file = "examples/tests/bcache_basic.yaml"11 conf_file = "examples/tests/bcache_basic.yaml"
12 nr_cpus = 2
13 dirty_disks = True
12 extra_disks = ['2G']14 extra_disks = ['2G']
13 collect_scripts = [textwrap.dedent("""15 collect_scripts = [textwrap.dedent("""
14 cd OUTPUT_COLLECT_D16 cd OUTPUT_COLLECT_D
1517
=== modified file 'tests/vmtests/test_mdadm_bcache.py'
--- tests/vmtests/test_mdadm_bcache.py 2017-05-10 21:29:20 +0000
+++ tests/vmtests/test_mdadm_bcache.py 2017-05-15 15:58:10 +0000
@@ -262,6 +262,8 @@
262 ('md1', 0)]262 ('md1', 0)]
263 active_mdadm = "2"263 active_mdadm = "2"
264 uefi = True264 uefi = True
265 nr_cpus = 2
266 dirty_disks = True
265267
266268
267class TrustyTestMirrorbootPartitionsUEFI(relbase.trusty,269class TrustyTestMirrorbootPartitionsUEFI(relbase.trusty,
268270
=== modified file 'tools/launch'
--- tools/launch 2017-04-24 21:20:53 +0000
+++ tools/launch 2017-05-15 15:58:10 +0000
@@ -41,6 +41,7 @@
41 -n | --netdev netdev can be 'user' or a bridge41 -n | --netdev netdev can be 'user' or a bridge
42 -p | --publish F make file 'F' available in web server42 -p | --publish F make file 'F' available in web server
43 --silent use -nographic43 --silent use -nographic
44 -s | --smp S use smp S for number of guest cpus (defaults to 2)
44 --vnc D use -vnc D (mutually exclusive with --silent)45 --vnc D use -vnc D (mutually exclusive with --silent)
45 directly through to qemu-system.46 directly through to qemu-system.
46 Note, qemu adds 5900 to port numbers. (:0 = port 5900)47 Note, qemu adds 5900 to port numbers. (:0 = port 5900)
@@ -349,8 +350,9 @@
349}350}
350351
351main() {352main() {
352 local short_opts="a:A:d:h:i:k:n:p:v"353 local short_opts="a:A:d:h:i:k:n:p:s:v"
353 local long_opts="add:,append:,arch:,bios:,disk:,dowait,help,initrd:,kernel:,mem:,netdev:,no-dowait,power:,publish:,root-arg:,silent,serial-log:,uefi-nvram:,verbose,vnc:"354 local
355 long_opts="add:,append:,arch:,bios:,disk:,dowait,help,initrd:,kernel:,mem:,netdev:,no-dowait,power:,publish:,root-arg:,silent,serial-log:,smp:,uefi-nvram:,verbose,vnc:"
354 local getopt_out=""356 local getopt_out=""
355 getopt_out=$(getopt --name "${0##*/}" \357 getopt_out=$(getopt --name "${0##*/}" \
356 --options "${short_opts}" --long "${long_opts}" -- "$@") &&358 --options "${short_opts}" --long "${long_opts}" -- "$@") &&
@@ -358,7 +360,7 @@
358 { bad_Usage; return 1; }360 { bad_Usage; return 1; }
359361
360 local seed=""362 local seed=""
361 local bootimg="" bootimg_dist="" target="" mem="1024"363 local bootimg="" bootimg_dist="" target="" mem="1024" smp="2"
362 local udata="" ip="" http_port="${HTTP_PORT}" burl=""364 local udata="" ip="" http_port="${HTTP_PORT}" burl=""
363 local tmp="" top_d365 local tmp="" top_d
364 local initrd="" kernel="" uappend="" iargs="" disk_args=""366 local initrd="" kernel="" uappend="" iargs="" disk_args=""
@@ -412,6 +414,7 @@
412 --root-arg) root_arg="$next";;414 --root-arg) root_arg="$next";;
413 --serial-log) serial_log="$next"; shift;;415 --serial-log) serial_log="$next"; shift;;
414 --silent) video="-nographic";;416 --silent) video="-nographic";;
417 -s|--smp) smp="$next"; shift;;
415 --uefi-nvram|--bios)418 --uefi-nvram|--bios)
416 # handle all --opt=* pass through here.419 # handle all --opt=* pass through here.
417 pt[${#pt[@]}]="$cur=$next";;420 pt[${#pt[@]}]="$cur=$next";;
@@ -725,6 +728,7 @@
725 # -monitor stdio728 # -monitor stdio
726 cmd=(729 cmd=(
727 xkvm "${pt[@]}" "${netargs[@]}" --730 xkvm "${pt[@]}" "${netargs[@]}" --
731 -smp ${smp}
728 -m ${mem} ${serial_args} ${video}732 -m ${mem} ${serial_args} ${video}
729 -drive "file=$bootimg,if=none,cache=unsafe,format=qcow2,id=boot,index=0"733 -drive "file=$bootimg,if=none,cache=unsafe,format=qcow2,id=boot,index=0"
730 -device "virtio-blk,drive=boot"734 -device "virtio-blk,drive=boot"

Subscribers

People subscribed via source and target branches