Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tries to guess which qemu executable should use via WORKER_CLASS #931

Merged
merged 1 commit into from
Mar 5, 2018

Conversation

dasantiago
Copy link

related poo#14674

There are two ways to define which qemu to use:

  • via environment variable QEMU
  • via setting the variable QEMU (it will be appended to qemu-system-)

However some templates don't have this variable defined, inducing
the worker to choose the wrong qemu.
So if any of the previous mechanisms work, it will use the
WORKER_CLASS to guess which executable should use.

backend/qemu.pm Outdated
$qemubin = find_bin('/usr/bin/', 'qemu-system-' . $vars->{QEMU});
}
else {
(my $class = $vars->{WORKER_CLASS}) =~ s/qemu_/qemu-system\-/g;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this cause warnings on undefined?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coolo true.

Fixed.

@coveralls
Copy link

coveralls commented Mar 5, 2018

Coverage Status

Coverage decreased (-0.06%) to 55.505% when pulling ee6ea35 on dasantiago:qemu_bin into dfced58 on os-autoinst:master.

backend/qemu.pm Outdated
}
else {
(my $class = $vars->{WORKER_CLASS} || '') =~ s/qemu_/qemu-system\-/g;
$qemubin = find_bin('/usr/bin/', (split(/\s*,\s*/, $class), qw(kvm qemu-kvm qemu qemu-system-x86_64 qemu-system-ppc64)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one more question: if WORKER_CLASS=tap,qemu_x86_64 will you start /usr/bin/tap?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coolo You do good questions 👍 :-D

got the point.

Fixed

@dasantiago dasantiago changed the title Tries to guess which qemu executable should use via WORKER_CLASS WIP: Tries to guess which qemu executable should use via WORKER_CLASS Mar 5, 2018
backend/qemu.pm Outdated
for (split(/\s*,\s*/, $class)) {
$qemubin = find_bin('/usr/bin/', $_) if $allowed{$_};
}
$qemubin = find_bin('/usr/bin/', keys %allowed) unless $qemubin;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this drops order - and we would run qemu-system-ppc64 before qemu by chance (perl hash randomization)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coolo done.

There are two ways to define which qemu to use:
- via environment variable QEMU
- via setting the variable QEMU (it will be appended to qemu-system-)

However some templates don't have this variable defined, inducing
the worker to choose the wrong qemu.
So if any of the previous mechanisms work, it will use the
WORKER_CLASS to guess which executable should use.
@dasantiago dasantiago changed the title WIP: Tries to guess which qemu executable should use via WORKER_CLASS Tries to guess which qemu executable should use via WORKER_CLASS Mar 5, 2018
@coolo
Copy link
Contributor

coolo commented Mar 5, 2018

you thought it's an easy one, didn't you? :)

@coolo coolo merged commit 6728b43 into os-autoinst:master Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants