qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Lindsay Mathieson <lindsay.mathieson@gmail.com>
Cc: qemu-devel@nongnu.org, Fam Zheng <famz@redhat.com>
Subject: Re: [Qemu-devel] Loadable block drivers?
Date: Mon, 9 Apr 2018 14:19:10 +0800	[thread overview]
Message-ID: <20180409061910.GD4848@stefanha-x1.localdomain> (raw)
In-Reply-To: <CAEMkAmETfoekTw=VP1K5c=z1P9uSb7pm7VNkrJjgEdd1NLjAnA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

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
  #!/bin/sh
  if echo "$*" | grep -q -- '-name testvm'; then
      exec /path/to/custom/qemu "$@"
  else
      exec /usr/bin/qemu-kvm.orig "$@"
  fi
  ^D
  # 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
limited.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

      parent reply	other threads:[~2018-04-09  6:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03  2:59 [Qemu-devel] Loadable block drivers? Lindsay Mathieson
2018-04-03  3:11 ` Fam Zheng
2018-04-03  3:17   ` Lindsay Mathieson
2018-04-03  3:30     ` Fam Zheng
2018-04-04 13:41       ` Stefan Hajnoczi
2018-04-05  1:40         ` Lindsay Mathieson
2018-04-08  9:27           ` Fam Zheng
2018-04-09  6:19           ` Stefan Hajnoczi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180409061910.GD4848@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=famz@redhat.com \
    --cc=lindsay.mathieson@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).