Skip to contentSkip to conversation

Make it clear that xs_get_domain_path() requires free()

PATCH In review Anthony Liguori 2 participants 3 messages Nov 1, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 Make it clear that xs_get_domain_path() requires free()

# HG changeset patch
# User Anthony Liguori <[email protected]>
# Node ID a44fde5c4e15bdf2f8b42fa41439d6725a5363dc
# Parent 6de1d7b66c8a52ac6420f35aac03fe219caf87a3
Make it clear that the result of xs_get_domain_path() must be free()'d.

tools/xenstore/xs.h +1 -1
diff -r 6de1d7b66c8a -r a44fde5c4e15 tools/xenstore/xs.h
@@ -136,7 +136,7 @@
  */
 bool xs_release_domain(struct xs_handle *h, unsigned int domid);
 
-/* Query the home path of a domain.
+/* Query the home path of a domain.  Call free() after use.
  */
 char *xs_get_domain_path(struct xs_handle *h, unsigned int domid);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Just out of curiosity, why have xenstore create a buffer that must be freed. Why not have the calling application create a buffer and manage it on its own?

Quoted 23 lines · Anthony Liguori

plain text document attachment (7574-xenconsole.diff)
# HG changeset patch
# User Anthony Liguori <[email protected]>
# Node ID a44fde5c4e15bdf2f8b42fa41439d6725a5363dc
# Parent 6de1d7b66c8a52ac6420f35aac03fe219caf87a3
Make it clear that the result of xs_get_domain_path() must be free()'d.

diff -r 6de1d7b66c8a -r a44fde5c4e15 tools/xenstore/xs.h

tools/xenstore/xs.h +1 -1
@@ -136,7 +136,7 @@
  */
 bool xs_release_domain(struct xs_handle *h, unsigned int domid);
 
-/* Query the home path of a domain.
+/* Query the home path of a domain.  Call free() after use.
  */
 char *xs_get_domain_path(struct xs_handle *h, unsigned int domid);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 5 lines · Daniel Stekloff

Just out of curiosity, why have xenstore create a buffer that must be freed. Why not have the calling application create a buffer and manage it on its own?

Because Rusty made it that way :-)

Regards,

Anthony Liguori

Quoted 33 lines · Anthony Liguori
Quoted 27 lines

plain text document attachment (7574-xenconsole.diff)
# HG changeset patch
# User Anthony Liguori <[email protected]>
# Node ID a44fde5c4e15bdf2f8b42fa41439d6725a5363dc
# Parent 6de1d7b66c8a52ac6420f35aac03fe219caf87a3
Make it clear that the result of xs_get_domain_path() must be free()'d.

diff -r 6de1d7b66c8a -r a44fde5c4e15 tools/xenstore/xs.h

tools/xenstore/xs.h +1 -1
@@ -136,7 +136,7 @@
 */
 bool xs_release_domain(struct xs_handle *h, unsigned int domid);
 
-/* Query the home path of a domain.
+/* Query the home path of a domain.  Call free() after use.
 */
 char *xs_get_domain_path(struct xs_handle *h, unsigned int domid);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel