[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-4.15 V2] tools/libs/store: tidy up libxenstore interface



Hi Juergen,

On 24/03/2021 11:30, Juergen Gross wrote:
xenstore_lib.h is in need to be tidied up a little bit:

- the definition of struct xs_tdb_record_hdr shouldn't be here
- some symbols are not namespaced correctly

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
V2: minimal variant (Ian Jackson)
---
  tools/include/xenstore_lib.h     | 17 ++++-------------
  tools/libs/store/libxenstore.map |  6 +++---
  tools/libs/store/xs.c            | 12 ++++++------
  tools/xenstore/utils.h           | 11 +++++++++++
  tools/xenstore/xenstore_client.c | 12 ++++++------
  5 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/tools/include/xenstore_lib.h b/tools/include/xenstore_lib.h
index 4c9b6d1685..f74ad7024b 100644
--- a/tools/include/xenstore_lib.h
+++ b/tools/include/xenstore_lib.h
@@ -43,15 +43,6 @@ struct xs_permissions
        enum xs_perm_type perms;
  };
-/* Header of the node record in tdb. */
-struct xs_tdb_record_hdr {
-       uint64_t generation;
-       uint32_t num_perms;
-       uint32_t datalen;
-       uint32_t childlen;
-       struct xs_permissions perms[0];
-};
-
  /* Each 10 bits takes ~ 3 digits, plus one, plus one for nul terminator. */
  #define MAX_STRLEN(x) ((sizeof(x) * CHAR_BIT + CHAR_BIT-1) / 10 * 3 + 2)
@@ -78,18 +69,18 @@ bool xs_perm_to_string(const struct xs_permissions *perm,
  unsigned int xs_count_strings(const char *strings, unsigned int len);
/* Sanitising (quoting) possibly-binary strings. */
-struct expanding_buffer {
+struct xs_expanding_buffer {
        char *buf;
        int avail;
  };
/* Ensure that given expanding buffer has at least min_avail characters. */
-char *expanding_buffer_ensure(struct expanding_buffer *, int min_avail);
+char *xs_expanding_buffer_ensure(struct xs_expanding_buffer *, int min_avail);
/* sanitise_value() may return NULL if malloc fails. */
-char *sanitise_value(struct expanding_buffer *, const char *val, unsigned len);
+char *xs_sanitise_value(struct xs_expanding_buffer *, const char *val, 
unsigned len);
/* *out_len_r on entry is ignored; out must be at least strlen(in)+1 bytes. */
-void unsanitise_value(char *out, unsigned *out_len_r, const char *in);
+void xs_unsanitise_value(char *out, unsigned *out_len_r, const char *in);
#endif /* XENSTORE_LIB_H */
diff --git a/tools/libs/store/libxenstore.map b/tools/libs/store/libxenstore.map
index 9854305a2c..fc1c213f13 100644
--- a/tools/libs/store/libxenstore.map
+++ b/tools/libs/store/libxenstore.map
@@ -42,8 +42,8 @@ VERS_3.0.3 {
                xs_strings_to_perms;
                xs_perm_to_string;
                xs_count_strings;
-               expanding_buffer_ensure;
-               sanitise_value;
-               unsanitise_value;
+               xs_expanding_buffer_ensure;
+               xs_sanitise_value;
+               xs_unsanitise_value;

Isn't libxenstore considered stable? If so, shouldn't we bump the version to avoid any breakage for existing app?

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.