Jump to content

QEMU/Invocation

From Wikibooks, open books for an open world

QEMU options

[edit | edit source]

QEMU is called with the following commands on host systems with x86 processor architecture. [1] The parameter Disk_image refers to the image of the first IDE hard disk (disk 0).

x86 architecture (32-bit):

Host ~ $  qemu-system-i386 [options] [disk_image] 

x86 architecture (64 bit):

Host ~ $  qemu-system-x86_64 [options] [disk_image] 

QEMU was called with 'qemu' before version 1.0.

Host ~ $  qemu [options] [disk_image] 

The kernel-based virtual machine is often called with kvm instead of qemu. This is confusing, because the Native Linux KVM Tool is also invoked like that as well. [2] Some distributions call with qemu-system-x86_64 or qemu-kvm.


-h shows the help

Debugging

[edit | edit source]
-d item1,...

Writes the log file to stderr. The following options are passed with commas to the command like : qemu -d int,cpu use -d help to get a full list.

-d out_asm

Show generated host assembly code for each compiled Translation-Block (TB)

-d in_asm          

Show input assembly code for each compiled TB

-d op

Shows micro operations for each compiled TB

-d op_opt          

show micro ops after optimization

-d op_ind

Show micro ops before indirect lowering

-d int

Show interrupts/exceptions in short format

-d exec

Show trace before each executed TB (lots of logs)

-d cpu

Show CPU registers before entering a TB (lots of logs)

-d mmu

Log MMU-related activities

-d pcall

x86 only: show protected mode far calls/returns/exceptions

-d cpu_reset

show CPU state before CPU resets

-d unimp

Log unimplemented functionality

-d guest_errors

Log when the guest OS does something invalid (eg accessing a non-existent register)

-d page

Dump pages at beginning of user mode emulation

-d nochain

Do not chain compiled TBs so that "exec" and "cpu" show complete traces

Tracing

[edit | edit source]

Configure like this :

   ./configure --enable-trace-backends=simple

Run like this :

   qemu -trace events=/tmp/events ... # your normal QEMU invocation

[3] [4]

  1. http://qemu-buch.de/de/index.php?title=QEMU-KVM-Buch/_Anhang/_Startoptionen_von_QEMU_und_KVM
  2. http://www.linux-kvm.org/images/c/c5/2011-forum-native-linux-kvm-tool.pdf
  3. http://wiki.qemu.org/Features/Tracing
  4. http://git.qemu-project.org/?p=qemu.git;a=blob_plain;f=docs/tracing.txt;hb=HEAD