The LightNVM qemu implementation, based on NVMe
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
audio audio: Drop superfluous conditionals around g_free() Jun 13, 2014
backends Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into sta… Sep 18, 2014
block block: Make device model's references to BlockBackend strong Oct 20, 2014
bsd-user bsd-user: Fix syscall format, add strace support for more syscalls Jun 10, 2014
default-configs Merge remote-tracking branch 'upstream/master' Oct 23, 2014
disas target-mips: remove JR, BLTZAL, BGEZAL and add NAL, BAL instructions Oct 14, 2014
docs block: Rename BlockDriverCompletionFunc to BlockCompletionFunc Oct 20, 2014
dtc @ bc895d6 dtc: add submodule Apr 18, 2013
fpu softfloat: add functions corresponding to IEEE-2008 min/maxNumMag Oct 14, 2014
fsdev virtfs-proxy-helper: fix call to accept Apr 28, 2014
gdb-xml s390x/gdb: add the feature xml files for s390x Sep 1, 2014
hw nvme: update documentation for param Sep 17, 2018
include dma: allow r/w dma handlers to use addr list Feb 10, 2016
libcacard Fix typos and misspellings in comments Sep 20, 2014
libdecnumber libdecnumber: Fix warnings from smatch (missing static, boolean opera… Aug 24, 2014
linux-headers linux-headers: update to 3.17-rc7 Oct 10, 2014
linux-user translate-all.c: memory walker initial address miscalculation Oct 6, 2014
net Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request'… Sep 4, 2014
pc-bios linuxboot: compute initrd loading address Oct 9, 2014
pixman @ 87eea99 pixman: update internal copy to pixman-0.32.6 Sep 15, 2014
po po: fix conflict with %.mo rule in rules.mak Sep 26, 2014
qapi qapi: Add corrupt field to ImageInfoSpecificQCow2 Oct 4, 2014
qga qga: Rewrite code where using readdir_r Oct 22, 2014
qobject json-lexer: fix escaped backslash in single-quoted string Jun 23, 2014
qom qom: Add description field in ObjectProperty struct Oct 15, 2014
roms Update OpenBIOS images Sep 25, 2014
scripts Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into st… Sep 29, 2014
slirp slirp: udp: fix NULL pointer dereference because of uninitialized socket Sep 23, 2014
stubs block: Code motion to get rid of stubs/blockdev.c Oct 20, 2014
sysconfigs/target Eliminate cpus-x86_64.conf file Sep 21, 2012
target-alpha target-alpha: Use cpu_exec_interrupt qom hook Sep 25, 2014
target-arm gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag Oct 6, 2014
target-cris gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag Oct 6, 2014
target-i386 Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into… Sep 26, 2014
target-lm32 gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag Oct 6, 2014
target-m68k target-m68k: Use cpu_exec_interrupt qom hook Sep 25, 2014
target-microblaze target-microblaze: Use cpu_exec_interrupt qom hook Sep 25, 2014
target-mips target-mips: Remove unused gen_load_ACX, gen_store_ACX and cpu_ACX Oct 14, 2014
target-moxie softmmu: introduce cpu_ldst.h Jun 5, 2014
target-openrisc target-openrisc: Use cpu_exec_interrupt qom hook Sep 25, 2014
target-ppc qdev: Drop legacy_name from qdev properties Oct 15, 2014
target-s390x s390x/migration: migrate CPU state Oct 10, 2014
target-sh4
target-sparc target-sparc: Use cpu_exec_interrupt qom hook Sep 25, 2014
target-tricore target-tricore: Add instructions of BO opcode format Oct 20, 2014
target-unicore32 target-unicore32: Use cpu_exec_interrupt qom hook Sep 25, 2014
target-xtensa gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag Oct 6, 2014
tcg tcg: Always enable TCGv type checking Sep 29, 2014
tests block: Rename BlockDriverAIOCB* to BlockAIOCB* Oct 20, 2014
trace trace: [hmp] Reimplement "trace-event" and "info trace-events" using QMP Sep 26, 2014
ui gtk: Replace gdk_cursor_new() Apr 29, 2016
util Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into… Oct 9, 2014
.exrc qemu: add .exrc Sep 7, 2012
.gitignore trace: [tcg] Generate TCG tracing routines Aug 12, 2014
.gitmodules PPC: Add u-boot firmware for e500 Jun 16, 2014
.mailmap Update mailmap Sep 5, 2013
.travis.yml .travis.yml: remove "make check" from main matrix Sep 26, 2014
CODING_STYLE CODING_STYLE: Section about conditional statement Aug 15, 2014
COPYING COPYING: update from FSF Oct 12, 2008
COPYING.LIB Update FSF address in GPL/LGPL boilerplate Jan 4, 2009
Changelog Use qemu-project.org domain name Oct 11, 2013
HACKING HACKING: Document vaddr type usage Jul 23, 2013
LICENSE LICENSE: clarify Aug 12, 2013
MAINTAINERS s390x: sweep up unmaintained files Oct 21, 2014
Makefile trace: install trace-events file Sep 26, 2014
Makefile.objs qemu-file: Move stdio implementation to qemu-file-stdio.c Oct 14, 2014
Makefile.target bootdevice: move bootdevice related code to new file bootdevice.c Oct 15, 2014
README.md Update README.md Jun 6, 2018
VERSION Open 2.2 development tree Aug 1, 2014
accel.c accel: Create accel object when initializing machine Oct 9, 2014
aio-posix.c AioContext: introduce aio_prepare Aug 29, 2014
aio-win32.c aio-win32: avoid out-of-bounds access to the events array Sep 22, 2014
arch_init.c migration: catch unknown flag combinations in ram_load Oct 14, 2014
async.c async: aio_context_new(): Handle event_notifier_init failure Sep 22, 2014
balloon.c qapi event: convert BALLOON_CHANGE Jun 23, 2014
block-migration.c block: Rename BlockDriverAIOCB* to BlockAIOCB* Oct 20, 2014
block.c block: Lift device model API into BlockBackend Oct 20, 2014
blockdev-nbd.c block: Use g_new() & friends where that makes obvious sense Aug 20, 2014
blockdev.c block: Lift device model API into BlockBackend Oct 20, 2014
blockjob.c
bootdevice.c bootindex: change fprintf to error_report Oct 15, 2014
bt-host.c
bt-vhci.c sysemu: avoid proliferation of include/ subdirectories Apr 15, 2013
configure configure: Prepend pixman and ftd flags to overrule system-provided ones Oct 15, 2014
coroutine-gthread.c glib-compat.h: add new thread API emulation on top of pre-2.31 API Jun 10, 2014
coroutine-sigaltstack.c Merge remote-tracking branch 'kwolf/for-anthony' into staging Feb 26, 2013
coroutine-ucontext.c Fix warnings suppressors to honor --disable-werror Apr 17, 2013
coroutine-win32.c coroutine-win32.c: Add noinline attribute to work around gcc bug Jun 26, 2014
cpu-exec.c cpu-exec: Do CPU_INTERRUPT_HALT unconditionally Sep 25, 2014
cpus.c Introduce cpu_clean_all_dirty Sep 16, 2014
cputlb.c implementing victim TLB for QEMU system emulated TLB Sep 1, 2014
device-hotplug.c blockdev: Eliminate drive_del() Oct 20, 2014
device_tree.c device_tree.c: dump all err mesages with error_report Sep 2, 2014
disas.c monitor: QEMU Monitor Instruction Disassembly Incorrect for PowerPC L… Jun 16, 2014
dma-helpers.c lightnvm: add support for multi-sector pages Feb 17, 2016
dump.c dump.c: Fix memory leak issue in cleanup processing for dump_init() Aug 18, 2014
exec.c exec.c: fix setting 1-byte-long watchpoints Sep 19, 2014
gdbstub.c gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag Oct 6, 2014
hmp-commands.hx Add HMP command "info memory-devices" Sep 26, 2014
hmp.c
hmp.h Add HMP command "info memory-devices" Sep 26, 2014
iohandler.c
ioport.c memory: convert memory_region_destroy to object_unparent Aug 18, 2014
iothread.c async: aio_context_new(): Handle event_notifier_init failure Sep 22, 2014
kernel.config add kernel configuration file for ocssd Apr 25, 2018
kvm-all.c kvm fix compilation with GCC 4.3.4 Oct 10, 2014
kvm-stub.c accel: Move KVM accel registration to kvm-all.c Oct 4, 2014
main-loop.c main-loop.c: Handle SIGINT, SIGHUP and SIGTERM synchronously Sep 26, 2014
memory.c memory: add parameter errp to memory_region_init_rom_device Sep 9, 2014
memory_mapping.c cpu: Use QTAILQ for CPU list Sep 3, 2013
migration-exec.c aio / timers: Untangle include files Aug 22, 2013
migration-fd.c aio / timers: Untangle include files Aug 22, 2013
migration-rdma.c rdma: Fix incorrect description in comments Sep 20, 2014
migration-tcp.c qemu-sockets: Add error to non-blocking connect handler Oct 9, 2014
migration-unix.c qemu-sockets: Add error to non-blocking connect handler Oct 9, 2014
migration.c block/migration: Disable cache invalidate for incoming migration Oct 14, 2014
module-common.c module: implement module loading Feb 20, 2014
monitor.c block: Rename BlockDriverCompletionFunc to BlockCompletionFunc Oct 20, 2014
nbd.c block/migration: Disable cache invalidate for incoming migration Oct 14, 2014
numa.c memory: add parameter errp to memory_region_init_ram Sep 9, 2014
os-posix.c os-posix: report error message when lock file failed Sep 26, 2014
os-win32.c util: Split out exec_dir from os_find_datadir Feb 20, 2014
page_cache.c migration: Plug memory leak in migrate-set-cache-size command Jun 10, 2014
qapi-schema.json qmp: Print descriptions of object properties Oct 15, 2014
qdev-monitor.c qmp: Print descriptions of object properties Oct 15, 2014
qdict-test-data.txt Introduce QDict test data file Sep 4, 2009
qemu-bridge-helper.c qemu-bridge-helper: Fix fd leak in main() Jun 27, 2014
qemu-char.c qemu-char: Fix reconnect socket error reporting Oct 9, 2014
qemu-coroutine-io.c qemu-coroutine-io: fix for Win32 Aug 29, 2014
qemu-coroutine-lock.c coroutine: remove qemu_co_queue_wait_insert_head Dec 2, 2013
qemu-coroutine-sleep.c coroutine: Drop co_sleep_ns Aug 29, 2014
qemu-coroutine.c coroutine: make pool size dynamic Aug 15, 2014
qemu-doc.texi
qemu-file-stdio.c qemu-file: Move stdio implementation to qemu-file-stdio.c Oct 14, 2014
qemu-file-unix.c qemu-file: Move unix and socket implementations to qemu-file-unix.c Oct 14, 2014
qemu-file.c qemu-file: Move stdio implementation to qemu-file-stdio.c Oct 14, 2014
qemu-img-cmds.hx qemu-img: Allow cache mode specification for amend Aug 22, 2014
qemu-img.c block: Make BlockBackend own its BlockDriverState Oct 20, 2014
qemu-img.texi block: delete cow block driver Sep 22, 2014
qemu-io-cmds.c qemu-io-cmds: g_renew() can't fail, bury dead error handling Aug 20, 2014
qemu-io.c block: Make BlockBackend own its BlockDriverState Oct 20, 2014
qemu-log.c qemu-log: default to stderr for logging output Feb 26, 2013
qemu-nbd.c block: Make BlockBackend own its BlockDriverState Oct 20, 2014
qemu-nbd.texi nbd: Miscellaneous typo fixes. May 23, 2014
qemu-options-wrapper.h vl.c: In qemu -h output, only print options for the arch we are runni… Dec 19, 2011
qemu-options.h vl.c: Move option generation logic into a wrapper file Dec 19, 2011
qemu-options.hx qemu-char: Add reconnecting to client sockets Oct 4, 2014
qemu-seccomp.c seccomp: add semctl() to the syscall whitelist Aug 21, 2014
qemu-tech.texi qemu-tech.texi: update implemented xtensa features list Nov 29, 2012
qemu-timer.c
qemu.nsi nsis: Improved support for parallel installation of 32 and 64 bit code Nov 7, 2013
qemu.sasl sasl: Avoid 'Could not find keytab file' in syslog Mar 15, 2014
qmp-commands.hx add input-send-event command Oct 2, 2014
qmp.c qmp: Print descriptions of object properties Oct 15, 2014
qtest.c accel: Pass MachineState object to accel init functions Oct 9, 2014
rules.mak Fix cross compilation (nm command) Sep 19, 2014
savevm.c snapshot: fix referencing wrong variable in while loop in do_delvm Oct 3, 2014
softmmu_template.h implementing victim TLB for QEMU system emulated TLB Sep 1, 2014
spice-qemu-char.c qemu-char: Rename register_char_driver_qapi() to register_char_driver() Sep 16, 2014
tcg-runtime.c tcg: Push tcg-runtime routines into exec/helper-* May 28, 2014
tci.c Merge remote-tracking branch 'remotes/bonzini/softmmu-smap' into staging Jun 5, 2014
thread-pool.c block: Rename BlockDriverCompletionFunc to BlockCompletionFunc Oct 20, 2014
thunk.c exec: move include files to include/exec/ Dec 19, 2012
tpm.c Use error_is_set() only when necessary Feb 17, 2014
trace-events trace: remove malloc tracing Apr 27, 2016
translate-all.c translate-all.c: memory walker initial address miscalculation Oct 6, 2014
translate-all.h translate-all: Change tb_check_watchpoint() argument to CPUState Mar 13, 2014
user-exec.c softmmu: introduce cpu_ldst.h Jun 5, 2014
version.rc
vl.c trace: remove malloc tracing Apr 27, 2016
vmstate.c vmstate: Allow dynamic allocation for VBUFFER during migration Oct 14, 2014
xbzrle.c xbzrle.c: Avoid undefined behaviour with signed arithmetic Apr 18, 2014
xen-common-stub.c accel: Move Xen registration code to xen-common.c Oct 4, 2014
xen-common.c accel: Pass MachineState object to accel init functions Oct 9, 2014
xen-hvm-stub.c xen-hvm: Fix xen_hvm_init() to adjust pc memory layout Jun 23, 2014
xen-hvm.c xen-hvm.c: Always return -1 when failure occurs in xen_hvm_init() Sep 20, 2014
xen-mapcache.c xen: build on ARM Jul 7, 2014

README.md

Virtual Open-Channel SSD 2.0

This repository implements support for exposing an NVMe device that implements the Open-Channel 2.0 specification.

Compiling & Installing

Below is a minimal example of the installation process for x86_64, kvm-enabled emulation using libaio for I/O.

git clone https://github.com/OpenChannelSSD/qemu-nvme.git

cd qemu-nvme
./configure --enable-kvm --target-list=x86_64-softmmu --enable-linux-aio --disable-werror --disable-xen --prefix=$HOME/qemu-nvme
make
make install

That'll install the OCSSD enabled qemu binary into $HOME/qemu-nvme.

Configuring the virtual open-channel SSD drive

The device must have a backend file to store its data. Create a backend file by (e.g., 8GB)

dd if=/dev/zero of=ocssd_backend.img bs=1M count=8096

The qemu arguments must be extended with:

-drive file={path to ocssd backend file},id=myocssd,format=raw,if=none \
-device nvme,drive=myocssd,serial=deadbeef,lnum_pu=4,lstrict=1,meta=16,mc=3 \

The full command line could look like the following and creates an ocssd with 4 parallel units:

sudo $HOME/qemu-nvme/bin/qemu-system-x86_64 -m 4G -smp 4 -s \
-drive file={path to vm image},id=diskdrive,format=raw,if=none \
-device virtio-blk-pci,drive=diskdrive,scsi=off,config-wce=off,x-data-plane=on \
-drive file={path to ocssd backend file},id=myocssd,format=raw,if=none \
-device nvme,drive=myocssd,serial=deadbeef,lnum_pu=4,lstrict=1,meta=16,mc=3

A complete list of all options supported by the NVMe device can be found in the source with comments on each option at the top of the file and a list of options and their default values toward the bottom of the file.

In the virtual machine, make sure to install at least Linux kernel 4.17 or latest release candidate.

Current limitations

  • The driver does not support multiple groups. This should however be easy to implement.