Skip to contentSkip to conversation

tools/xenpvboot: remove as unable to convert to Python 3

PATCH In review Roger Pau Monne 4 participants 9 messages Oct 6, 2023 – Nov 22, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xenpvboot: remove as unable to convert to Python 3

The script heavily relies on the urlgrabber python module, which doesn't seem to be packaged by all distros, it's missing from newer Debian versions at least.

Also the usage of the commands module has been deprecated since Python 2.6, and removed in Python 3, so the code would need to be re-written to not rely on urlgrabber and the commands modules.

Arguably the purpose of the xenpvnetboot bootloader can also be achieved with an isolated script that fetches the kernel and ramdisk before attempting to launch the domain, without having to run in libxl context. There are no xl.cfg options consumed by the bootloader apart from the base location and the subpaths of the kernel and ramdisk to fetch.

Any interested parties in keeping such functionality are free to submit an updated script that works with Python 3.

---
 CHANGELOG.md            |   1 +
 tools/misc/Makefile     |   7 +-
 tools/misc/xenpvnetboot | 291 ----------------------------------------
 3 files changed, 2 insertions(+), 297 deletions(-)
 delete mode 100755 tools/misc/xenpvnetboot
CHANGELOG.md +1 -0
index 47ea9e275462..165c5caf9bea 100644
@@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - On x86, the "pku" command line option has been removed.  It has never
    behaved precisely as described, and was redundant with the unsupported
    "cpuid=no-pku".  Visibility of PKU to guests should be via its vm.cfg file.
+ - xenpvnetboot removed as unable to convert to Python 3.
 
 ## [4.17.0](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.17.0) - 2022-12-12
 
tools/misc/Makefile +1 -6
index 233a7948c050..9938bc235968 100644
@@ -36,11 +36,8 @@ INSTALL_SBIN                   += xen-livepatch
 INSTALL_SBIN                   += xen-diag
 INSTALL_SBIN += $(INSTALL_SBIN-y)
 
-# Everything to be installed in a private bin/
-INSTALL_PRIVBIN                += xenpvnetboot
-
 # Everything to be installed
-TARGETS_ALL := $(INSTALL_BIN) $(INSTALL_SBIN) $(INSTALL_PRIVBIN)
+TARGETS_ALL := $(INSTALL_BIN) $(INSTALL_SBIN)
 
 # Everything which only needs copying to install
 TARGETS_COPY += xencov_split
@@ -59,11 +56,9 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(bindir)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(sbindir)
-	$(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(LIBEXEC_BIN)
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(addprefix $(DESTDIR)$(LIBEXEC_BIN)/, $(INSTALL_PRIVBIN))
 	rm -f $(addprefix $(DESTDIR)$(sbindir)/, $(INSTALL_SBIN))
 	rm -f $(addprefix $(DESTDIR)$(bindir)/, $(INSTALL_BIN))
 
tools/misc/xenpvnetboot deleted +0 -291

291 lines not on this page · raw message

Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Roger Pau Monne

The script heavily relies on the urlgrabber python module, which doesn't seem to be packaged by all distros, it's missing from newer Debian versions at least.

Also the usage of the commands module has been deprecated since Python 2.6, and removed in Python 3, so the code would need to be re-written to not rely on urlgrabber and the commands modules.

Quoted 8 lines

Arguably the purpose of the xenpvnetboot bootloader can also be achieved with an isolated script that fetches the kernel and ramdisk before attempting to launch the domain, without having to run in libxl context. There are no xl.cfg options consumed by the bootloader apart from the base location and the subpaths of the kernel and ramdisk to fetch.

Any interested parties in keeping such functionality are free to submit an updated script that works with Python 3.

Resolves: xen-project/xen#172

Quoted 1 line

Thanks for doing this.

~Andrew

#2 lore raw

Hi,

Quoted 17 lines · Andrew Cooper
Quoted 14 lines · Roger Pau Monne

The script heavily relies on the urlgrabber python module, which doesn't seem to be packaged by all distros, it's missing from newer Debian versions at least.

Also the usage of the commands module has been deprecated since Python 2.6, and removed in Python 3, so the code would need to be re-written to not rely on urlgrabber and the commands modules.

Arguably the purpose of the xenpvnetboot bootloader can also be achieved with an isolated script that fetches the kernel and ramdisk before attempting to launch the domain, without having to run in libxl context. There are no xl.cfg options consumed by the bootloader apart from the base location and the subpaths of the kernel and ramdisk to fetch.

Quoted 8 lines
Quoted 2 lines

Any interested parties in keeping such functionality are free to submit an updated script that works with Python 3.

Resolves: xen-project/xen#172

Quoted 1 line
Quoted 2 lines

Thanks for doing this.

+1

Kind regards,
Henry

Quoted 2 lines

~Andrew

#3 lore raw
In reply to Roger Pau Monne
Quoted 7 lines · Roger Pau Monne
tools/misc/Makefile +0 -0
index 233a7948c050..9938bc235968 100644
@@ -36,11 +36,8 @@ INSTALL_SBIN                   += xen-livepatch
 INSTALL_SBIN                   += xen-diag
 INSTALL_SBIN += $(INSTALL_SBIN-y)

tools/misc/Makefile INSTALL_SBIN += xen-livepatch · line 43

Quoted 10 lines
tools/misc/Makefile +1 -4
 
-# Everything to be installed in a private bin/
-INSTALL_PRIVBIN                += xenpvnetboot
-
 # Everything to be installed
-TARGETS_ALL := $(INSTALL_BIN) $(INSTALL_SBIN) $(INSTALL_PRIVBIN)
+TARGETS_ALL := $(INSTALL_BIN) $(INSTALL_SBIN)
 
 # Everything which only needs copying to install
 TARGETS_COPY += xencov_split

FYI.

Just out of context here is one more reference.  I've folded in the following hunk.

tools/misc/Makefile +0 -0
index 9938bc235968..66d0d6b09029 100644
@@ -41,7 +41,6 @@ TARGETS_ALL := $(INSTALL_BIN) $(INSTALL_SBIN)


 # Everything which only needs copying to install TARGETS_COPY += xencov_split
-TARGETS_COPY += xenpvnetboot

 # Everything which needs to be built
 TARGETS := $(filter-out $(TARGETS_COPY),$(TARGETS_ALL))

~Andrew

#4 lore raw
In reply to Roger Pau Monne
Quoted 14 lines · Roger Pau Monne

The script heavily relies on the urlgrabber python module, which doesn't seem to be packaged by all distros, it's missing from newer Debian versions at least.

Also the usage of the commands module has been deprecated since Python 2.6, and removed in Python 3, so the code would need to be re-written to not rely on urlgrabber and the commands modules.

Arguably the purpose of the xenpvnetboot bootloader can also be achieved with an isolated script that fetches the kernel and ramdisk before attempting to launch the domain, without having to run in libxl context. There are no xl.cfg options consumed by the bootloader apart from the base location and the subpaths of the kernel and ramdisk to fetch.

Quoted 4 lines

Any interested parties in keeping such functionality are free to submit an updated script that works with Python 3.

I've just found
https://build.opensuse.org/package/view_file/openSUSE:Leap:15.5:Update/xen/bin-python3-conversion.patch?expand=1

Which includes the modifications to make this work with Python 3.

Does this mean there are SLES/OpenSUSE users of xenpvboot ?

~Andrew

#6 lore raw
Quoted 6 lines · Olaf Hering

Wed, 22 Nov 2023 20:30:59 +0000 Andrew Cooper <[email protected]>:

Quoted 1 line

Does this mean there are SLES/OpenSUSE users of xenpvboot ?

We do not know. It is gone by now, in 4.18:

https://build.opensuse.org/request/show/1126897

Yes.  The email I replied to was the patch we merged into 4.18 deleting it because we thought noone had ever made it function for Py3, with the implication being that if this was going to be a problem, we could reinstate it with the fixes from your patch.

But that entirely depends on whether you think anyone is using it or not.

~Andrew

#7 lore raw

Wed, 22 Nov 2023 20:46:15 +0000 Andrew Cooper <[email protected]>:

Quoted 1 line

But that entirely depends on whether you think anyone is using it or not.

We never got any bugreport, nor have we any indication for actual usage. The script was in the sources. Python3 is supposed to be the default interpreter since a number of years, so something had to be done with every installed python script in the sources.

I think if anyone shows up and demands this script, it could be restored. Otherwise it is one less thing to worry about.

Olaf

#8 lore raw
Quoted 10 lines · Olaf Hering

Wed, 22 Nov 2023 20:46:15 +0000 Andrew Cooper <[email protected]>:

Quoted 1 line

But that entirely depends on whether you think anyone is using it or not.

We never got any bugreport, nor have we any indication for actual usage. The script was in the sources. Python3 is supposed to be the default interpreter since a number of years, so something had to be done with every installed python script in the sources.

I think if anyone shows up and demands this script, it could be restored. Otherwise it is one less thing to worry about.

Ok.  Lets leave it to rest as it is.

If we need to resurrect it, there's enough context on this thread to get a Py3 compatible one.

~Andrew