Improve qemu message when SMT != off

Bug #1638329 reported by bugproxy
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Fix Released
Wishlist
Taco Screen team

Bug Description

-- Problem Description --
Currently qemu failts ungracefully when you try to start it on a machine with SMT enabled.

This patch simply fails in a more gracefully manner.

Revision history for this message
bugproxy (bugproxy) wrote : [RFC] add dependency for ppc64_cpu and check smt before starting qemu

Default Comment by Bridge

tags: added: architecture-ppc64le bugnameltc-148002 severity-medium targetmilestone-inin1704
Changed in ubuntu:
assignee: nobody → Taco Screen team (taco-screen-team)
affects: ubuntu → qemu (Ubuntu)
Revision history for this message
Jon Grimm (jgrimm) wrote :

I haven't looked deeply at the patch, but if we do something like this we should align with Debian on it.

Changed in qemu (Ubuntu):
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for the patch Breno, the syncing with Debian suggestion here is true but complex.
The per-arch kvm wrappers is part of the Delta that Serge started to get rid of but still is left.

For now until the wider topic of getting Debian/Ubuntu in sync on those it will only apply to Ubuntu.

We need to hear from the Debian-Qemu people and Serge some of the History why this part isn't in Debian yet - there surely is a reason.
Subscribed Serge to comment on the History of that.

Revision history for this message
bugproxy (bugproxy) wrote :

Default Comment by Bridge

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
all changes are to the Ubuntu only bits - so that part is ok until we merge and reduce further Delta.

Reviewing your latest diff I don't like that the system service should fail if SMT is not set.
Especially since it exits before making any of its usual adjustments which is as TL;DR to apply anything in /etc/default/qemu-kvm

If one on power would run that, see the service failing, fix up SMT at runtime he could start kvm guests but not have the config applied e.g. ksm config and hugepage checks.

That said what would you think of chaning the init script portion of this to something like this for the message:
  logger -t qemu-kvm "Error: You must disable SMT if you want to run QEMU/KVM on ppc64le archtecture"
  logger -t qemu-kvm "In order to disable SMT, run: # ppc64_cpu --smt=off"!"
And remove the exit 1 in there to let it still continue with the service.

Revision history for this message
Breno Leitão (breno-leitao) wrote :

Hi Christian,

Thanks for the feedback, here is the version 2 of the patch. Let me know if it is better now.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "qemu_kvm_ppc64_smt.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for the update Breno,

I like it now:
- all I referred to is fixed.
- The changes are only to Ubuntu Delta (kvm wrapper and qemu-kvm-init are current Delta anyway);
  so no extra need to sync (other than our efforts to sync anyway)
- changes are local to only ppc code (so nearly no chance to affect others in a bad way)
- no bad effect on the service anymore
- the new dependency to powerpc-utils is local to qemu-system-ppc for now

Remaining comments on further review:
- Dependencies: the init script is part of qemu-system-common which can be installed without
  qemu-system-ppc (for not much use cases I think, but possible). That means that would need the
  new dependency as well to be sure we are not having an init script which runs into "program not
  found" issues.
- the kvm wrapper is part of qemu-kvm package which already has a dependency to qemu-system-ppc,
  but still this might change, so I'd rather add the dependency there. This is a bit trickier, as
  the package exists for powerpc and ppc64el, but powerpc-utils does not exist for the former.
  Yet your usage of the tool is safe behind a check to uname -m == ppc64*.
  Due to that we "only" have to move the Dependency to qemu-kvm instead of qemu-system-ppc.
- the use of logger in the kvm wrapper is already covered by the lsb-base depend which is auto-added
- you also had some whitespace damage in the init script (trailing whitespace)
- double spaces on the message
- the Changelog did not mention the kvm wrapper

I fixed all those issues up for you and prepared an upload as I'd be sponsoring it given your ack.

Please check out the debdiff attached here and the ppa at https://launchpad.net/~paelzer/+archive/ubuntu/bug-1638329-qemu-smt-messaging and let me know if this shall become your upload?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Please review the debdiff if the fixups I made for you are ok.

Revision history for this message
Breno Leitão (breno-leitao) wrote :

Hi Christian,

> let me know if this shall become your upload?

Yes, it sounds much better now. Thanks for your help, and we can proceed with this new patch.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Ok, added the bug to be closed by LP once it migrated into zesty properly.
I tested things on amd64 as I had no ppc around, but that was done by you.
So I have good expectations of this upload.

Thank you for your contribution on this Breno!

That said - Uploaded into zesty (https://launchpad.net/ubuntu/+source/qemu/1:2.6.1+dfsg-0ubuntu8), as usual we have to wait for official build and autopkgtest tests now.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu - 1:2.6.1+dfsg-0ubuntu8

---------------
qemu (1:2.6.1+dfsg-0ubuntu8) zesty; urgency=medium

  [ Breno Leitao ]
  * d/qemu-kvm-init, d/kvm.powerpc: Adding a check SMT on ppc64el (LP: #1638329)

 -- Christian Ehrhardt <email address hidden> Thu, 01 Dec 2016 13:44:33 +0100

Changed in qemu (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.