Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
NVM Express Device Emulation in QEMU
C Haxe Perl Shell Assembly C++ Other
branch: master

This branch is 55 commits ahead of arunar:master

Added async event masking logic

    Async event subsequent events are masked until the host
    clears that event by calling Get log page for the corresponing
    event.

Signed-off-by: Sravan Kumar Thokala <sravan.kumar.thokala@intel.com>
latest commit ac855bd137
@thokala thokala authored
Failed to load latest commit information.
QMP QMP: add server mode to QEMUMonitorProtocol
audio coreaudio: Fix OSStatus format specifier
block qcow2: Fix in-flight list after qcow2_cache_put failure
bsd-user Command line support for altering the log file location
darwin-user Command line support for altering the log file location
default-configs Merge branch 'experimental'
docs usb: documentation update
fpu softfloat: add float*_is_zero_or_denormal()
fsdev fsdev: Fix archs that dont use fsdev
gdb-xml gdb-xml: fix hacks in powerpc register numbering
hw Added async event masking logic
libcacard libcacard: add libcacard.la target
linux-headers Import kernel headers
linux-user Command line support for altering the log file location
net slirp: fix guestfwd id
pc-bios Bugfix and updation to bios file of Qemu
roms Add ipxe submodule
scripts Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
slirp add a service to reap zombies, use it in SLIRP
sysconfigs/target Add cpu model configuration support..
target-alpha alpha: remove unused variable
target-arm target-arm: BKPT instructions should raise prefetch aborts with IFSR …
target-cris Merge remote-tracking branch 'stefanha/trivial-patches' into staging
target-i386 kvm: fix FPU state subsection
target-lm32 Remove warning in printf due to type mismatch
target-m68k m68k: Replace gen_im32() by tcg_const_i32()
target-microblaze Merge remote-tracking branch 'stefanha/trivial-patches' into staging
target-mips target-mips: Fix warning caused by unused local variable
target-ppc kvm: ppc: Drop KVM_CAP build dependencies
target-s390x Switch build system to accompanied kernel headers
target-sh4 Remove unused function parameter from cpu_restore_state
target-sparc Fix compilation warning due to missing header for sigaction (followup)
target-unicore32 Remove unused function parameters from gen_pc_load and rename the fun…
tcg tcg: Fix unused-but-set-variable warning
tests Fix spelling in comments (intruction -> instruction)
ui cocoa: Avoid warning related to multiple handleEvent: definitions
.gitignore QEMU NVMe: cq doorbell write, interrupts
.gitmodules Add ipxe submodule
CODING_STYLE checkpatch: adjust to QEMUisms
COPYING COPYING: update from FSF
COPYING.LIB Update FSF address in GPL/LGPL boilerplate
Changelog Changelog: Add explanatory note that this file is no longer updated
HACKING HACKING: Update status of format checking
LICENSE Add missing newline at the end of file
MAINTAINERS target-alpha: Claim ownership.
Makefile libcacard: add libcacard.la target
Makefile.dis Compile disassemblers only once
Makefile.hw Clean libhw subdirs as well
Makefile.objs Reorganized the code and separated out config file read functions in …
Makefile.target Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Makefile.user Use vpath directive
README QEMU NVMe: Updation to README
TODO Update
VERSION Open up the 0.15 development branch
a.out.h Remove unnecessary trailing newlines
acl.c Remove unused sysemu.h include directives
acl.h Fix sys-queue.h conflict for good
aes.c Include assert.h from qemu-common.h
aes.h AES crypto support
aio.c block: fix aio_flush segfaults for read-only protocols (e.g. curl)
alpha-dis.c target-alpha: Disassemble EV6 PALcode instructions.
alpha.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
arch_init.c Introduce -machine command option.
arch_init.h Introduce -machine command option.
arm-dis.c arm-dis: Include opcode hex when doing disassembly
arm-semi.c Remove unused sysemu.h include directives
arm.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
async.c Allow nested qemu_bh_poll() after BH deletion
balloon.c Remove unused sysemu.h include directives
balloon.h move balloon handling to balloon.c
bitmap.c bitmap: add a generic bitmap and bitops library
bitmap.h bitmap: add a generic bitmap and bitops library
bitops.c bitmap: add a generic bitmap and bitops library
bitops.h bitops: fix error on OpenBSD and mingw32
block-migration.c Improve accuracy of block migration bandwidth calculation
block-migration.h block migration: Report progress also via info migration
block.c bdrv_img_create: Fix segfault
block.h Replaced tabs with spaces in block.h and block_int.h
block_int.h Replaced tabs with spaces in block.h and block_int.h
blockdev.c block: clarify the meaning of BDRV_O_NOCACHE
blockdev.h blockdev: Store -drive option media in DriveInfo
bswap.h bswap.h: add cpu_to_be64wu()
bt-host.c Remove unused sysemu.h include directives
bt-host.h Clean build: Add bt-host.h
bt-vhci.c Remove unused sysemu.h include directives
buffered_file.c Remove unused sysemu.h include directives
buffered_file.h Introduce a buffered file wrapper for QEMUFile
cache-utils.c Remove trailing whitespace
cache-utils.h Delete useless 'extern' qualifiers for functions
check-qdict.c check-qdict: Fix possible crash
check-qfloat.c Fix qtypes' licenses
check-qint.c Fix qtypes' licenses
check-qjson.c Silence compiler warning in json test case
check-qlist.c Fix qtypes' licenses
check-qstring.c Fix qtypes' licenses
cmd.c cmd: fix operator precedence
cmd.h Delete useless 'extern' qualifiers for functions
compatfd.c sigfd: use pthread_sigmask
compatfd.h signalfd compatibility
config.h Makefile dependencies for device configs
configure Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
console.c Fix segfault on screendump with -nographic
console.h Make VNC support optional
cpu-all.h softfloat: always enable floatx80 and float128 support
cpu-common.h exec.c: refactor cpu_physical_memory_map
cpu-defs.h Expose thread_id in info cpus
cpu-exec.c Remove unneeded kvm.h from cpu-exec.c
cpus.c Fix typo in cpus.c
cpus.h Command line support for altering the log file location
cris-dis.c cris: Support disassembly of crisv10
cursor.c cursor: add cursor functions.
cursor_hidden.xpm cursor: add cursor functions.
cursor_left_ptr.xpm cursor: add cursor functions.
cutils.c QCOW2: bug fix - read base image beyond its size
def-helper.h tcg: Optionally sign-extend 32-bit arguments for 64-bit hosts.
device_tree.c Remove unused sysemu.h include directives
device_tree.h Allow qemu_devtree_setprop() to take arbitrary values
dis-asm.h target-alpha: Disassemble EV6 PALcode instructions.
disas.c target-alpha: Disassemble EV6 PALcode instructions.
disas.h Remove special handling of system include files (no longer needed)
dma-helpers.c make dma_bdrv_io available to drivers
dma.h make dma_bdrv_io available to drivers
dyngen-exec.h Remove special handling of system include files (no longer needed)
elf.h unicore32: necessary modifications for other files to support unicore32
envlist.c Fix sys-queue.h conflict for good
envlist.h Delete useless 'extern' qualifiers for functions
error.c error framework: Fix compilation for w32/w64
error.h error framework: Fix compilation for w32/w64
error_int.h Introduce the new error framework
exec-all.h target-alpha: Trap for unassigned and unaligned addresses.
exec.c Merge remote-tracking branch 'mst/for_anthony' into staging
gdbstub.c target-mips/gdbstub: remove old CONFIG_SOFTFLOAT #ifndef
gdbstub.h Add scripts directory
gen-icount.h Fix conversions from pointer to tcg_target_long
hmp-commands.hx HMP: Use QMP inject nmi implementation
host-utils.c user: compile host-utils.c only once
host-utils.h target-alpha: Fix generic ctz64.
hpet.h Add a local copy of hpet.h.
hppa-dis.c Fix typo in comment (relevent -> relevant)
hppa.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
i386-dis.c i386-dis: Fix unused return value, spotted by clang
i386.ld Fix missing symbols in .rel/.rela.plt sections
ia64-dis.c Fix %lld or %llx printf format use
ia64.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
input.c event: trivial coding style fixes
iohandler.c add a service to reap zombies, use it in SLIRP
ioport-user.c Revert "Get rid of _t suffix"
ioport.c ioport: Improve error output
ioport.h Type-safe ioport callbacks
iorange.h Type-safe ioport callbacks
iov.c iov: Move from hw/ to topdir
iov.h iov: Move from hw/ to topdir
json-lexer.c json-lexer: make lexer error-recovery more deterministic
json-lexer.h json-lexer: make lexer error-recovery more deterministic
json-parser.c json-parser: add handling for NULL token list
json-parser.h json-parser: propagate error from parser
json-streamer.c json-streamer: add handling for JSON_ERROR token/state
json-streamer.h json-streamer: make sure to reset token_size after emitting a token list
kvm-all.c kvm: Drop KVM_CAP build dependencies
kvm-stub.c kvm: Clean up stubs
kvm.h kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid
libfdt_env.h Fix libfdt warnings on Darwin
linux-aio.c linux-aio: Fix typo in read() EINTR check
m68k-dis.c *-dis: Replace fprintf_ftype by fprintf_function (format checking)
m68k-semi.c Move qemu_gettimeofday() to OS specific files
m68k.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
microblaze-dis.c *-dis: Replace fprintf_ftype by fprintf_function (format checking)
migration-exec.c Remove unused sysemu.h include directives
migration-fd.c Remove unused sysemu.h include directives
migration-tcp.c Remove unused sysemu.h include directives
migration-unix.c Remove unused sysemu.h include directives
migration.c Improve vm_stop reason declarations
migration.h migration: move some declarations to migration.h
mips-dis.c *-dis: Replace fprintf_ftype by fprintf_function (format checking)
mips.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
module.c Fix sys-queue.h conflict for good
module.h Convert machine registration to use module init functions
monitor.c HMP: Use QMP inject nmi implementation
monitor.h spice: connection events.
nbd.c NBD: Use qemu_socket functions to open TCP and UNIX sockets
nbd.h NBD: Use qemu_socket functions to open TCP and UNIX sockets
net.c net: Warn about "-net nic" options which were ignored
net.h net: Warn about "-net nic" options which were ignored
notify.c Add support for generic notifier lists
notify.h Add support for generic notifier lists
os-posix.c Introduce format string for pid_t
os-win32.c Introduce format string for pid_t
osdep.c Remove unused sysemu.h include directives
osdep.h Introduce format string for pid_t
oslib-posix.c Darwin: Fix compilation warning regarding the deprecated daemon() fun…
oslib-win32.c w32: Remove implementation of function ffs
path.c user: speed up init_paths a bit
pci-ids.txt List virtio console device in pci-ids.txt
pflib.c add pflib: PixelFormat conversion library.
pflib.h add pflib: PixelFormat conversion library.
poison.h irq: Privatize CPU_INTERRUPT_NMI.
posix-aio-compat.c Fix compilation warning due to missing header for sigaction (followup)
ppc-dis.c Work around OpenSolaris sys/regset.h namespace pollution
ppc.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
ppc64.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
qbool.c Fix qtypes' licenses
qbool.h Add a QBool type
qdict-test-data.txt Introduce QDict test data file
qdict.c QDict: Introduce qdict_get_try_bool()
qdict.h QDict: Introduce qdict_get_try_bool()
qemu-aio.h Add qemu_aio_process_queue()
qemu-barrier.h Introduce proper compiler barrier
qemu-char.c Fix compilation warning due to missing header for sigaction (followup)
qemu-char.h char: Allow devices to use a single multiplexed chardev.
qemu-common.h cocoa: Provide central qemu_main() prototype
qemu-config.c qemu-config: comment spell fix
qemu-config.h spice: core bits
qemu-doc.texi doc: Add explanation that -alt-grab and -ctrl-grab affect special keys
qemu-error.c Remove unused sysemu.h include directives
qemu-error.h Use GCC_FMT_ATTR (format checking)
qemu-img-cmds.hx qemu-img: Initial progress printing support
qemu-img.c qemu_img: is_not_zero() optimization
qemu-img.texi Documentation: Add qemu-img check/rebase
qemu-io.c block: clarify the meaning of BDRV_O_NOCACHE
qemu-lock.h qemu-lock.h: Remove non-pthreads spinlock implementations
qemu-log.h Define macros that will become the new logging API (Eduardo Habkost)
qemu-malloc.c Add missing tracing to qemu_mallocz()
qemu-nbd.c Darwin: Fix compilation warning regarding the deprecated daemon() fun…
qemu-nbd.texi qemu-nbd: Fix wrong description in qemu-nbd.texi
qemu-objects.h Fix qtypes' licenses
qemu-option.c qemu-option: Fix parse_option_parameters() documentation typo
qemu-option.h error: New qemu_opts_loc_restore()
qemu-options.h Introduce OS specific cmdline argument handling and move SMB arg to o…
qemu-options.hx Command line support for altering the log file location
qemu-os-posix.h virtio-9p: fix build on !CONFIG_UTIMENSAT
qemu-os-win32.h w32: Fix missing declaration of ffs()
qemu-progress.c Fix compilation warning due to missing header for sigaction (followup)
qemu-queue.h Import a simple queue implementation from NetBSD
qemu-sockets.c Set errno=ENOTSUP for attempts to use UNIX sockets on Windows platforms
qemu-tech.texi qemu-tech: Spelling fixes
qemu-thread-posix.c qemu-thread: delete unused functions
qemu-thread-posix.h add Win32 IPI service
qemu-thread-win32.c w32: Add missing functions qemu_mutex_destroy, qemu_cond_destroy
qemu-thread-win32.h add win32 qemu-thread implementation
qemu-thread.h qemu-thread.h: include inttypes.h
qemu-timer-common.c Add OpenBSD to ifdef list since it has CLOCK_MONOTONIC.
qemu-timer.c timer: drop HPET and RTC
qemu-timer.h qemu-timer: Remove unneeded include statement (w32)
qemu-tool.c qemu-tool: Stub out qemu-timer functions
qemu-x509.h move x509 file name defines to qemu-x509.h
qemu.sasl Add SASL authentication support ("Daniel P. Berrange")
qemu_socket.h net: remove parse_host_src_port() function
qerror.c Merge remote-tracking branch 'qmp/for-anthony' into staging
qerror.h Merge remote-tracking branch 'qmp/for-anthony' into staging
qfloat.c Fix qtypes' licenses
qfloat.h Add a QFloat datatype
qint.c Fix qtypes' licenses
qint.h Fix qtypes' licenses
qjson.c Add support for JSON pretty printing
qjson.h Merge remote branch 'qmp/for-anthony' into staging
qlist.c Fix qtypes' licenses
qlist.h Fix qtypes' licenses
qmp-commands.hx HMP: Use QMP inject nmi implementation
qobject.h Fix qtypes' licenses
qstring.c Fix qtypes' licenses
qstring.h Fix qtypes' licenses
range.h Introduce range.h
readline.c cope with printf macro definition in readline.c
readline.h monitor: Improve mux'ed console experience (Jan Kiszka)
rules.mak libcacard: add libcacard.la target
rwhandler.c Make simple io mem handler endian aware
rwhandler.h Make simple io mem handler endian aware
s390-dis.c s390: Disassemble some general-instruction-extension insns.
s390.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
savevm.c Reset system before loadvm
sh4-dis.c *-dis: Replace fprintf_ftype by fprintf_function (format checking)
simpletrace.c simpletrace: Move st_init() error reporting
simpletrace.h simpletrace: Move st_init() error reporting
softmmu-semi.h Suppress gcc 4.x -Wpointer-sign (included in -Wall) warnings
softmmu_defs.h Fix some warnings that would be generated by gcc -Wredundant-decls
softmmu_exec.h sparc64: handle asi referencing nucleus and secondary MMU contexts
softmmu_header.h sparc64: fix 32bit load sign extension
softmmu_template.h Split TLB addend and target_phys_addr_t
sparc-dis.c sparc64: more ultrasparc asi extensions for disassembler
sparc.ld Fix sparc.ld
sparc64.ld set SEARCH_PATH for the linker script from output of ld --verbose -v
spice-qemu-char.c spice-qemu-char: Fix flow control in client -> guest direction
sysemu.h Allow silent system resets
targphys.h Split TLB addend and target_phys_addr_t
tcg-runtime.c tcg: add div/rem 32-bit helpers
thunk.c Update to a hopefully more future proof FSF address
thunk.h Update to a hopefully more future proof FSF address
trace-events xen: Add the Xen platform pci device
translate-all.c Remove unused function parameter from cpu_restore_state
uboot_image.h Revert "Get rid of _t suffix"
usb-bsd.c Fix compilation warning due to missing header for sigaction (followup)
usb-linux.c usb-linux: Enlarge buffer for descriptors to 8192 bytes
usb-stub.c monitor: Rework API (Jan Kiszka)
user-exec.c Move user emulator stuff from cpu-exec.c to user-exec.c
version.rc mingw: add version information to the executables
vgafont.h Some little fixes on QEMU
vl.c Allow silent system resets
x86_64.ld Fix missing symbols in .rel/.rela.plt sections
xen-all.c Merge remote-tracking branch 'qmp/for-anthony' into staging
xen-mapcache-stub.c xen: remove xen_map_block and xen_unmap_block
xen-mapcache.c xen: remove xen_map_block and xen_unmap_block
xen-mapcache.h xen: remove xen_map_block and xen_unmap_block
xen-stub.c xen: Add Xen hypercall for sleep state in the cmos_s3 callback.

README

1. Introduction
2. How to compile Qemu with NVME support.
3. Make a virtual HD for QEMU
4. Locate and download a Linux based 64b OS to virtualize
5. Install KVM
6. Install the chosen virtualized OS to the virtual HD
7. Boot the virtual machine from the virtual HD
8. Performance notes
9. Usage Notes


Qemu for NVME.

1. Introduction.

To get more details about Qemu visit the official website:
http://wiki.qemu.org/Main_Page

To clone Qemu with support for NVME clone source code from:
git clone git@github.com:nvmeqemu/nvmeqemu.git

2. How to compile Qemu with NVME support.
    a. Clone the above git repository.
    b. Make sure you are using a 64 bit environment and a 64 bit Linux kernel.
    c. You need the following libraries:
       For Ubuntu 10.10 Server 64b host:
           sudo apt-get install linux-headers-2.6.35-22-server
           sudo apt-get install zlib1g-dev
           sudo apt-get install libsdl-dev
           sudo apt-get install libaio-dev

       For RHEL5 host (If the packages are not found, check your repositories' setup):
           yum install kernel-devel
           yum install zlib-devel
           yum install SDL
           yum install libaio-devel
       ./configure --enable-io-thread --enable-linux-aio --target-list=x86_64-softmmu --enable-sdl
       NOTE: With RHEL5 the configure might fail, complaining about AIO even after installing it. Ignore it and re-run configure with the AIO switch removed from the command

       make

    d. The resulting executable is qemu/x86_64-softmnu/qemu-system-x86_64/qemu-system-x86_64. You can add it to $PATH for easy access.

3. Make a virtual HD for QEMU
    1. On RHEL5:
       yum install qemu-img

    2. Execute
       qemu-img create -f raw <your_virtual_HD_filename.img> <size>M

4. Locate and download a Linux based 64b OS to virtualize
    1. Download the iso file and save as <your_iso_image_filename.iso>

5. Install KVM

    1. On RHEL5:
       yum install kvm kmod-kvm

6. Install the guest OS to the virtual HD
   1. Execute
      ./qemu-system-x86_64 -m 1024 -cdrom <path_to_your_iso_image>/<your_iso_image_filename.iso> -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device nvme -boot d
          A terminal window should launch into view booting from the supplied ISO file.
          Follow through the usual actions to install the OS onto the virtual HD.
          Feel free to partition/format/re-initialize virtual HD as necessary.
          At the end of a successful installation reboot the virtual machine.

7. Boot the virtual machine from the virtual HD
    1. Execute with kvm support (recommended)
       sudo ./qemu-system-x86_64 -m 1024 -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device nvme --enable-kvm -smp 2
    2. Execute without kvm support
       sudo ./qemu-system-x86_64 -m 1024 -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device nvme -smp 2

8. Performance notes
    1. Consider adding the following switches when invoking configure:
    --enable-io-thread --enable-linux-aio
    2. Consider adding the following switches when invoking qemu:
    --enable-kvm -smp 2

9. Usage Notes
    1. Config Files
           NVME module of Qemu uses two device config files called "NVME_device_PCI_config" and "NVME_device_NVME_config" located inside the /qemu/hw directory
           They basically enable the user to set up the intial values in both the PCI and NVME config space
           These file names are unique and thus there should not be multiple files with the above names inside the directory from where the qemu is run by executing Step 6
           Program should be executed from an higher level directory so that both the config files are available inside the directory itself else both spaces will be initialized to
           defaulted values
    2. Additional command line options:
            You can configure the number of namespaces and their sizes from the command line. The options are: namespaces=<number_of_namespaces> and size=<size_in_MB>. These options go after the "-device namespace". Example
            sudo ./qemu-system-x86_64 -m 1024 -hda <path_to_virtual_HD>/<your_virtual_HD_filename.img> -device,namespace=1,size=1024 nvme -smp 2
            The program limits the number of namespaces to 16 per device and 8GB in size. There will be 1 namespace of 512 MB by default if no opt

            Full list of -device nvme options:
            namespaces=<number_of_namespaces>  : the maximum number of namespaces the device can have.
            size=<size_in_MB>                  : size each automatically created namespace will be.

Something went wrong with that request. Please try again.