[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Loadable block drivers?

From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Loadable block drivers?
Date: Mon, 9 Apr 2018 14:19:10 +0800
User-agent: Mutt/1.9.2 (2017-12-15)

On Thu, Apr 05, 2018 at 11:40:31AM +1000, Lindsay Mathieson wrote:
> Thanks Stefan, looking to develop a lizardfs block driver. A process that
> only involved building a module rather than the entire qemu tree would mike
> life easier, especially if I could test it on a live system (proxmox
> cluster). A custom qemu install is not an option for that.

Since your final goal is to create a native LizardFS block driver, it is
necessary to build a full QEMU.

With libvirt you can edit the domain XML to point
<emulator>/usr/bin/qemu-kvm</emulator> at your custom binary for just
that VM.

In the worst case you can put a little shell script in place of the
system QEMU binary that checks the command-line arguments to detect your
test VM.  It can exec your custom QEMU binary for the test VM, and the
system QEMU binary for all other VMs:

  # mv /usr/bin/qemu-kvm /usr/bin/qemu-kvm.orig
  # cat >/usr/bin/qemu-kvm
  if echo "$*" | grep -q -- '-name testvm'; then
      exec /path/to/custom/qemu "$@"
      exec /usr/bin/qemu-kvm.orig "$@"
  # chmod 755 /usr/bin/qemu-kvm

I recommend using qemu.git/master and not an old source tree to avoid
extra work if you want to contribute your code or if you need to ask for
help (the first question will be "does it work on qemu.git/master?" :)).

QEMU does not have stable APIs or out-of-tree modules.  Development is
most convenient when done upstream as part of the community.  Anything
else requires you to maintain a fork and community support will be very


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]