Skip to content

Commit c0becf3

Browse files
committed
qemudriver: make extra_args key in YAML optional
extra_args can already be left empty if there are no extra arguments that should be added to the QEMU command line. Allow it to be omitted in such a case, so it doesn't needlessly clutter the YAML. Signed-off-by: Ahmad Fatoum <[email protected]>
1 parent 587a872 commit c0becf3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2712,7 +2712,7 @@ Arguments:
27122712
- machine (str): QEMU machine type
27132713
- cpu (str): QEMU cpu type
27142714
- memory (str): QEMU memory size (ends with M or G)
2715-
- extra_args (str): extra QEMU arguments, they are passed directly to the QEMU binary
2715+
- extra_args (str): optional, extra QEMU arguments, they are passed directly to the QEMU binary
27162716
- boot_args (str): optional, additional kernel boot argument
27172717
- kernel (str): optional, reference to the images key for the kernel
27182718
- disk (str): optional, reference to the images key for the disk image

labgrid/driver/qemudriver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class QEMUDriver(ConsoleExpectMixin, Driver, PowerProtocol, ConsoleProtocol):
3535
machine (str): QEMU machine type
3636
cpu (str): QEMU cpu type
3737
memory (str): QEMU memory size (ends with M or G)
38-
extra_args (str): extra QEMU arguments, they are passed directly to the QEMU binary
38+
extra_args (str): optional, extra QEMU arguments passed directly to the QEMU binary
3939
boot_args (str): optional, additional kernel boot argument
4040
kernel (str): optional, reference to the images key for the kernel
4141
disk (str): optional, reference to the images key for the disk image
@@ -54,7 +54,9 @@ class QEMUDriver(ConsoleExpectMixin, Driver, PowerProtocol, ConsoleProtocol):
5454
machine = attr.ib(validator=attr.validators.instance_of(str))
5555
cpu = attr.ib(validator=attr.validators.instance_of(str))
5656
memory = attr.ib(validator=attr.validators.instance_of(str))
57-
extra_args = attr.ib(validator=attr.validators.instance_of(str))
57+
extra_args = attr.ib(
58+
default='',
59+
validator=attr.validators.optional(attr.validators.instance_of(str)))
5860
boot_args = attr.ib(
5961
default=None,
6062
validator=attr.validators.optional(attr.validators.instance_of(str)))

0 commit comments

Comments
 (0)