QEMU Upstream 1.4


This page contains updates for QEMU upstream (1.4) in OpenXT.

Abstract

Here are the patches for QEMU 1.4. The aim is to port the patches from IOEMU (the old version of QEMU used in XEN) to a newer version of QEMU (easier to maintain and more reliable).

Even if there are already good progress, there is still one very missing patch : surfman.

Building

For those of you who just want to get a build rolling, or maybe kick one off while you peruse this fine document, do the following:

First clone the build scripts from openxt.git and add a line to the setup_build script to clone the meta-qemu-1.4 layer from Brendan's Github page. This line should be placed around other invocations of the 'getgit' function. In this example we add it after line 115 where the meta-selinux layer is cloned:

...
getgit $REPOS/meta-selinux $META_SELINUX_REPO $META_SELINUX_TAG
getgit $REPOS/meta-qemu-1.4 git://github.com/brendank310/meta-qemu-1.4-oxt.git master
 
 if [ ! -z "$EXTRA_DIR" ]; then
...

Second, enable this layer by adding it to the BBLAYERS variable in the bblayers.conf file around line 114:

...
${TOPDIR}/repos/meta-selinux \
${TOPDIR}/repos/meta-qemu-1.4 \
"
...

See the original instructions that went to the mailing list here.

What's new in QEMU1.4

  • Inter-hda emulation
  • 64 bits support for PCI Bar (some patches was submitted in QEMU/Xen mailing)
  • MemoryRegion API: offer a usefull way to manage MMIO and PCI Bar
  • PCI-PASSTHROUGH:
    • don't need a patch to enable it. There is now an option
    • use a -device xen-pci-pt,hostaddr=xxxx:yy:zz.f to provide a device

Dependances

NOTE: This section might be obsolete

Packages

  • xenclient-oe (branch qemu-dm)
  • dm-agent (branch qemu-dm (use option -q))
    • src/dm-agent
    • scripts/qemu-wrapper

List of patches

static-fix

QEMU with --enable-xen doesn't allow static compilation. We use static compilation for the stubdomain.

ioreq-server-upstream

ioreq-server

logging-syslog

Enable QEMU to log in syslog.

dmbus

Add wrapper for dmbus connection. It will be use for input event.

surfman

This patch was used to setup the XenGFX mode. Which is no longer used in XT.

  • TODO:
    • Erase this patch
    • implements some hooks to send the surface to surfman

switcher

Handle input keyboard and mouse.

acpi

  • Support of ACPI state;
  • Enable ACPI by default otherwise Windows will BSOD (In recent Xen's versions this part is made in hvmloader. See comment below)
  • Send state to the Input Server

Comments: acpi.c: from Xen4.2, we may need remove this line from this patch:

  apm_ctrl_changed(ACPI_ENABLE, s);

Warning:

  • Hibernation: Win7 doesn't leave the hibernation state properly. The RTL8139 driver for Window7 is no longer supported and let the guest in a bad status. Use e1000 netwotk device instead of rtl8139 to avoid any issue (see VM configuration).

Propagate network link status to the guest. This patch:

  • add a support to be notify when network is up/down via XenStore;
  • modify rt8189 card (use by default in XT) to handle link state.

Battery

Re-write the old patch from Kamala Narasimhan:

  • use memory_region to add new IOPORT
  • depends of hvmloader/acpi/ssdt.asl

Missing features:

  • It doesn't implement the GPE yet.
  • The patch implements the multiple batteries management, it doesn't allow to hotplug a battery

audio-alsa

  • enable volume controle

xenmou

  • Mouse emulation via a PCI device.

ATAPI-PASSTHROUGH

This is a re-implementation of the original ATAPI-Passthrough patch for IOEMU. Even if the logic has been kept (directly forward the SYSCall to the disk drive), the design has been changed.

Now there are 2 parts:

  • the device emulation
  • the device drivers
    • directly execute the IOCTL
    • one for the stubdom (It implements IOCTL over v4v)

Command line 

  -drive file=/dev/bsg/1:0:0:0,media=cdrom,if=atapi-pt,format=pt