line |
stmt |
code |
1
|
|
# Copyright 2018 SUSE LLC |
2
|
|
# SPDX-License-Identifier: GPL-2.0-or-later |
3
|
|
|
4
|
|
use Mojo::Base 'OpenQA::Qemu::MutParams', -signatures; |
5
|
16
|
|
|
16
|
|
|
16
|
|
6
|
|
use OpenQA::Qemu::DriveController; |
7
|
16
|
use List::Util 'first'; |
|
16
|
|
|
16
|
|
8
|
16
|
|
|
16
|
|
|
16
|
|
9
|
|
has _controllers => sub ($self) { [] }; |
10
|
|
|
11
|
|
my $dc = OpenQA::Qemu::DriveController->new() |
12
|
44
|
->model($model) |
|
44
|
|
|
44
|
|
|
44
|
|
|
44
|
|
13
|
44
|
->id($id); |
14
|
|
|
15
|
|
push(@{$self->_controllers}, $dc); |
16
|
|
return $dc; |
17
|
44
|
} |
|
44
|
|
18
|
44
|
|
19
|
|
|
20
|
|
|
21
|
37
|
|
|
37
|
|
|
37
|
|
|
37
|
|
|
37
|
|
|
37
|
|
22
|
|
my @controllers = map { $_->_to_map } @{$self->_controllers}; |
23
|
12
|
return {controllers => \@controllers}; |
|
8
|
|
|
8
|
|
|
8
|
|
|
8
|
|
|
8
|
|
|
8
|
|
24
|
|
} |
25
|
37
|
|
|
37
|
|
|
37
|
|
|
37
|
|
|
37
|
|
|
32
|
|
|
37
|
|
26
|
|
for my $c (@{$map->{controllers}}) { |
27
|
14
|
$self->add_controller($c->{model}, $c->{id}); |
|
14
|
|
|
14
|
|
28
|
14
|
} |
|
15
|
|
|
14
|
|
29
|
14
|
} |
30
|
|
|
31
|
|
|
32
|
10
|
1; |
|
10
|
|
|
10
|
|
|
10
|
|