From: David Scott <dave.scott@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: ian.jackson@eu.citrix.com, David Scott <dave.scott@citrix.com>,
wei.liu2@citrix.com, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com
Subject: [PATCH v4] add support for libvirt-like channels
Date: Tue, 22 Jul 2014 16:05:17 +0100 [thread overview]
Message-ID: <1406041520-561-1-git-send-email-dave.scott@citrix.com> (raw)
In-Reply-To: <1403512141-12283-1-git-send-email-dave.scott@citrix.com>
Hi,
Sorry for the delay in resubmitting this. I think I've addressed all the
comments from the last round -- let me know if I've missed something!
Note: I've included a fix for a recently-introduced bug in the IDL generator.
This only affects me because my KeyedUnion descriminator is called
'connection' rather than 'type'.
Note: I've seen a problem with some Linux console frontends which attempt
to overwrite the read-only key 'type' (= xenconsoled|ioemu) in the frontend
directory. [ this key is already present, it's not added by these patches ]
Since 'type' refers to the toolstack's choice of implementation service
(which is none of the guest's business) I think the read/only permissions
are right. The location of the key is not ideal (it should be in the
backend directory IMHO) but this is the case with several other keys located
in the frontend such as 'limit' and 'tty'. I think this is a Linux frontend
bug which should be fixed there. These patches work with Mirage VMs and
with Linux if I workaround the permissions by giving the guest read/write
to the 'type' key.
The blurb:
Several libvirt applications (e.g. oVirt, CloudStack) make use of 'channels':
low-bandwidth private host <-> guest communication links which resemble serial
ports. Typical uses include:
* initial VM configuration without using the network: read the config data
directly from the channel on boot
* controlling a guest agent: signal shutdown reqests, exchange clipboard data,
trigger resolution changes
This patch set re-uses the existing PV console protocol implemented by qemu
to provide this service.
If you declare a channel in your .xl file as follows:
channel = [ "connection=socket,path=/tmp/mysock,name=org.mydomain.guest-agent" ]
then an extra PV console will be added to your guest. This console has the
extra key in the frontend
name = org.mydomain.guest-agent
which allows udev scripts in the VM to create a named device in a well-known
location (e.g. /dev/xen-channels/guest-agent, similar to the KVM /dev/vports).
The qemu process in the backend domain will proxy the data to/from the named
Unix domain socket (in this case /tmp/mysock).
Note this mechanism is intended for low-bandwidth communication only. If an
application requires a high-bandwith connection then it should use a direct
vchan connection (and not proxy it via a qemu).
Changes since v3:
* docs: coalesce the docs patch into the libxl patch
* docs: in channels.txt give high-level usage information, pitfalls and
channel registry
* docs: move the xenstore paths into the existing console.txt, which is
referenced from xenstore-paths.markdown
* idl: rename 'kind' to 'connection'
* xl: add parser functions for comma-separated lists of pairs
Changes since v2:
* trim down the 'kinds' of channels to PTY and SOCKET -- these seem the most
useful and we can add more later
* add a channelinfo (queryable by 'channel-list') to check the state of each
channel, and for a kind=PTY discover the slave device path
* IDL: switched to KeyedUnion for both the channel and channelinfo since
each 'kind' will have different parameters (e.g. only SOCKET has PATH)
* write all the backend configuration parameters to xenstore -- where we were
using qemu -chardev some crucial information was only on the command-line.
* add LIBXL_HAVE_DEVICE_CHANNEL
* docs: replace 'should' with 'will' e.g. the backend will be connected to
a Unix domain socket
* squash all the libxl patches together into a coherent whole
* explain that there is no registry of channel names and so people should use
unique information to create them (e.g. include domain name and interface
version)
Changes since v1:
* extend xl.cfg(5)
* add docs/misc/channel.txt
* libxl_types.idl: omit unnecessary init_val = 0
* xl_cmdimpl.c: fixed over-long lines
* xl_cmdimpl.c: use xrealloc (via ARRAY_EXTEND_INIT)
* xl_cmdimpl.c: exit() on parse failure rather than ignore configuration
* libxl_create.c: use libxl__device_console_init instead of memset
* libxl_create.c: use libxl__strdup(NOGC rather than raw strdup
* libxl.c: add name=<name> to console frontend
* libxl.c: resolve the backend_domid from backend_domname
* libxl_dm.c: channels[i].devid rather than i
* libxl_dm.c: fix indentation
* libxl_dm.c: use GCSPRINTF convenience macro
Signed-off-by: David Scott <dave.scott@citrix.com>
next prev parent reply other threads:[~2014-07-22 15:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 8:28 [PATCH v3] add support for libvirt-like channels David Scott
2014-06-23 8:28 ` [PATCH v3 1/3] docs: add a document describing the 'channels' mechanism David Scott
2014-06-23 14:38 ` Ian Jackson
2014-06-23 14:53 ` Ian Jackson
2014-06-23 17:45 ` Dave Scott
2014-06-24 10:43 ` Ian Jackson
2014-06-24 11:15 ` Dave Scott
2014-07-02 15:29 ` Ian Campbell
2014-06-23 8:29 ` [PATCH v3 2/3] libxl: add support for channels David Scott
2014-06-23 14:52 ` Ian Jackson
2014-06-23 17:43 ` Dave Scott
2014-06-24 10:41 ` Ian Jackson
2014-06-24 11:09 ` Dave Scott
2014-06-23 8:29 ` [PATCH v3 3/3] xl: " David Scott
2014-06-23 10:02 ` Wei Liu
2014-06-23 10:47 ` Dave Scott
2014-06-23 14:57 ` Ian Jackson
2014-07-02 15:33 ` Ian Campbell
2014-07-03 8:51 ` Dave Scott
2014-07-22 15:05 ` David Scott [this message]
2014-07-22 15:05 ` [PATCH v4 1/3] libxl IDL: the name of a KeyedUnion descriminator need not be 'type' David Scott
2014-07-24 15:52 ` Ian Campbell
2014-07-22 15:05 ` [PATCH v4 2/3] libxl: add support for 'channels' David Scott
2014-09-10 14:41 ` Ian Campbell
2014-09-11 13:12 ` Dave Scott
2014-07-22 15:05 ` [PATCH v4 3/3] xl: " David Scott
2014-07-28 14:22 ` [PATCH v4] add support for libvirt-like channels David Vrabel
2014-08-07 13:37 ` Dave Scott
2014-08-07 14:12 ` David Vrabel
2014-08-07 14:26 ` Stefano Stabellini
2014-08-11 9:35 ` Dave Scott
2014-08-11 11:49 ` Stefano Stabellini
2014-09-10 13:07 ` Ian Campbell
2014-09-10 13:45 ` Dave Scott
2014-09-10 14:04 ` David Vrabel
2014-09-10 14:13 ` Ian Campbell
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=1406041520-561-1-git-send-email-dave.scott@citrix.com \
--to=dave.scott@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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).