Update to use only qemu-kvm

We only have qemu-kvm available, so use that. This also means that there
will not me any support for using qemu with arches that are different
from the host.
This commit is contained in:
Brian C. Lane 2018-07-27 15:10:22 -07:00
parent c3987cc4cb
commit 619026ff3d
4 changed files with 12 additions and 19 deletions

View File

@ -25,7 +25,7 @@ minimum you need:
``--ks`` to select the kickstart file describing what to install.
To use livemedia-creator with virtualization you will need to have qemu installed.
To use livemedia-creator with virtualization you will need to have qemu-kvm installed.
If you are going to be using Anaconda directly, with ``--no-virt`` mode, make sure
you have the anaconda-tui package installed.

View File

@ -90,16 +90,15 @@ Anaconda's image install feature.
%package lmc-virt
Summary: livemedia-creator libvirt dependencies
Requires: lorax = %{version}-%{release}
Requires: qemu
Requires: qemu-kvm
# Fedora edk2 builds currently only support these arches
%ifarch %{ix86} x86_64 %{arm} aarch64
Requires: edk2-ovmf
%endif
Recommends: qemu-kvm
%description lmc-virt
Additional dependencies required by livemedia-creator when using it with qemu.
Additional dependencies required by livemedia-creator when using it with qemu-kvm.
%package lmc-novirt
Summary: livemedia-creator no-virt dependencies

View File

@ -135,15 +135,6 @@ class QEMUInstall(object):
"""
Run qemu using an iso and a kickstart
"""
# Mapping of arch to qemu command
QEMU_CMDS = {"x86_64": "qemu-system-x86_64",
"i386": "qemu-system-i386",
"arm": "qemu-system-arm",
"aarch64": "qemu-system-aarch64",
"ppc": "qemu-system-ppc",
"ppc64": "qemu-system-ppc64"
}
def __init__(self, opts, iso, ks_paths, disk_img, img_size=2048,
kernel_args=None, memory=1024, vcpus=None, vnc=None, arch=None,
log_check=None, virtio_host="127.0.0.1", virtio_port=6080,
@ -170,9 +161,9 @@ class QEMUInstall(object):
:param bool boot_uefi: Use OVMF to boot the VM in UEFI mode
:param str ovmf_path: Path to the OVMF firmware
"""
# Lookup qemu-system- for arch if passed, or try to guess using host arch
qemu_cmd = [self.QEMU_CMDS.get(arch or os.uname().machine, "qemu-system-"+os.uname().machine)]
if not os.path.exists("/usr/bin/"+qemu_cmd[0]):
# RHEL8 only has /usr/libexec/qemu-kvm so we have to use that.
qemu_cmd = ["/usr/libexec/qemu-kvm"]
if not os.path.exists(qemu_cmd[0]):
raise InstallError("%s does not exist, cannot run qemu" % qemu_cmd[0])
qemu_cmd += ["-nodefconfig"]
@ -225,13 +216,16 @@ class QEMUInstall(object):
log.info("qemu %s", display_args)
qemu_cmd += ["-nographic", "-display", display_args ]
# Setup virtio networking
qemu_cmd += ["-netdev", "user,id=n1", "-device", "virtio-net-pci,netdev=n1"]
# Setup the virtio log port
qemu_cmd += ["-device", "virtio-serial-pci,id=virtio-serial0"]
qemu_cmd += ["-device", "virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0"
",id=channel0,name=org.fedoraproject.anaconda.log.0"]
qemu_cmd += ["-chardev", "socket,id=charchannel0,host=%s,port=%s" % (virtio_host, virtio_port)]
# PAss through rng from host
# Pass through rng from host
if opts.with_rng != "none":
qemu_cmd += ["-object", "rng-random,id=virtio-rng0,filename=%s" % opts.with_rng]
qemu_cmd += ["-device", "virtio-rng-pci,rng=virtio-rng0,id=rng0,bus=pci.0,addr=0x9"]

View File

@ -84,8 +84,8 @@ def main():
errors.append("the volume id cannot be longer than 32 characters")
if is_install and not opts.no_virt \
and not any(glob.glob("/usr/bin/qemu-system-*")):
errors.append("qemu needs to be installed.")
and not any(glob.glob("/usr/libexec/qemu-kvm")):
errors.append("qemu-kvm needs to be installed.")
if is_install and opts.no_virt \
and not os.path.exists("/usr/sbin/anaconda"):