From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aliguori@linux.vnet.ibm.com, agl@linux.vnet.ibm.com,
mdroth@linux.vnet.ibm.com, Jes.Sorensen@redhat.com
Subject: [Qemu-devel] [RFC][PATCH v1 00/11] QEMU Guest Agent: QMP-based host/guest communication (virtagent)
Date: Fri, 25 Mar 2011 14:47:47 -0500 [thread overview]
Message-ID: <1301082479-4058-1-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
These apply on top of Anthony's glib tree, commit 03d5927deb5e6baebaade1b4c8ff2428a85e125c currently, and can also be obtained from:
git://repo.or.cz/qemu/mdroth.git qga_v1
The QGA-specific patches are in pretty rough shape, and there are some outstanding issues that I'll note below. I just wanted to put the general approach out there for consideration. Patch-level comments/review are still much-appreciated though.
However, patches 1-5 are general json/QAPI-related fixes. Anthony, please consider pulling these into your glib tree. The json fix-ups may need further evaluation, but I'm confident they're at least an improvement. The QAPI ones are trivial fix-ups.
ISSUES/TODOS:
- QMP's async callbacks expect the command results to be de-marshalled beforehand. This is completely infeasible to attempt outside of the code generator, so this is a big area that needs to be addressed. So for now, only the 'guest-ping' command works, since it has no return value. The dummy "guest-view-file" command will cause an error to be reported to the client.
- qemu-ga guest daemon is currently not working over virtio-serial or isa-serial. This is probably an issue with how I'm using glib's io channel interfaces, still investigating. This means the only way to currently test is by invocing qemu-ga with "-c unix-listen -p <sockpath>", then doing something like `socat /dev/ttyS0,raw,echo=0 unix-connect:<sockpath>`.
- guest-view-file is a stub, and will be broken out into an open/read/close set of RPCs, possibly with a high-level interface built around those.
OVERVIEW
For a better overview of what these patches are meant to accomplish, please reference the RFC for virtagent:
http://comments.gmane.org/gmane.comp.emulators.qemu/96096
These patches integrate the previous virtagent guest agent work directly in QAPI/QMP to leverage it's auto-generated marshalling code. This has numerous benefits:
- addresses previous concerns over relying on external libraries to handle data encapsulation
- reduces the need for manual unmarshalling of requests/responses, which makes adding new RPCs much safer/less error-prone, as well as cutting down on redundant code
- QAPI documentation aligns completely with guest-side RPC implementation
- is Just Better (TM)
BUILD/USAGE
build:
./configure --target-list=x86_64-softmmu
make
make qemu-ga #should be built on|for target guest
start guest:
qemu \
-drive file=/home/mdroth/vm/rhel6_64_base.raw,snapshot=off,if=virtio \
-net nic,model=virtio,macaddr=52:54:00:12:34:00 \
-net tap,script=/etc/qemu-ifup \
-vnc :1 -m 1024 --enable-kvm \
-chardev socket,path=/tmp/mon-qmp.sock,server,nowait,id=mon-qmp \
-qmp mon-qmp \
-chardev qmp_proxy,path=/tmp/qmp-proxy2.sock,server,nowait,id=qmp_proxy \
-device virtio-serial \
-device virtserialport,chardev=qmp_proxy,name=qcg"
use guest agent:
./qemu-ga -h
./qemu-ga -c virtio-serial -p /dev/virtio-ports/qcg
start/use qmp:
mdroth@illuin:~$ sudo socat unix-connect:/tmp/mon-qmp.sock readline
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 13, "major": 0}, "package": ""}, "capabilities": []}}
{"execute":"guest-ping"}
{"return": {}}
__
Makefile | 5 +-
Makefile.objs | 1 +
configure | 6 +-
guest-agent-commands.c | 24 +++
guest-agent-core.c | 143 +++++++++++++
guest-agent-core.h | 21 ++
json-lexer.c | 22 ++-
json-lexer.h | 1 +
json-parser.c | 6 +-
json-streamer.c | 35 ++-
qemu-char.c | 46 +++++
qemu-ga.c | 522 ++++++++++++++++++++++++++++++++++++++++++++++++
qmp-core.c | 13 +-
qmp-core.h | 7 +-
qmp-gen.py | 2 +-
qmp-proxy-core.h | 20 ++
qmp-proxy.c | 335 +++++++++++++++++++++++++++++++
vl.c | 1 +
18 files changed, 1181 insertions(+), 29 deletions(-)
next reply other threads:[~2011-03-25 19:48 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 19:47 Michael Roth [this message]
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 01/12] json-lexer: make lexer error-recovery more deterministic Michael Roth
2011-03-25 21:18 ` [Qemu-devel] " Anthony Liguori
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 02/12] json-streamer: add handling for JSON_ERROR token/state Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 03/12] json-parser: add handling for NULL token list Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 04/12] qapi: fix function name typo in qmp-gen.py Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 05/12] qapi: fix handling for null-return async callbacks Michael Roth
2011-03-25 21:22 ` [Qemu-devel] " Anthony Liguori
2011-03-28 16:47 ` Luiz Capitulino
2011-03-28 17:01 ` Anthony Liguori
2011-03-28 17:06 ` Luiz Capitulino
2011-03-28 17:19 ` Anthony Liguori
2011-03-28 17:27 ` Luiz Capitulino
2011-03-28 17:39 ` Anthony Liguori
2011-03-28 17:59 ` Michael Roth
2011-03-28 18:27 ` Anthony Liguori
2011-03-28 20:42 ` Michael Roth
2011-03-28 20:45 ` Anthony Liguori
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 06/12] qmp proxy: build qemu with guest proxy dependency Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 07/12] qmp proxy: core code for proxying qmp requests to guest Michael Roth
2011-03-25 21:27 ` [Qemu-devel] " Anthony Liguori
2011-03-25 21:56 ` Michael Roth
2011-03-28 19:05 ` Anthony Liguori
2011-03-28 19:57 ` Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 08/12] qemu-char: add qmp_proxy chardev Michael Roth
2011-03-25 21:29 ` [Qemu-devel] " Anthony Liguori
2011-03-25 22:11 ` Michael Roth
2011-03-28 17:45 ` Anthony Liguori
2011-03-29 18:54 ` Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 09/12] guest agent: core marshal/dispatch interfaces Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 10/12] guest agent: qemu-ga daemon Michael Roth
2011-04-01 9:45 ` [Qemu-devel] " Jes Sorensen
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 11/12] guest agent: guest-side command implementations Michael Roth
2011-03-25 19:47 ` [Qemu-devel] [RFC][PATCH v1 12/12] guest agent: build qemu-ga, add QEMU-wide gio dep Michael Roth
2011-03-25 20:42 ` [Qemu-devel] Re: [RFC][PATCH v1 00/11] QEMU Guest Agent: QMP-based host/guest communication (virtagent) Michael Roth
2011-03-25 22:03 ` Anthony Liguori
2011-03-25 22:36 ` Michael Roth
2011-03-28 17:03 ` Anthony Liguori
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=1301082479-4058-1-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=Jes.Sorensen@redhat.com \
--cc=agl@linux.vnet.ibm.com \
--cc=aliguori@linux.vnet.ibm.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).