-
Notifications
You must be signed in to change notification settings - Fork 196
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
Conversation
backend/qemu.pm
Outdated
$qemubin = find_bin('/usr/bin/', 'qemu-system-' . $vars->{QEMU}); | ||
} | ||
else { | ||
(my $class = $vars->{WORKER_CLASS}) =~ s/qemu_/qemu-system\-/g; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coolo true.
Fixed.
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))); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
you thought it's an easy one, didn't you? :) |
related poo#14674
There are two ways to define which qemu to use:
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.