]> xenbits.xensource.com Git - xen.git/commitdiff
xenstore: rename XS_DEBUG wire command
authorJuergen Gross <jgross@suse.com>
Fri, 24 Feb 2017 06:21:40 +0000 (07:21 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 28 Feb 2017 10:45:05 +0000 (10:45 +0000)
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
tools/xenstore/xenstored_core.c
tools/xenstore/xs.c
xen/include/public/io/xs_wire.h

index 0d12c39ba4b7db381c423a0a9275f9c494cb2b90..f460b8c5e5363a8d45d4edee141c63c8b802f38c 100644 (file)
@@ -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);
 
index 7b16338d8256f4d3f80928e97f870ea2e580d444..97e7e31d22a4ca1313704a9f15bdaed45021b60b 100644 (file)
@@ -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 },
index 6fa1261b6d4d168a8bff3a1fb723c7c0bd3436a5..56caac74cf4ded47ba4be27826967fa00144bfbc 100644 (file)
@@ -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
index f9f94f13f5749aa7e6fe5683c8a6adeb1ed916ff..4dd6632669619a5137fe2069d881b12c399ccc6f 100644 (file)
@@ -28,7 +28,8 @@
 
 enum xsd_sockmsg_type
 {
-    XS_DEBUG,
+    XS_CONTROL,
+#define XS_DEBUG XS_CONTROL
     XS_DIRECTORY,
     XS_READ,
     XS_GET_PERMS,