All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: agl@linux.vnet.ibm.com, abeekhof@redhat.com,
	mdroth@linux.vnet.ibm.com, aliguori@linux.vnet.ibm.com,
	ryanh@us.ibm.com, amit.shah@redhat.com
Subject: [Qemu-devel] (no subject)
Date: Wed, 10 Nov 2010 19:30:55 -0600	[thread overview]
Message-ID: <1289439066-23387-1-git-send-email-mdroth@linux.vnet.ibm.com> (raw)

>From Michael Roth <mdroth@linux.vnet.ibm.com> # This line is ignored.
From: Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: [RFC][PATCH v3 00/11] virtagent: host/guest RPC communication agent
In-Reply-To: 

This set of patches is meant to be applied on top of the recently submitted Virtproxy v2 patchset. It can also be obtained at:

git://repo.or.cz/qemu/mdroth.git virtproxy_v2

OVERVIEW:

There are a wide range of use cases motivating the need for a guest agent of some sort to extend the functionality/usability/control offered by QEMU. Some examples include graceful guest shutdown/reboot and notifications thereof, copy/paste syncing between host/guest, guest statistics gathering, file access, etc.

Ideally these would all be served by a single, easilly extensible agent that can be deployed in a wide range of guests. Virtagent is an XMLRPC server integrated into the Virtproxy guest daemon and aimed at providing this type of functionality.

CHANGES IN V3:

 - Integrated virtagent invocation into virtproxy chardev. Usage examples below.
 - Consolidated RPC server/client setup into a pair of init routines
 - Fixed buffer overflow in agent_viewfile() and various memory leaks

CHANGES IN V2:

 - All RPC communication is now done using asynchronous/non-blocking read/write handlers
 - Previously fork()'d RPC server loop is now integrated into qemu-vp/virtproxy i/o loop
 - Cleanups/suggestions from previous RFC

DESIGN:

There are actually 2 RPC servers:

1) a server in the guest integrated into qemu-vp, the Virtproxy guest daemon, which handles RPC requests from QEMU
2) a server in the host, integrated into the virtproxy chardev, to handle RPC requests sent by the guest agent (mainly for handling asynchronous events reported by the agent).

At the Virtagent level, communication is done via standard RPCs (HTTP between host and guest). Virtproxy transparently handles transport over a network or isa/virtio serial channel, allowing the agent to be deployed on older guests which may not support virtio-serial.

Currently there are only 2 RPCs implemented for the guest server (getfile and getdmesg), and 0 for the host. Additional RPCs can be added fairly easily, but are dependent on feedback from here and elsewhere. ping/status, shutdown, and reboot are likely candidates (although the latter 2 will likely require asynchronous notifications to the host RPC server to implement reliably).

EXAMPLE USAGE:

The commandline options are a little convoluted right now; this will addressed in later revisions.

 - Configure guest agent to talk to host via virtio-serial
    # start guest with virtio-serial/virtproxy/virtagent. for example (RHEL6rc1):
    qemu \
    -chardev virtproxy,id=test0,virtagent=on \
    -device virtio-serial \
    -device virtserialport,chardev=test0,name=virtagent0 \
    -monitor stdio
    ...
    # in the guest:
    ./qemu-vp -c virtserial-open:/dev/virtio-ports/virtagent0:- -g
    ...
    # monitor commands
    (qemu) agent_viewdmesg
    [139311.710326] wlan0: deauthenticating from 00:30:bd:f7:12:d5 by local choice (reason=3)
    [139323.469857] wlan0: deauthenticating from 00:21:29:cd:41:ee by local choice (reason=3)
    ...
    [257683.375646] wlan0: authenticated
    [257683.375684] wlan0: associate with AP 00:30:bd:f7:12:d5 (try 1)
    [257683.377932] wlan0: RX AssocResp from 00:30:bd:f7:12:d5 (capab=0x411 status=0 aid=4)
    [257683.377940] wlan0: associated
    
    (qemu) agent_viewfile /proc/meminfo
    MemTotal:        3985488 kB
    MemFree:          400524 kB
    Buffers:          220556 kB
    Cached:          2073160 kB
    SwapCached:            0 kB
    ...
    Hugepagesize:       2048 kB
    DirectMap4k:        8896 kB
    DirectMap2M:     4110336 kB

KNOWN ISSUES/PLANS:
 - the client socket that qemu connects to send RPCs is a hardcoded filepath. This is unacceptable as the socket is channel/process specific and things will break when multiple guests are started.
 - capability negotiation will be needed to handle version/architecture differences.
 - proper channel negotiation is needed to avoid hung monitors and such when a guest reboots or the guest agent is stopped for whatever reason. additionally, a timeout may need to be imposed on the amount of time the http read handler can block the monitor.
 - additional host-to-guest RPCs as well as asynchronous notifications via guest-to-host RPCs for events such as shutdown/reboot/agent up/agent down

             reply	other threads:[~2010-11-11  1:31 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11  1:30 Michael Roth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-02-25 13:18 [Qemu-devel] (no subject) Yang Weijiang
2019-01-02  2:02 Yaowei Bai
2018-12-13 10:10 Илья Резников
2018-11-28  1:08 John Arbuckle
2018-11-28 19:39 ` Peter Maydell
2018-11-29  0:21   ` Programmingkid
2018-11-29  2:11     ` berkus infinitus
2018-11-29 10:18       ` Peter Maydell
2018-07-22  9:13 Liujinsong (Paul)
2018-06-20  7:32 [Qemu-devel] [PATCH v5 0/7] monitor: enable OOB by default Peter Xu
2018-06-26 17:21 ` [Qemu-devel] (no subject) Markus Armbruster
2017-10-12 23:54 Anatol Pomozov
2017-08-07 16:34 Eduardo Otubo
2017-08-07 13:31 vaibhav shukla
2017-05-17 22:42 John Bradley
2017-05-18  5:29 ` no-reply
2017-05-18  5:31 ` no-reply
     [not found] <CAMj-D2DO_CfvD77izsGfggoKP45HSC9aD6auUPAYC9Yeq_aX7w@mail.gmail.com>
2017-05-04 16:44 ` gengdongjiu
2017-03-21 14:03 [Qemu-devel] [PATCH] qemu-ga: add guest-get-osinfo command Vinzenz Feenstra
2017-03-16 14:50 ` [Qemu-devel] (no subject) Vinzenz 'evilissimo' Feenstra
2017-03-23 13:44   ` Eric Blake
2017-02-24 13:19 Eric Bischoff
2017-02-17 15:42 Pranith Kumar
2017-01-02 12:03 morgenlette madeBy
2017-01-03 16:36 ` Stefan Hajnoczi
2016-11-16 19:41 Christopher Oliver
2016-11-17  9:15 ` Thomas Huth
2016-10-30 15:30 Pradeep Jagadeesh
2016-10-20  6:59 Nicholas Piggin
2016-10-12 21:49 Neeraj Sharma
2016-10-02  6:47 Shreya Shrivastava
2016-09-12 21:23 Stephen Bates
2016-09-13  2:28 ` Fam Zheng
2016-09-19 15:54   ` Stephen Bates
2016-07-31 15:07 Kumud Bhat
2016-03-21  8:44 Yunqiang Gao
2016-03-21 18:00 ` John Snow
2016-03-21 21:09   ` Peter Maydell
2016-03-22 21:45     ` John Snow
2016-01-15 10:06 Liang Li
2015-11-17 13:08 Christoph Hellwig
2015-11-17 17:29 ` Paolo Bonzini
2015-07-14  7:33 Pankaj Gupta
2015-07-02 16:18 Denis V. Lunev
2015-06-30  4:49 Scott Feldman
2015-06-30  7:18 ` Fam Zheng
2015-06-30 14:22   ` Scott Feldman
2015-05-03 14:10 yhindin
2015-05-03 14:10 yhindin
2015-05-03 14:10 yhindin
2015-05-03 14:07 yhindin
2015-05-03 14:07 yhindin
2015-02-22  1:00 Sunil Kumar
2014-12-06 10:54 Jun Li
2014-11-10  3:14 xubin yan
2014-09-17 16:20 Priyanka Ranjan
2014-06-12 14:45 Puneet Bakshi
2014-02-04 14:18 Валентин Сайков
2013-11-21 19:33 [Qemu-devel] [PATCH for-1.7 0/5] acpi unit-test: added tests Marcel Apfelbaum
2013-11-21 19:33 ` [Qemu-devel] [PATCH for-1.7 2/5] acpi unit-test: adjust the test data structure for better handling Marcel Apfelbaum
2013-12-10 16:42   ` [Qemu-devel] (no subject) Michael S. Tsirkin
2013-08-18 18:19 Liu, Jinsong
2013-05-06 13:47 [Qemu-devel] [PATCH] Add 'maxqdepth' as an option to tty character devices Paolo Bonzini
2013-05-07 16:36 ` [Qemu-devel] (no subject) John Baboval
2013-04-02 16:02 Elizabeth Brown
2013-04-05  7:18 ` Stefan Hajnoczi
2012-11-19 20:39 Stefan Priebe
2012-07-23 10:59 Paulo Arcinas
2012-07-20  3:39 Guan Xuetao
2012-04-01 16:19 César
2012-03-08  3:26 suyi wang
     [not found] <[0/4] RESEND: Outstanding bugfixes and cleanups>
2012-03-08  0:41 ` David Gibson
2012-02-29 12:43 Dmitry Fleytman
2011-12-29 21:17 Fred Oliveira
2011-12-13  2:50 Erik Lotspeich
2011-12-13  8:06 ` Stefan Hajnoczi
2011-12-13 12:55   ` Erik Lotspeich
2011-12-13 14:57     ` Stefan Hajnoczi
2011-12-13 15:22       ` Erik Lotspeich
2011-12-13 15:56         ` Paolo Bonzini
2011-12-08 12:06 wong
2011-11-11 21:46 Ronnie Sahlberg
2011-10-24 21:03 Benoît Canet
2011-10-24 10:25 王永博
2011-09-29 16:55 Ottavio
2011-09-14 14:38 王永博
2011-08-03 14:50 Michael Tokarev
2011-06-12  2:47 Ronnie Sahlberg
2011-05-31  4:56 coolman coolx
2011-03-08  9:59 Stefan Hajnoczi
2011-02-17 10:45 maheen butt
2011-01-04 15:15 Aurelien Jarno
2011-01-04 16:06 ` Peter Maydell
2011-01-04 16:12   ` Aurelien Jarno
2010-12-13  8:05 Ronnie Sahlberg
2010-12-06  0:39 Joao Francisco Medeiros Neto
2010-12-05 19:29 Joao Francisco Medeiros Neto
2010-12-02 18:21 Joao Francisco Medeiros Neto
2010-11-28 14:28 Joao Francisco Medeiros Neto
2010-11-27 16:37 Joao Francisco Medeiros Neto
2010-11-12  9:43 Stefan Hajnoczi
2010-10-31 11:17 Zamzit
2010-10-22 14:56 Stefan Hajnoczi
2010-05-18  7:31 Corentin Chary
2010-02-10 18:15 Stephen Isard
2009-10-31  1:07 Jason McMullan
2009-07-01 21:26 G 3
2009-03-17 20:37 Uri Lublin
2009-01-29 19:54 Uri Lublin
2009-01-30  2:43 ` Paul Brook
2009-02-01 15:20   ` Uri Lublin
2008-12-13 21:18 froydnj
2008-12-13 19:31 froydnj
2008-12-11 22:12 Hollis Blanchard
2008-12-11 22:43 ` Aurelien Jarno
2008-11-14 15:38 sniper
2008-08-21 14:27 Paweł Tulik
2007-04-10 13:34 Stuart Anderson
2007-03-03 23:09 Ben Taylor
2007-03-02 16:10 jeremy fenelon
2006-11-21 16:08  Torbjörn Andersson
2006-10-07  5:51 av1474
2006-10-10 20:50 ` Blue Swirl
2005-12-20 19:47 Hoppers U. Moppet
2005-11-08 15:57 Shahar Livne
2005-11-03 13:16 Qemtz
2005-04-27 14:08 blackcrack
2005-04-27 16:04 ` Johannes Schindelin
2005-04-27 16:38   ` Alex Beregszaszi
2005-01-18  4:44 Cliff
2004-08-08  1:42 anthony hill
2004-02-19 17:16 Adrian C

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=1289439066-23387-1-git-send-email-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=abeekhof@redhat.com \
    --cc=agl@linux.vnet.ibm.com \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=amit.shah@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ryanh@us.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.