Adds qemu wrapper to disable pmu in cpu flags#199
Conversation
|
|
||
| # Work around for https://github.com/coreos/coreos-assembler/issues/198 | ||
| ## Borrowed from virt-what | ||
| hv=$(dmidecode 2>&1 | grep 'Manufacturer: VMware') |
There was a problem hiding this comment.
This is only going to work in a --privileged container. At some point I think we shoud consider only supporting the unprivileged mode introduced by: #190
But honestly, I can't think of a downside to using -cpu host unconditionally for libguestfs. It makes sense. As far as pmu=off, I am less certain of all of the implications of that, but offhand, we don't care much about power management for these transient VMs, so I'm fine enabling that unconditionally too.
One messy thing here is...right now we're using LIBGUESTFS_BACKEND=direct because we hit race conditions otherwise I think. If we weren't libguestfs would use libvirt and I suspect that changes the qemu flags.
In the future we're likely to drop the virt-install codepath and so we'll more consistently not use libvirt and speak qemu directly.
It's probably worth filing a libguestfs bug (bugzilla.redhat.com or upstream) and see what the maintainer thinks about adding these flags by default.
In the meantime...let's basically drop the dmidecode and use the wrapper unconditionally?
There was a problem hiding this comment.
Requested changes made. I'll file the libguestfs bug too.
There was a problem hiding this comment.
ccfde6c to
13cd16d
Compare
|
One thing I'd missed originally is this isn't adding Anyways, needs a rebase now that the shellcheck PR landed, I think we can merge after that. |
|
will review this today |
|
hey @dcode - can you rebase this and address the code review comments? |
13cd16d to
f76ab28
Compare
a382d0f to
ff35236
Compare
When guestfish is called under nested VMware virtualization, it uses the cpu flag of `host`. This alone causes issues under nested VMware virtaulization in the default configuration. This commit removes the default host flags and replaces with `host,pmu=off`. Fixes coreos#198
ff35236 to
f902a28
Compare
|
Requested changes made. CI checks passed. 😃 |
|
this works for me. I think some of it might need to be moved around so that other calls to libguestfs will use the wrapper. I'll open a follow up PR for that and ask @dcode to review it. |
When guestfish is called under nested VMware virtualization, it uses the cpu flag of
host. This alone causes issues under nested VMware virtualization. This PR checks ifgf-oemidis running under a VMware hypervisor using the same check used byvirt-what. If yes, a qemu wrapper is written that addspmu=offto the cpu flags for qemu-kvm.Fixes #198