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

Find qemu in /usr/libexec or via qemu-system-$(arch) #329

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

cgwalters
Copy link
Member

qemu-kvm is going away in Fedora; invoke qemu how libvirt does it.

Similarly on RHEL, it's in /usr/libexec as QEMU is an implementation
detail of libvirt (or something), so let's find it there.

@miabbott
Copy link
Member

miabbott commented Feb 7, 2019

You have to appease the ShellCheck gods, otherwise LGTM

@r4f4
Copy link
Collaborator

r4f4 commented Feb 7, 2019

Shouldn't you also update the qemu call inside the qemu_wrapper script in src/gf-oemid?

@cgwalters
Copy link
Member Author

Shouldn't you also update the qemu call inside the qemu_wrapper script in src/gf-oemid?

Oh wow I forgot about that one. I think that one is mostly x86_64 specific for now, but yeah let's wrap it too.

`qemu-kvm` is going away in Fedora; invoke qemu how libvirt does it.

Similarly on RHEL, it's in `/usr/libexec` as QEMU is an implementation
detail of libvirt (or something), so let's find it there.
@cgwalters
Copy link
Member Author

Updated 🆕

@cgwalters
Copy link
Member Author

This should fix #314
and #328
(But I didn't explicitly test either of those either)

@dustymabe
Copy link
Member

(But I didn't explicitly test either of those either)

asked @r4f4 to review and also test this on other architectures

@r4f4
Copy link
Collaborator

r4f4 commented Feb 7, 2019

It'll still fail on other arches because of some arch specific options, e.g, no KVM on aarch64 and the binary being qemu-system-ppc64 on ppc64le. I have a patch to fix those issues but testing on all arches takes a long time.

@dustymabe
Copy link
Member

I have a patch to fix those issues but testing on all arches takes a long time.

in that case we can focus on x86_64 here and do a follow up for the others.

@miabbott
Copy link
Member

miabbott commented Feb 7, 2019

FWIW, when using this patch in an EL7 cosa, the next papercut is:

+ exec /usr/libexec/qemu-kvm -name coreos -m 2048 -nographic -netdev user,id=eth0,hostname=coreos -device virtio-net-pci,netdev=eth0 -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 -drive if=virtio,cache=unsafe,file=builds/47.6-1/redhat-coreos-maipo
-47.6-1-qemu.qcow2 -snapshot -fw_cfg name=opt/com.coreos/config,file=/proc/self/fd/3 -machine accel=kvm -cpu host -smp 4
qemu-kvm: -fw_cfg: invalid option                                 

EL7 ships an embarassingly old version of qemu-kvm:

$ /usr/libexec/qemu-kvm --version
QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-160.el7_6.1), Copyright (c) 2003-2008 Fabrice Bellard

And support for -fw_cfg was added in v2.4 - qemu/qemu@81b2b81

Me right now: 😭

@cgwalters
Copy link
Member Author

And support for -fw_cfg was added in v2.4 - qemu/qemu@81b2b81

I would really hope we can focus on RHEL8 soon.

But if not remember there are actually two qemu packages/streams in RHEL7. The one that gets rebased regularly is called qemu-kvm-rhev.

@miabbott
Copy link
Member

miabbott commented Feb 8, 2019

I would really hope we can focus on RHEL8 soon.

This papercut has put me over the edge...I'm refocusing on EL8 today.

@ashcrow
Copy link
Member

ashcrow commented Feb 8, 2019

As long as it works I'm fine with rhel 8 or 7.

@cgwalters
Copy link
Member Author

Relatedly in RHEL7 (at least initially) libguestfs used qemu directly. In RHEL8 it defaults to running via libvirt. I think the reason they did this I suspect is maintaining the qemu abstraction (including which args are available on which architectures) is a nontrivial maintenance task.

The problem with this though is we really don't want a persistent daemon...but if we have to we can suck it up and try switching to libvirt across the board.

@miabbott miabbott mentioned this pull request Feb 12, 2019
@miabbott
Copy link
Member

Noting that we need additional fixes for non x86_64 arches, this helps the EL7 cause, and is required by #344...

Any reasons not to merge this?

@cgwalters
Copy link
Member Author

Yeah, let's merge. Clearly not the end state as someone noted it's qemu-system-ppc64 and not ppc64le or something but at least we're converging.

@cgwalters cgwalters merged commit 4299fb0 into coreos:master Feb 12, 2019
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.

5 participants