From: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
To: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] libxenlight: add console command
Date: Tue, 1 Dec 2009 06:47:05 +0000 [thread overview]
Message-ID: <20091201064705.GC15810@gwig.uk.xensource.com> (raw)
In-Reply-To: <1259318402.3867.24.camel@alva>
On Fri, Nov 27, 2009 at 10:40:02AM +0000, Tomasz Wroblewski wrote:
> Hello all,
>
> This patch adds "xl console" command similar to "xm console".
>
> Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
> ---
>
> diff -r d7d77bace286 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c Fri Nov 27 10:13:42 2009 +0000
> +++ b/tools/libxl/libxl.c Fri Nov 27 10:18:18 2009 +0000
> @@ -468,6 +468,24 @@
> if (rc < 0) {
> XL_LOG_ERRNOVAL(ctx, XL_LOG_ERROR, rc, "xc_domain_destroy
> failed for %d", domid);
> return -1;
> + }
> + return 0;
> +}
> +
> +int libxl_console_attach(struct libxl_ctx *ctx, uint32_t domid, int
> cons_num)
> +{
> + struct stat st;
> + const char *XENCONSOLE = "/usr/lib/xen/bin/xenconsole";
> + char *cmd = NULL;
> +
> + if (stat(XENCONSOLE, &st) != 0) {
> + XL_LOG(ctx, XL_LOG_ERROR, "could not access %s", XENCONSOLE);
> + return ERROR_FAIL;
> + }
> +
> + cmd = libxl_sprintf(ctx, "%s %d --num %d", XENCONSOLE, domid,
> cons_num);
> + if (system(cmd) != 0) {
> + return ERROR_FAIL;
> }
> return 0;
> }
I don't think that should be a API call of the libxenlight library.
I find hard to think that anyone except a command line tool would use such a
call. please move it to xl.c completly.
--
Vincent
next prev parent reply other threads:[~2009-12-01 6:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-27 10:40 [PATCH] libxenlight: add console command Tomasz Wroblewski
2009-11-27 11:35 ` Stefano Stabellini
2009-11-27 15:18 ` Stefano Stabellini
2009-12-01 6:47 ` Vincent Hanquez [this message]
2009-12-01 13:41 ` Stefano Stabellini
-- strict thread matches above, loose matches on Subject: below --
2009-11-27 15:31 Tomasz Wroblewski
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=20091201064705.GC15810@gwig.uk.xensource.com \
--to=vincent.hanquez@eu.citrix.com \
--cc=tomasz.wroblewski@citrix.com \
--cc=xen-devel@lists.xensource.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.