Skip to contentSkip to conversation

xs.h and xs_lib.h

PATCH In review aq 3 participants 7 messages Jun 10, 2005 – Jun 14, 2005 Kbuild

lore
Share & tools
lore

aq

author
#0 lore raw

PATCH 1/1 xs.h and xs_lib.h

This patch moves declaration of xs_handle from xs.c to xs.h. Besides, it installs xs.h and xs_lib.h to /usr/include, and gets top Makefile uninstalled them when cleaning up.

# diffstat xenstore2.patch 
 Makefile                |    1 +
 tools/xenstore/Makefile |    2 ++
 tools/xenstore/xs.c     |    5 -----
 tools/xenstore/xs.h     |    5 ++++-
 4 files changed, 7 insertions(+), 6 deletions(-)

===== Makefile 1.96 vs edited =====

Makefile +1 -0
@@ -166,6 +166,7 @@
 	rm -rf $(D)/usr/$(LIBDIR)/share/xen $(D)/usr/$(LIBDIR)/libxenstore*
 	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
 	rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
+	rm -rf $(D)/usr/include/xs.h $(D)/usr/include/xs_lib.h
 	rm -rf $(D)/usr/sbin/xcs $(D)/usr/sbin/xcsdump $(D)/usr/sbin/xen*
 	rm -rf $(D)/usr/sbin/netfix
 	rm -rf $(D)/usr/sbin/xfrd $(D)/usr/sbin/xm

===== tools/xenstore/Makefile 1.3 vs edited =====

tools/xenstore/Makefile +2 -0
@@ -95,5 +95,7 @@
 	$(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
 	$(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
+	$(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
+	$(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
 
 -include $(PROG_DEP)

===== tools/xenstore/xs.c 1.1 vs edited =====

tools/xenstore/xs.c +0 -5
@@ -36,11 +36,6 @@
 #include "xs_lib.h"
 #include "utils.h"
 
-struct xs_handle
-{
-	int fd;
-};
-
 /* Get the socket from the store daemon handle.
  */
 int xs_fileno(struct xs_handle *h)

===== tools/xenstore/xs.h 1.1 vs edited =====

tools/xenstore/xs.h +4 -1
@@ -22,7 +22,10 @@
 /* On failure, these routines set errno. */
 #include "xs_lib.h"
 
-struct xs_handle;
+struct xs_handle
+{
+	int fd;
+};
 
 /* Connect to the xs daemon.
  * Returns a handle or NULL.

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

#1 lore raw
Quoted 3 lines · aq

This patch moves declaration of xs_handle from xs.c to xs.h. Besides, it installs xs.h and xs_lib.h to /usr/include, and gets top Makefile uninstalled them when cleaning up.

The handle is deliberately opaque. We'll take the Makefile patches though.

Thanks,
Keir

#2 lore raw
In reply to aq
Quoted 1 line · aq

This patch moves declaration of xs_handle from xs.c to xs.h.

No; why do this? It's opaque for a reason. Originally it was just an int, but Keir insisted it be an opaque structure. Exposing it binds us to the current structure again.

Quoted 3 lines

Besides,
it installs xs.h and xs_lib.h to /usr/include, and gets top Makefile uninstalled them when cleaning up.

xs_lib.h should not be installed in /usr/include!

Rusty.

Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
author
#3 lore raw
Quoted 7 lines · Rusty Russell
Quoted 1 line · aq

This patch moves declaration of xs_handle from xs.c to xs.h.

No; why do this? It's opaque for a reason. Originally it was just an int, but Keir insisted it be an opaque structure. Exposing it binds us to the current structure again.

Quoted 5 lines
Quoted 3 lines

Besides,
it installs xs.h and xs_lib.h to /usr/include, and gets top Makefile uninstalled them when cleaning up.

xs_lib.h should not be installed in /usr/include!

i see that, but where should we put this header?

regards,
aq

#4 lore raw
Quoted 8 lines · aq
Quoted 7 lines · Rusty Russell
Quoted 1 line · aq

This patch moves declaration of xs_handle from xs.c to xs.h.

No; why do this? It's opaque for a reason. Originally it was just an int, but Keir insisted it be an opaque structure. Exposing it binds us to the current structure again.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Besides,
it installs xs.h and xs_lib.h to /usr/include, and gets top Makefile uninstalled them when cleaning up.

xs_lib.h should not be installed in /usr/include!

i see that, but where should we put this header?

Once the daemon and library are built, it's not necessary for anything.

Rusty.

Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
author
#5 lore raw
Quoted 13 lines · Rusty Russell
Quoted 12 lines · aq
Quoted 11 lines · Rusty Russell
Quoted 1 line · aq

This patch moves declaration of xs_handle from xs.c to xs.h.

No; why do this? It's opaque for a reason. Originally it was just an int, but Keir insisted it be an opaque structure. Exposing it binds us to the current structure again.

Quoted 3 lines

Besides,
it installs xs.h and xs_lib.h to /usr/include, and gets top Makefile uninstalled them when cleaning up.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

xs_lib.h should not be installed in /usr/include!

i see that, but where should we put this header?

Once the daemon and library are built, it's not necessary for anything.

i installed xs_lib.h because xs.h includes it. now we need to remove this and include xs_lib.h in other files as needed.

later i will send in another patch to fix this, and revert the problem raised in last patch.

regards,
aq

#6 lore raw
Quoted 16 lines · aq
Quoted 15 lines · Rusty Russell
Quoted 14 lines · aq
Quoted 12 lines · Rusty Russell
Quoted 1 line · aq

This patch moves declaration of xs_handle from xs.c to xs.h.

No; why do this? It's opaque for a reason. Originally it was just an int, but Keir insisted it be an opaque structure. Exposing it binds us to the current structure again.

Quoted 3 lines

Besides,
it installs xs.h and xs_lib.h to /usr/include, and gets top Makefile uninstalled them when cleaning up.

xs_lib.h should not be installed in /usr/include!

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

i see that, but where should we put this header?

Once the daemon and library are built, it's not necessary for anything.

i installed xs_lib.h because xs.h includes it. now we need to remove this and include xs_lib.h in other files as needed.

True. More logical to move the xs_permissions struct to xs.h, I think.

Rusty.

Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman