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

Projects
None yet
5 participants
@cgwalters
Copy link
Member

cgwalters commented Feb 6, 2019

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

This comment has been minimized.

Copy link
Contributor

miabbott commented Feb 7, 2019

You have to appease the ShellCheck gods, otherwise LGTM

@r4f4

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

cgwalters commented Feb 7, 2019

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.

Find qemu in /usr/libexec or via qemu-system-$(arch)
`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 cgwalters force-pushed the cgwalters:qemu-use-arch branch from 753ca5a to eec20c7 Feb 7, 2019

@cgwalters

This comment has been minimized.

Copy link
Member Author

cgwalters commented Feb 7, 2019

Updated 🆕

@cgwalters

This comment has been minimized.

Copy link
Member Author

cgwalters commented Feb 7, 2019

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

@dustymabe

This comment has been minimized.

Copy link
Collaborator

dustymabe commented Feb 7, 2019

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

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

@r4f4

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

dustymabe commented Feb 7, 2019

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member Author

cgwalters commented Feb 8, 2019

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Collaborator

ashcrow commented Feb 8, 2019

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

@cgwalters

This comment has been minimized.

Copy link
Member Author

cgwalters commented Feb 11, 2019

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 referenced this pull request Feb 12, 2019

Merged

EL7 compatibility fixes #344

@miabbott

This comment has been minimized.

Copy link
Contributor

miabbott commented Feb 12, 2019

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

This comment has been minimized.

Copy link
Member Author

cgwalters commented Feb 12, 2019

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment