Skip to contentSkip to conversation

Miscellaneous fixes from Debian

PATCH In review Ian Jackson 5 participants 26 messages Oct 12, 2018 – Oct 15, 2018

lore
Share & tools
lore
#0 lore raw

v2 cover Miscellaneous fixes from Debian

This is v2 of my series of stuff from Debian. (I already pushed the uncontroversial parts of v1, so those patches are now missing from v2.) The remainder are build fixes, and addressing the namespace pollution of the pygrub fsimage' libraries by renaming it to xenfsimage'.

Hans van Kranenburg (1):
tools/xenstore: Re-introduce (fake) xs_restrict call to preserve ABI

Ian Jackson (11):
tools/Rules.mk: Honour PREPEND_LDFLAGS_XEN_TOOLS
INSTALL: Mention kconfig
gdbsx: Honour LDFLAGS when linking
pygrub fsimage.so: Honour LDFLAGS when building
xenmon: Install as xenmon, not xenmon.py tools/debugger/kdd: Install as xen-kdd', not just kdd' xenstore.h: Put ( ) around XS_* define shifts tools/libfsimage: Bump soname to 4.12 tools/libfsimage: Add xen' to .h names and principal .so name tools/pygrub: Add xen' to fsimage python module name tools/libfsimage: Rename /usr/lib/fs to /usr/lib/xenfsimage

 INSTALL                                            | 20 ++++++++++++
 tools/Rules.mk                                     |  2 ++
 tools/debugger/gdbsx/Makefile                      |  2 +-
 tools/debugger/kdd/Makefile                        |  4 +--
 tools/libfsimage/Rules.mk                          |  4 +--
 tools/libfsimage/common/Makefile                   | 38 +++++++++++-----------
 tools/libfsimage/common/fsimage.c                  |  2 +-
 tools/libfsimage/common/fsimage_grub.c             |  2 +-
 tools/libfsimage/common/fsimage_plugin.c           |  2 +-
 tools/libfsimage/common/fsimage_priv.h             |  4 +--
 .../libfsimage/common/{fsimage.h => xenfsimage.h}  |  0
 .../common/{fsimage_grub.h => xenfsimage_grub.h}   |  4 +--
 .../{fsimage_plugin.h => xenfsimage_plugin.h}      |  2 +-
 tools/libfsimage/ext2fs-lib/ext2fs-lib.c           |  2 +-
 tools/libfsimage/ext2fs/fsys_ext2fs.c              |  2 +-
 tools/libfsimage/fat/fsys_fat.c                    |  2 +-
 tools/libfsimage/iso9660/fsys_iso9660.c            |  2 +-
 tools/libfsimage/reiserfs/fsys_reiserfs.c          |  2 +-
 tools/libfsimage/ufs/fsys_ufs.c                    |  2 +-
 tools/libfsimage/xfs/fsys_xfs.c                    |  2 +-
 tools/libfsimage/zfs/fsi_zfs.c                     |  2 +-
 tools/libfsimage/zfs/fsi_zfs.h                     |  2 +-
 tools/pygrub/Makefile                              |  2 +-
 tools/pygrub/setup.py                              |  6 ++--
 tools/pygrub/src/fsimage/fsimage.c                 | 10 +++---
 tools/pygrub/src/pygrub                            |  6 ++--
 tools/xenmon/Makefile                              |  4 +--
 tools/xenstore/include/xenstore.h                  | 11 +++++--
 tools/xenstore/xs.c                                |  6 ++++
 29 files changed, 91 insertions(+), 58 deletions(-)
 rename tools/libfsimage/common/{fsimage.h => xenfsimage.h} (100%)
 rename tools/libfsimage/common/{fsimage_grub.h => xenfsimage_grub.h} (98%)
 rename tools/libfsimage/common/{fsimage_plugin.h => xenfsimage_plugin.h} (98%)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH v2 1/12 tools/Rules.mk: Honour PREPEND_LDFLAGS_XEN_TOOLS

From: Ian Jackson <[email protected]>

This allows the caller to provide some LDFLAGS to the Xen build system.

---
 tools/Rules.mk | 2 ++
 1 file changed, 2 insertions(+)
tools/Rules.mk +2 -0
index 296b722372..68f2ed7ce1 100644
@@ -9,6 +9,8 @@ include $(XEN_ROOT)/Config.mk
 export _INSTALL := $(INSTALL)
 INSTALL = $(XEN_ROOT)/tools/cross-install
 
+LDFLAGS += $(PREPEND_LDFLAGS_XEN_TOOLS)
+
 XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLCORE  = $(XEN_ROOT)/tools/libs/toolcore
 XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw

PATCH v2 2/12 INSTALL: Mention kconfig

In reply to Ian Jackson

From: Ian Jackson <[email protected]>

Firstly, add a reference to the documentation for the kconfig system.

Secondly, warn the user about the XEN_CONFIG_EXPERT problem.

---
v2: Fix typos

---
 INSTALL | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
INSTALL +20 -0
index 9aa9ebdddc..e28348509f 100644
@@ -19,6 +19,26 @@ following compile process. Once configure is done, make(1) has to be
 called. Also make(1) recognizes certain arguments. The following sections
 will give an overview.
 
+Xen Hypervisor
+==============
+
+Xen itself is configured via a `kconfig' system borrowed from Linux.
+See docs/misc/kconfig.txt.
+
+Note that unlike with Linux, and contrary to that document, you cannot
+look at Kconfig files, or the default or generated config files etc.,
+to find available configuration options.  This is because it is only
+supported (and security supported) by the Xen Project, to change a
+small subset of the options.  Attempts to change other options will be
+silently overridden.  The only way to find which configuration options
+are available is to run `make menuconfig' or the like.
+
+You can counter-override this behaviour by setting XEN_CONFIG_EXPERT=y
+in your environment.  However, doing this is not supported and the
+resulting configurations do not receive security support.  If you set
+this variable there is nothing stopping you setting dangerously
+experimental combinations of features - not even any warnings.
+
 Options recognized by configure
 ===============================
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw

PATCH v2 3/12 gdbsx: Honour LDFLAGS when linking

In reply to Ian Jackson

From: Ian Jackson <[email protected]>

This command does the link, so it needs LDFLAGS.

---
 tools/debugger/gdbsx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/debugger/gdbsx/Makefile +1 -1
index 723a2743cc..8d7cd94a31 100644
@@ -26,7 +26,7 @@ uninstall:
 	rm -f $(DESTDIR)$(sbindir)/gdbsx
 
 gdbsx: gx/gx_all.a xg/xg_all.a 
-	$(CC) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^
 
 xg/xg_all.a:
 	$(MAKE) -C xg
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 3/12
#5 lore raw

Re: [PATCH 03/12] gdbsx: Honour LDFLAGS when linking

Quoted 5 lines · Ian Jackson

From: Ian Jackson <[email protected]>

This command does the link, so it needs LDFLAGS.

I think this needs an ack from Elena as well.

Quoted 20 lines
---
 tools/debugger/gdbsx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/debugger/gdbsx/Makefile +1 -1
index 723a2743cc..8d7cd94a31 100644
@@ -26,7 +26,7 @@ uninstall:
 	rm -f $(DESTDIR)$(sbindir)/gdbsx
 
 gdbsx: gx/gx_all.a xg/xg_all.a 
-	$(CC) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^
 
 xg/xg_all.a:
 	$(MAKE) -C xg
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v2 3/12
#6 lore raw

Re: [PATCH 03/12] gdbsx: Honour LDFLAGS when linking

In reply to Ian Jackson
Quoted 5 lines · Ian Jackson

From: Ian Jackson <[email protected]>

This command does the link, so it needs LDFLAGS.

Quoted 20 lines
---
 tools/debugger/gdbsx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/debugger/gdbsx/Makefile +1 -1
index 723a2743cc..8d7cd94a31 100644
@@ -26,7 +26,7 @@ uninstall:
 	rm -f $(DESTDIR)$(sbindir)/gdbsx
 
 gdbsx: gx/gx_all.a xg/xg_all.a 
-	$(CC) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^
 
 xg/xg_all.a:
 	$(MAKE) -C xg
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw

PATCH v2 4/12 pygrub fsimage.so: Honour LDFLAGS when building

In reply to Ian Jackson

From: Ian Jackson <[email protected]>

This seems to have been simply omitted. Obviously this is needed when building and not just when installing. Passing only when installing is ineffective.

---
 tools/pygrub/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/pygrub/Makefile +1 -1
index 536af07932..3063c4998f 100644
@@ -10,7 +10,7 @@ INSTALL_LOG = build/installed_files.txt
 all: build
 .PHONY: build
 build:
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install: all
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 4/12
#8 lore raw

Re: [PATCH 04/12] pygrub fsimage.so: Honour LDFLAGS when building

Quoted 7 lines · Ian Jackson

From: Ian Jackson <[email protected]>

This seems to have been simply omitted. Obviously this is needed when building and not just when installing. Passing only when installing is ineffective.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#9 lore raw

PATCH v2 5/12 xenmon: Install as xenmon, not xenmon.py

In reply to Ian Jackson

From: Ian Jackson <[email protected]>

Adding the implementation language as a suffix to a program name is poor practice.

---
 tools/xenmon/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/xenmon/Makefile +2 -2
index e45c5b8c14..e1712304d0 100644
@@ -32,13 +32,13 @@ install: build
 	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
 	$(INSTALL_PROG) xenbaked $(DESTDIR)$(sbindir)/xenbaked
 	$(INSTALL_PROG) xentrace_setmask  $(DESTDIR)$(sbindir)/xentrace_setmask
-	$(INSTALL_PROG) xenmon.py  $(DESTDIR)$(sbindir)/xenmon.py
+	$(INSTALL_PROG) xenmon.py  $(DESTDIR)$(sbindir)/xenmon
 
 .PHONY: uninstall
 uninstall:
 	rm -f $(DESTDIR)$(sbindir)/xenbaked
 	rm -f $(DESTDIR)$(sbindir)/xentrace_setmask
-	rm -f $(DESTDIR)$(sbindir)/xenmon.py
+	rm -f $(DESTDIR)$(sbindir)/xenmon
 
 .PHONY: clean
 clean:
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#10 lore raw

PATCH v2 6/12 tools/debugger/kdd: Install as `xen-kdd', not just `kdd'

In reply to Ian Jackson

From: Ian Jackson <[email protected]>

`kdd' is an unfortunate namespace landgrab.

---
 tools/debugger/kdd/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/debugger/kdd/Makefile +2 -2
index 5509eee68c..26116949d4 100644
@@ -24,8 +24,8 @@ distclean: clean
 .PHONY: install
 install: all
 	[ -d $(DESTDIR)$(sbindir) ] || $(INSTALL_DIR) $(DESTDIR)$(sbindir)
-	$(INSTALL_PROG) kdd $(DESTDIR)$(sbindir)/kdd
+	$(INSTALL_PROG) kdd $(DESTDIR)$(sbindir)/xen-kdd
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(DESTDIR)$(sbindir)/kdd
+	rm -f $(DESTDIR)$(sbindir)/xen-kdd
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#11 lore raw

PATCH v2 7/12 tools/xenstore: Re-introduce (fake) xs_restrict call to preserve ABI

In reply to Ian Jackson

From: Hans van Kranenburg <[email protected]>

libxenstore3.0 in Xen 4.8 had this function. We don't really want to bump the ABI version (soname) just for this, since we don't think there are actual callers anywhere. But tools complain about the symbol going away.

So, provide a function xs_restrict which conforms to the original semantics, although it always fails.

Gbp-Pq: Topic xenstore
Gbp-Pq: Name tools-fake-xs-restrict.patch

---
v2: New in this version of the series

---
 tools/xenstore/include/xenstore.h | 5 +++++
 tools/xenstore/xs.c               | 6 ++++++
 2 files changed, 11 insertions(+)
tools/xenstore/include/xenstore.h +5 -0
index f460b8c5e5..0d95bb0e5c 100644
@@ -132,6 +132,11 @@ bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,
 bool xs_rm(struct xs_handle *h, xs_transaction_t t,
 	   const char *path);
 
+/* Fake function which will always return false (required to let
+ * libxenstore remain at 3.0 version.
+ */
+bool xs_restrict(struct xs_handle *h, unsigned domid);
+
 /* Get permissions of node (first element is owner, first perms is "other").
  * Returns malloced array, or NULL: call free() after use.
  */
tools/xenstore/xs.c +6 -0
index 77700bff2b..cbcebb2bce 100644
@@ -796,6 +796,12 @@ unwind:
 	return false;
 }
 
+/* Always return false a functionality has been removed in Xen 4.9 */
+bool xs_restrict(struct xs_handle *h, unsigned domid)
+{
+	return false;
+}
+
 /* Watch a node for changes (poll on fd to detect, or call read_watch()).
  * When the node (or any child) changes, fd will become readable.
  * Token is returned when watch is read, to allow matching.
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 7/12
#12 lore raw

Re: [PATCH 07/12] tools/xenstore: Re-introduce (fake) xs_restrict call to preserve ABI

Quoted 7 lines · Ian Jackson

From: Hans van Kranenburg <[email protected]>

libxenstore3.0 in Xen 4.8 had this function. We don't really want to bump the ABI version (soname) just for this, since we don't think there are actual callers anywhere. But tools complain about the symbol going away.

Quoted 6 lines

So, provide a function xs_restrict which conforms to the original semantics, although it always fails.

Gbp-Pq: Topic xenstore
Gbp-Pq: Name tools-fake-xs-restrict.patch

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#13 lore raw

Re: [PATCH 07/12] tools/xenstore: Re-introduce (fake) xs_restrict call to preserve ABI

In reply to Ian Jackson
Quoted 1 line · Ian Jackson

From: Hans van Kranenburg <[email protected]>

No, this was in the changes that I copied back from Ubuntu, it was written by Stefan Bader:

---- >8 ----

Description: Re-introduce fake xs_restrict API call
libxenstore cannot remove an API function without changing its version number. As long as we want to remain with 3.0 we have to keep it around. Debian might decide to increment the version at some point but we do not know how and when. So for now keep the version stable.

Author: Stefan Bader <[email protected]>

---- >8 ----

Quoted 42 lines

libxenstore3.0 in Xen 4.8 had this function. We don't really want to bump the ABI version (soname) just for this, since we don't think there are actual callers anywhere. But tools complain about the symbol going away.

So, provide a function xs_restrict which conforms to the original semantics, although it always fails.

Gbp-Pq: Topic xenstore
Gbp-Pq: Name tools-fake-xs-restrict.patch

---
v2: New in this version of the series

---
 tools/xenstore/include/xenstore.h | 5 +++++
 tools/xenstore/xs.c               | 6 ++++++
 2 files changed, 11 insertions(+)
tools/xenstore/include/xenstore.h +5 -0
index f460b8c5e5..0d95bb0e5c 100644
@@ -132,6 +132,11 @@ bool xs_mkdir(struct xs_handle *h, xs_transaction_t t,
 bool xs_rm(struct xs_handle *h, xs_transaction_t t,
 	   const char *path);
 
+/* Fake function which will always return false (required to let
+ * libxenstore remain at 3.0 version.
+ */
+bool xs_restrict(struct xs_handle *h, unsigned domid);
+
 /* Get permissions of node (first element is owner, first perms is "other").
  * Returns malloced array, or NULL: call free() after use.
  */
tools/xenstore/xs.c +0 -0
index 77700bff2b..cbcebb2bce 100644
@@ -796,6 +796,12 @@ unwind:
 	return false;
 }

tools/xenstore/xs.c unwind: · line 807

Quoted 10 lines
tools/xenstore/xs.c +6 -0
 
+/* Always return false a functionality has been removed in Xen 4.9 */
+bool xs_restrict(struct xs_handle *h, unsigned domid)
+{
+	return false;
+}
+
 /* Watch a node for changes (poll on fd to detect, or call read_watch()).
  * When the node (or any child) changes, fd will become readable.
  * Token is returned when watch is read, to allow matching.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#14 lore raw

Re: [PATCH 07/12] tools/xenstore: Re-introduce (fake) xs_restrict call to preserve ABI

Hans van Kranenburg writes ("Re: [Xen-devel] [PATCH 07/12] tools/xenstore: Re-introduce (fake) xs_restrict call to preserve ABI"):

Quoted 8 lines · Ian Jackson
Quoted 1 line

From: Hans van Kranenburg <[email protected]>

No, this was in the changes that I copied back from Ubuntu, it was written by Stefan Bader:

---- >8 ----

Quoted 7 lines

Description: Re-introduce fake xs_restrict API call
libxenstore cannot remove an API function without changing its version number. As long as we want to remain with 3.0 we have to keep it around. Debian might decide to increment the version at some point but we do not know how and when. So for now keep the version stable.

Author: Stefan Bader <[email protected]>

Hrm. Thanks for pointing that out. I have fixed the commit author in my upstream branch. I think this lossage is due to a bug in gbp pq :-/.

And, CCing Stefan for form's sake. Stefan, I'm upstreaming this patch.

Regards,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#15 lore raw

PATCH v2 8/12 xenstore.h: Put ( ) around XS_* define shifts

In reply to Ian Jackson

These definitions were not properly protected from unwanted operator precedence interactions.

Existing use sites in-tree all use & or |, so this does not change any actual behaviour in-tree.

The same seems likely to be true in external callers.

---
v2: New in this version of the series

---
 tools/xenstore/include/xenstore.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/xenstore/include/xenstore.h +3 -3
index 0d95bb0e5c..996b75ab0d 100644
@@ -23,8 +23,8 @@
 
 #define XBT_NULL 0
 
-#define XS_OPEN_READONLY	1UL<<0
-#define XS_OPEN_SOCKETONLY      1UL<<1
+#define XS_OPEN_READONLY	(1UL<<0)
+#define XS_OPEN_SOCKETONLY      (1UL<<1)
 
 /*
  * Setting XS_UNWATCH_FILTER arranges that after xs_unwatch, no
@@ -45,7 +45,7 @@
  *                                  xs_unwatch for the first watch
  *                                  has returned.
  */
-#define XS_UNWATCH_FILTER     1UL<<2
+#define XS_UNWATCH_FILTER     (1UL<<2)
 
 struct xs_handle;
 typedef uint32_t xs_transaction_t;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 8/12
#16 lore raw

Re: [PATCH 08/12] xenstore.h: Put ( ) around XS_* define shifts

Quoted 9 lines · Ian Jackson

These definitions were not properly protected from unwanted operator precedence interactions.

Existing use sites in-tree all use & or |, so this does not change any actual behaviour in-tree.

The same seems likely to be true in external callers.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#17 lore raw

PATCH v2 9/12 tools/libfsimage: Bump soname to 4.12

In reply to Ian Jackson

This library does not have a stable ABI promise. As far as we know it is used only by pygrub. Bump its soname to the Xen version (and intend to change it each time).

---
v2: New in this version of the series

---
 tools/libfsimage/common/Makefile                                  | 4 ++--
 tools/libfsimage/common/fsimage.c                                 | 2 +-
 tools/libfsimage/common/{fsimage.h => xenfsimage.h}               | 0
 tools/libfsimage/common/{fsimage_grub.h => xenfsimage_grub.h}     | 0
 tools/libfsimage/common/{fsimage_plugin.h => xenfsimage_plugin.h} | 0
 5 files changed, 3 insertions(+), 3 deletions(-)
 rename tools/libfsimage/common/{fsimage.h => xenfsimage.h} (100%)
 rename tools/libfsimage/common/{fsimage_grub.h => xenfsimage_grub.h} (100%)
 rename tools/libfsimage/common/{fsimage_plugin.h => xenfsimage_plugin.h} (100%)
tools/libfsimage/common/Makefile +2 -2
index a4655c421c..beda8f5f3a 100644
@@ -1,8 +1,8 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
 
-MAJOR = 1.0
-MINOR = 0
+MAJOR = 0
+MINOR = 4.12
 
 LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
 LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
tools/libfsimage/common/fsimage.c +1 -1
index 21d6c38ac6..5cfa56a84d 100644
@@ -31,7 +31,7 @@
 #include <errno.h>
 #include <pthread.h>
 
-#include "fsimage_plugin.h"
+#include "xenfsimage_plugin.h"
 #include "fsimage_priv.h"
 
 static pthread_mutex_t fsi_lock = PTHREAD_MUTEX_INITIALIZER;
tools/libfsimage/common/xenfsimage.h renamed from tools/libfsimage/common/fsimage.h +0 -0
similarity index 100%
rename from tools/libfsimage/common/fsimage.h
rename to tools/libfsimage/common/xenfsimage.h
tools/libfsimage/common/xenfsimage_grub.h renamed from tools/libfsimage/common/fsimage_grub.h +0 -0
similarity index 100%
rename from tools/libfsimage/common/fsimage_grub.h
rename to tools/libfsimage/common/xenfsimage_grub.h
tools/libfsimage/common/xenfsimage_plugin.h renamed from tools/libfsimage/common/fsimage_plugin.h +0 -0
similarity index 100%
rename from tools/libfsimage/common/fsimage_plugin.h
rename to tools/libfsimage/common/xenfsimage_plugin.h
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 9/12
#18 lore raw

Re: [PATCH 09/12] tools/libfsimage: Bump soname to 4.12

Quoted 5 lines · Ian Jackson

This library does not have a stable ABI promise. As far as we know it is used only by pygrub. Bump its soname to the Xen version (and intend to change it each time).

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#19 lore raw

PATCH v2 10/12 tools/libfsimage: Add `xen' to .h names and principal .so name

In reply to Ian Jackson

`fsimage' is rather general. And we do not expect this library to be very useful out of tree because of its unstable ABI.

So add the word `xen'. This will avoid naming conflicts with anyone else's fsimage library.

---
v2: New in this version of the series

---
 tools/libfsimage/Rules.mk                   |  2 +-
 tools/libfsimage/common/Makefile            | 34 ++++++++++++++---------------
 tools/libfsimage/common/fsimage_grub.c      |  2 +-
 tools/libfsimage/common/fsimage_plugin.c    |  2 +-
 tools/libfsimage/common/fsimage_priv.h      |  4 ++--
 tools/libfsimage/common/xenfsimage_grub.h   |  4 ++--
 tools/libfsimage/common/xenfsimage_plugin.h |  2 +-
 tools/libfsimage/ext2fs-lib/ext2fs-lib.c    |  2 +-
 tools/libfsimage/ext2fs/fsys_ext2fs.c       |  2 +-
 tools/libfsimage/fat/fsys_fat.c             |  2 +-
 tools/libfsimage/iso9660/fsys_iso9660.c     |  2 +-
 tools/libfsimage/reiserfs/fsys_reiserfs.c   |  2 +-
 tools/libfsimage/ufs/fsys_ufs.c             |  2 +-
 tools/libfsimage/xfs/fsys_xfs.c             |  2 +-
 tools/libfsimage/zfs/fsi_zfs.c              |  2 +-
 tools/libfsimage/zfs/fsi_zfs.h              |  2 +-
 tools/pygrub/setup.py                       |  2 +-
 tools/pygrub/src/fsimage/fsimage.c          |  2 +-
 18 files changed, 36 insertions(+), 36 deletions(-)
tools/libfsimage/Rules.mk +1 -1
index eab4ecb35e..2a29d9ef2b 100644
@@ -26,7 +26,7 @@ fs-uninstall:
 	fi
 
 $(FSLIB): $(PIC_OBJS)
-	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lxenfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
 
 clean distclean::
 	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS_RM)
tools/libfsimage/common/Makefile +17 -17
index beda8f5f3a..f20e1394a8 100644
@@ -15,7 +15,7 @@ LIB_SRCS-y = fsimage.c fsimage_plugin.c fsimage_grub.c
 
 PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
 
-LIB = libfsimage.so libfsimage.so.$(MAJOR) libfsimage.so.$(MAJOR).$(MINOR)
+LIB = libxenfsimage.so libxenfsimage.so.$(MAJOR) libxenfsimage.so.$(MAJOR).$(MINOR)
 
 .PHONY: all
 all: $(LIB)
@@ -24,32 +24,32 @@ all: $(LIB)
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
-	$(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
-	ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libfsimage.so.$(MAJOR)
-	ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)$(libdir)/libfsimage.so
-	$(INSTALL_DATA) fsimage.h $(DESTDIR)$(includedir)
-	$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(includedir)
-	$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(includedir)
+	$(INSTALL_PROG) libxenfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	ln -sf libxenfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR)
+	ln -sf libxenfsimage.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenfsimage.so
+	$(INSTALL_DATA) xenfsimage.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) xenfsimage_plugin.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) xenfsimage_grub.h $(DESTDIR)$(includedir)
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(DESTDIR)$(includedir)/fsimage_grub.h
-	rm -f $(DESTDIR)$(includedir)/fsimage_plugin.h
-	rm -f $(DESTDIR)$(includedir)/fsimage.h
-	rm -f $(DESTDIR)$(libdir)/libfsimage.so
-	rm -f $(DESTDIR)$(libdir)/libfsimage.so.$(MAJOR)
-	rm -f $(DESTDIR)$(libdir)/libfsimage.so.$(MAJOR).$(MINOR)
+	rm -f $(DESTDIR)$(includedir)/xenfsimage_grub.h
+	rm -f $(DESTDIR)$(includedir)/xenfsimage_plugin.h
+	rm -f $(DESTDIR)$(includedir)/xenfsimage.h
+	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so
+	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR)
+	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR).$(MINOR)
 
 clean distclean::
 	rm -f $(LIB)
 
-libfsimage.so: libfsimage.so.$(MAJOR)
+libxenfsimage.so: libxenfsimage.so.$(MAJOR)
 	ln -sf $< $@
-libfsimage.so.$(MAJOR): libfsimage.so.$(MAJOR).$(MINOR)
+libxenfsimage.so.$(MAJOR): libxenfsimage.so.$(MAJOR).$(MINOR)
 	ln -sf $< $@
 
-libfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
-	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+libxenfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenfsimage.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 -include $(DEPS_INCLUDE)
 
tools/libfsimage/common/fsimage_grub.c +1 -1
index ef71d6cceb..258d48bfbb 100644
@@ -28,7 +28,7 @@
 #include <strings.h>
 #include <errno.h>
 
-#include "fsimage_grub.h"
+#include "xenfsimage_grub.h"
 #include "fsimage_priv.h"
 
 static char *disk_read_junk;
tools/libfsimage/common/fsimage_plugin.c +1 -1
index 0744e7b3ca..44ebcf3142 100644
@@ -29,7 +29,7 @@
 #include <dlfcn.h>
 #include <errno.h>
 
-#include "fsimage_plugin.h"
+#include "xenfsimage_plugin.h"
 #include "fsimage_priv.h"
 
 static fsi_plugin_t *plugins;
tools/libfsimage/common/fsimage_priv.h +2 -2
index 57a0826dee..2274403557 100644
@@ -30,8 +30,8 @@ extern C {
 
 #include <sys/types.h>
 
-#include "fsimage.h"
-#include "fsimage_plugin.h"
+#include "xenfsimage.h"
+#include "xenfsimage_plugin.h"
 
 struct fsi_plugin {
 	const char *fp_name;
tools/libfsimage/common/xenfsimage_grub.h +2 -2
index 534c346b23..38fb4f620e 100644
@@ -33,8 +33,8 @@ extern C {
 #include <stdlib.h>
 #include <ctype.h>
 
-#include "fsimage.h"
-#include "fsimage_plugin.h"
+#include "xenfsimage.h"
+#include "xenfsimage_plugin.h"
 
 typedef struct fsig_plugin_ops {
 	int fpo_version;
tools/libfsimage/common/xenfsimage_plugin.h +1 -1
index a682719a63..4135769018 100644
@@ -30,7 +30,7 @@ extern C {
 
 #include <sys/types.h>
 
-#include "fsimage.h"
+#include "xenfsimage.h"
 
 #define	FSIMAGE_PLUGIN_VERSION 1
 
tools/libfsimage/ext2fs-lib/ext2fs-lib.c +1 -1
index 84b6d1e9c3..864a15b349 100644
@@ -21,7 +21,7 @@
  * Use is subject to license terms.
  */
 
-#include <fsimage_plugin.h>
+#include <xenfsimage_plugin.h>
 #include INCLUDE_EXTFS_H
 #include <errno.h>
 #include <inttypes.h>
tools/libfsimage/ext2fs/fsys_ext2fs.c +1 -1
index ba53ff4ca6..a4ed10419c 100644
@@ -16,7 +16,7 @@
  *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 
 #define	mapblock1 (*fsig_int1(ffi))
 #define	mapblock2 (*fsig_int2(ffi))
tools/libfsimage/fat/fsys_fat.c +1 -1
index b8129a8c04..b89354a872 100644
@@ -17,7 +17,7 @@
  */
 
 #include <limits.h>
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 #include "fat.h"
 
 struct fat_superblock 
tools/libfsimage/iso9660/fsys_iso9660.c +1 -1
index 5dbf100dfe..6e767357bf 100644
@@ -28,7 +28,7 @@
  *	Leonid Lisovskiy   <[email protected]>	2003
  */
 
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 #include <limits.h>
 
 #include "iso9660.h"
tools/libfsimage/reiserfs/fsys_reiserfs.c +1 -1
index 92c3b2bbfb..916eb15292 100644
@@ -17,7 +17,7 @@
  *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 
 #undef REISERDEBUG
 
tools/libfsimage/ufs/fsys_ufs.c +1 -1
index cf7e22ad0b..a545bc9f65 100644
@@ -22,7 +22,7 @@
 
 /* From Solaris usr/src/stand/lib/fs/ufs/ufsops.c */
 
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 
 #include "ufs.h"
 
tools/libfsimage/xfs/fsys_xfs.c +1 -1
index f39d096ba2..d735a88e55 100644
@@ -17,7 +17,7 @@
  *  along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 #include "xfs.h"
 
 #define MAX_LINK_COUNT	8
tools/libfsimage/zfs/fsi_zfs.c +1 -1
index 75145875fd..187a8bc6b2 100644
@@ -22,7 +22,7 @@
 
 #ifdef	FSYS_ZFS
 
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 #include <fsimage_priv.h>
 #include <stdio.h>
 #include <inttypes.h>
tools/libfsimage/zfs/fsi_zfs.h +1 -1
index fb4dc23bbf..980ce8f304 100644
@@ -27,7 +27,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 #include <string.h>
-#include <fsimage_grub.h>
+#include <xenfsimage_grub.h>
 
 
 /*** START FROM shared.h ****/
tools/pygrub/setup.py +1 -1
index 711bbbd499..b58cc1c4e6 100644
@@ -11,7 +11,7 @@ fsimage = Extension("fsimage",
     extra_compile_args = extra_compile_args,
     include_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
     library_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
-    libraries = ["fsimage"],
+    libraries = ["xenfsimage"],
     sources = ["src/fsimage/fsimage.c"])
 
 pkgs = [ 'grub' ]
tools/pygrub/src/fsimage/fsimage.c +1 -1
index 8ec0dec346..47940572a8 100644
@@ -23,7 +23,7 @@
 
 #include <Python.h>
 
-#include <fsimage.h>
+#include <xenfsimage.h>
 #include <stdlib.h>
 
 #if (PYTHON_API_VERSION >= 1011)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 10/12
#20 lore raw

Re: [PATCH 10/12] tools/libfsimage: Add `xen' to .h names and principal .so name

Quoted 7 lines · Ian Jackson

`fsimage' is rather general. And we do not expect this library to be very useful out of tree because of its unstable ABI.

So add the word `xen'. This will avoid naming conflicts with anyone else's fsimage library.

I think we will need another upgrade note for 4.12.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#21 lore raw

Re: [PATCH 10/12] tools/libfsimage: Add `xen' to .h names and principal .so name

Wei Liu writes ("Re: [PATCH 10/12] tools/libfsimage: Add `xen' to .h names and principal .so name"):

Quoted 12 lines · Ian Jackson
Quoted 7 lines

`fsimage' is rather general. And we do not expect this library to be very useful out of tree because of its unstable ABI.

So add the word `xen'. This will avoid naming conflicts with anyone else's fsimage library.

I think we will need another upgrade note for 4.12.

Sure, if you think so.

Juergen, something like:

* The fsimage library used by pygrub, which does not have a stable ABI, and the corresponding python module, have been renamed to `xenfsimage' (to reduce namespace pollution). Any out-of-tree users of this library will have to be updated.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#22 lore raw

PATCH v2 11/12 tools/pygrub: Add `xen' to fsimage python module name

In reply to Ian Jackson

This module should be called `libxenfsimage' for the same reasons that the C library should.

---
v2: New in this version of the series

---
 tools/pygrub/setup.py              | 4 ++--
 tools/pygrub/src/fsimage/fsimage.c | 8 ++++----
 tools/pygrub/src/pygrub            | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)
tools/pygrub/setup.py +2 -2
index b58cc1c4e6..b8f1dc4590 100644
@@ -7,7 +7,7 @@ extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 
 XEN_ROOT = "../.."
 
-fsimage = Extension("fsimage",
+xenfsimage = Extension("xenfsimage",
     extra_compile_args = extra_compile_args,
     include_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
     library_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
@@ -25,5 +25,5 @@ setup(name='pygrub',
       package_dir={'grub': 'src', 'fsimage': 'src'},
       scripts = ["src/pygrub"],
       packages=pkgs,
-      ext_modules = [ fsimage ]
+      ext_modules = [ xenfsimage ]
       )
tools/pygrub/src/fsimage/fsimage.c +4 -4
index 47940572a8..743a3fb7b8 100644
@@ -132,7 +132,7 @@ static char fsimage_file_type__doc__[] = "Filesystem image file";
 PyTypeObject fsimage_file_type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,					/* ob_size */
-	"fsimage.file",				/* tp_name */
+	"xenfsimage.file",			/* tp_name */
 	sizeof(fsimage_file_t),			/* tp_size */
 	0,					/* tp_itemsize */
 	(destructor) fsimage_file_dealloc, 	/* tp_dealloc */
@@ -234,7 +234,7 @@ PyDoc_STRVAR(fsimage_fs_type__doc__, "Filesystem image");
 PyTypeObject fsimage_fs_type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,					/* ob_size */
-	"fsimage.fs",				/* tp_name */
+	"xenfsimage.fs",			/* tp_name */
 	sizeof(fsimage_fs_t),			/* tp_size */
 	0,					/* tp_itemsize */
 	(destructor) fsimage_fs_dealloc, 	/* tp_dealloc */
@@ -317,7 +317,7 @@ static struct PyMethodDef fsimage_module_methods[] = {
 };
 
 PyMODINIT_FUNC
-initfsimage(void)
+initxenfsimage(void)
 {
-	Py_InitModule("fsimage", fsimage_module_methods);
+	Py_InitModule("xenfsimage", fsimage_module_methods);
 }
tools/pygrub/src/pygrub +3 -3
index dd0c8f77df..52a8965ad9 100755
@@ -21,7 +21,7 @@ import xen.lowlevel.xc
 import curses, _curses, curses.wrapper, curses.textpad, curses.ascii
 import getopt
 
-import fsimage
+import xenfsimage
 import grub.GrubConf
 import grub.LiloConf
 import grub.ExtLinuxConf
@@ -897,7 +897,7 @@ if __name__ == "__main__":
 
     for offset in part_offs:
         try:
-            fs = fsimage.open(file, offset, bootfsoptions)
+            fs = xenfsimage.open(file, offset, bootfsoptions)
 
             chosencfg = sniff_solaris(fs, incfg)
 
@@ -945,7 +945,7 @@ if __name__ == "__main__":
 
     args = None
     if chosencfg["args"]:
-        zfsinfo = fsimage.getbootstring(fs)
+        zfsinfo = xenfsimage.getbootstring(fs)
         if zfsinfo is not None:
             e = re.compile("zfs-bootfs=[\w\-\.\:@/]+" )
             (chosencfg["args"],count) = e.subn(zfsinfo, chosencfg["args"])
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 11/12
#23 lore raw

Re: [PATCH 11/12] tools/pygrub: Add `xen' to fsimage python module name

Quoted 4 lines · Ian Jackson

This module should be called `libxenfsimage' for the same reasons that the C library should.

Upgrade note is needed.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#24 lore raw

PATCH v2 12/12 tools/libfsimage: Rename /usr/lib/fs to /usr/lib/xenfsimage

In reply to Ian Jackson

Again, avoid namespace pollution. These paths are purely internal to libfsimage and its fs-specific modules, so no visible change from the outside.

---
v2: New in this version of the series

---
 tools/libfsimage/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libfsimage/Rules.mk +1 -1
index 2a29d9ef2b..bb6d42abb4 100644
@@ -6,7 +6,7 @@ LDFLAGS += -L../common/
 
 PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
 
-FSDIR = $(libdir)/fs
+FSDIR = $(libdir)/xenfsimage
 
 FSLIB = fsimage.so
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v2 12/12
#25 lore raw

Re: [PATCH 12/12] tools/libfsimage: Rename /usr/lib/fs to /usr/lib/xenfsimage

Quoted 5 lines · Ian Jackson

Again, avoid namespace pollution. These paths are purely internal to libfsimage and its fs-specific modules, so no visible change from the outside.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel