All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: David Scott <dave.scott@citrix.com>
Cc: xen-devel@lists.xenproject.org, wei.liu2@citrix.com,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH RFC 2/4] xl: add support for channels
Date: Thu, 12 Jun 2014 12:48:27 +0100	[thread overview]
Message-ID: <20140612114827.GY11959@zion.uk.xensource.com> (raw)
In-Reply-To: <1402518269-23164-3-git-send-email-dave.scott@citrix.com>

On Wed, Jun 11, 2014 at 09:24:27PM +0100, David Scott wrote:
> This adds support for channel declarations of the form:
> 
>   channel = [ "name=...,type=...[,path=...][,backend=...]" ]
> 
> where 'name' is a label to identify the channel to the frontend.
> 
> If 'type = none' then the channel is connected to /dev/null
> If 'type = pty' then the channel is connected to a pty in the
>   backend domain
> If 'type = path' then data is read from the channel and written
>   to the file given by 'path = ...' in the backend domain.
> If 'type = socket' then the channel is connected to a Unix domain
>   socket given by 'path = ...' in the backend domain.
> 
> Signed-off-by: David Scott <dave.scott@citrix.com>
> ---
>  tools/libxl/xl_cmdimpl.c |   62 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 61 insertions(+), 1 deletion(-)
> 

You also need to document this new config option in manpage.

And possibly the spec of defining channel should be documented too.

> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 5195914..2657b5d 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -736,7 +736,7 @@ static void parse_config_data(const char *config_source,
>      long l;
>      XLU_Config *config;
>      XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms;
> -    XLU_ConfigList *ioports, *irqs, *iomem;
> +    XLU_ConfigList *channels, *ioports, *irqs, *iomem;
>      int num_ioports, num_irqs, num_iomem;
>      int pci_power_mgmt = 0;
>      int pci_msitranslate = 0;
> @@ -1289,6 +1289,66 @@ static void parse_config_data(const char *config_source,
>          }
>      }
>  
> +    if (!xlu_cfg_get_list (config, "channel", &channels, 0, 0)) {
> +        d_config->num_channels = 0;
> +        d_config->channels = NULL;
> +        while ((buf = xlu_cfg_get_listitem (channels, d_config->num_channels)) != NULL) {

Line too long.

> +            libxl_device_channel *channel;
> +            char *buf2 = strdup(buf);
> +            char *p, *p2;
> +            d_config->channels = (libxl_device_channel *) realloc(d_config->channels, sizeof (libxl_device_channel) * (d_config->num_channels + 1));

Ditto.

And please use xrealloc instead, which handles allocation failure for you.

Wei.

  reply	other threads:[~2014-06-12 11:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 20:24 PATCH RFC: possible implementation of a low-bandwidth private 'channel' David Scott
2014-06-11 20:24 ` [PATCH RFC 1/4] libxl: add a list of abstract 'channels' to the domain config David Scott
2014-06-12 11:44   ` Wei Liu
2014-06-11 20:24 ` [PATCH RFC 2/4] xl: add support for channels David Scott
2014-06-12 11:48   ` Wei Liu [this message]
2014-06-11 20:24 ` [PATCH RFC 3/4] libxl: implement channels via PV console rings attached to qemu David Scott
2014-06-12 11:56   ` Wei Liu
2014-06-11 20:24 ` [PATCH RFC 4/4] libxl: spawn a qemu to implement channels David Scott
2014-06-12 12:11   ` Wei Liu
2014-06-12 13:52     ` Dave Scott

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=20140612114827.GY11959@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=dave.scott@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.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 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.