From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
wei.liu2@citrix.com, ian.jackson@eu.citrix.com
Subject: [PATCH v4 1/6] xenstore: rename XS_DEBUG wire command
Date: Fri, 24 Feb 2017 07:21:40 +0100 [thread overview]
Message-ID: <20170224062145.2041-2-jgross@suse.com> (raw)
In-Reply-To: <20170224062145.2041-1-jgross@suse.com>
In preparation to support other than pure debug functionality via the
Xenstore XS_DEBUG wire command rename it to XS_CONTROL and make
XS_DEBUG an alias of it.
Add an alias xs_control_command for the associated xs_debug_command,
too.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
tools/xenstore/include/xenstore.h | 4 +++-
tools/xenstore/xenstored_core.c | 8 ++++----
tools/xenstore/xs.c | 13 +++++++++----
xen/include/public/io/xs_wire.h | 3 ++-
4 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/tools/xenstore/include/xenstore.h b/tools/xenstore/include/xenstore.h
index 0d12c39..f460b8c 100644
--- a/tools/xenstore/include/xenstore.h
+++ b/tools/xenstore/include/xenstore.h
@@ -262,7 +262,9 @@ bool xs_path_is_subpath(const char *parent, const char *child);
*/
bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid);
-/* Only useful for DEBUG versions */
+char *xs_control_command(struct xs_handle *h, const char *cmd,
+ void *data, unsigned int len);
+/* Deprecated: use xs_control_command() instead. */
char *xs_debug_command(struct xs_handle *h, const char *cmd,
void *data, unsigned int len);
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 7b16338..97e7e31 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1261,7 +1261,7 @@ static int do_set_perms(struct connection *conn, struct buffered_data *in)
return 0;
}
-static int do_debug(struct connection *conn, struct buffered_data *in)
+static int do_control(struct connection *conn, struct buffered_data *in)
{
int num;
@@ -1273,13 +1273,13 @@ static int do_debug(struct connection *conn, struct buffered_data *in)
if (streq(in->buffer, "print")) {
if (num < 2)
return EINVAL;
- xprintf("debug: %s", in->buffer + get_string(in, 0));
+ xprintf("control: %s", in->buffer + get_string(in, 0));
}
if (streq(in->buffer, "check"))
check_store();
- send_ack(conn, XS_DEBUG);
+ send_ack(conn, XS_CONTROL);
return 0;
}
@@ -1288,7 +1288,7 @@ static struct {
const char *str;
int (*func)(struct connection *conn, struct buffered_data *in);
} const wire_funcs[XS_TYPE_COUNT] = {
- [XS_DEBUG] = { "DEBUG", do_debug },
+ [XS_CONTROL] = { "CONTROL", do_control },
[XS_DIRECTORY] = { "DIRECTORY", send_directory },
[XS_READ] = { "READ", do_read },
[XS_GET_PERMS] = { "GET_PERMS", do_get_perms },
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 6fa1261..56caac7 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -1165,9 +1165,8 @@ out:
return port;
}
-/* Only useful for DEBUG versions */
-char *xs_debug_command(struct xs_handle *h, const char *cmd,
- void *data, unsigned int len)
+char *xs_control_command(struct xs_handle *h, const char *cmd,
+ void *data, unsigned int len)
{
struct iovec iov[2];
@@ -1176,10 +1175,16 @@ char *xs_debug_command(struct xs_handle *h, const char *cmd,
iov[1].iov_base = data;
iov[1].iov_len = len;
- return xs_talkv(h, XBT_NULL, XS_DEBUG, iov,
+ return xs_talkv(h, XBT_NULL, XS_CONTROL, iov,
ARRAY_SIZE(iov), NULL);
}
+char *xs_debug_command(struct xs_handle *h, const char *cmd,
+ void *data, unsigned int len)
+{
+ return xs_control_command(h, cmd, data, len);
+}
+
static int read_message(struct xs_handle *h, int nonblocking)
{
/* IMPORTANT: It is forbidden to call this function without
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index f9f94f1..4dd6632 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -28,7 +28,8 @@
enum xsd_sockmsg_type
{
- XS_DEBUG,
+ XS_CONTROL,
+#define XS_DEBUG XS_CONTROL
XS_DIRECTORY,
XS_READ,
XS_GET_PERMS,
--
2.10.2
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-24 6:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-24 6:21 [PATCH v4 0/6] xenstore: enhance runtime debug capabilities Juergen Gross
2017-02-24 6:21 ` Juergen Gross [this message]
2017-02-24 6:21 ` [PATCH v4 2/6] xenstore: Split out XS_CONTROL action to dedicated source file Juergen Gross
2017-02-24 6:21 ` [PATCH v4 3/6] xenstore: enhance control command support Juergen Gross
2017-02-24 10:02 ` Wei Liu
2017-02-24 6:21 ` [PATCH v4 4/6] xenstore: add support for changing log functionality dynamically Juergen Gross
2017-02-24 6:21 ` [PATCH v4 5/6] xenstore: make memory report available via XS_CONTROL Juergen Gross
2017-02-24 6:21 ` [PATCH v4 6/6] xenstore: remove memory report command line support Juergen Gross
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=20170224062145.2041-2-jgross@suse.com \
--to=jgross@suse.com \
--cc=ian.jackson@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).