Skip to content

[xcpng9] port XCP-ng patches to 11.1.8 9.0 - #56

Draft
ydirson wants to merge 30 commits into
11.1.8-9.0from
ydi/11.1.8-9.0
Draft

[xcpng9] port XCP-ng patches to 11.1.8 9.0#56
ydirson wants to merge 30 commits into
11.1.8-9.0from
ydi/11.1.8-9.0

Conversation

@ydirson

@ydirson ydirson commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

This is a first iteration, featuring:

  • no ipv6 patch
  • no linstor support
  • no BIOS support
  • no testing whatsover, no warranty, no nothing

ydirson and others added 30 commits June 17, 2026 16:09
Covers:
1. repo_gpgcheck:
  a. wrong system clock putting gpg key creation in the future, causing a
     yum crash (nothing special happens if the date of the signature is in
     the future ¯\_(ツ)_/¯)
  b. other yum crashes due to uncaught gpg exceptions (if any)
  c. lack of repomd signature (while repo_gpgcheck is in force)
  d. signature done by other key than the one in ISO ("repomd.xml signature
     could not be verified" ¯\_(ツ)_/¯)
2. gpgcheck:
  a. RPM signed with unknown key
  b. unsigned RPM referenced by unsigned repomd (no-repo-gpgcheck)
  c. RPM re-signed with unknown key, unsigned repomd (no-repo-gpgcheck)
  d. RPM overwritten with another RPM signed with known key (diagnosed
     through hash but, same diag as 2.c)
  e. delsigned/resigned/etc RPM, unchanged repomd (same diag as 2.c/d)

Does not cover notably:
  - unsigned RPM referenced by (re)signed repomd

In some cases Yum does not give an error, but dies because of an
uncaught exception, which makes this check quite brittle, but in the
worst case if messages change, we still fallback to the original
"Error installing packages" message.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
XAPI now rejects the default keysize of 7.x era, which must be
regenerated before upgrading to 8.3.  Let the installer refuse to
initiate a situation where a Rolling Pool Upgrade would be unable to
proceed, with not-yet-updated slaves holding the running VMs getting
refused connection to the updated part of the pool.

To be extra-safe, add a check that the key is indeed a RSA one as
that's all current XAPI supports, this will make sure this code gets
updated when XAPI starts supporting other key types.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
- it is bad practice to "catch any"
- not logging anything just hides information, which can be especially
  important here as the reason for a try/catch is not obvious (exceptions
  thrown by XenServerBackup.__init__?)

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
Previous code structure was that of 2 nested if's, with nominal code
path being in the positive branch of each if.  Adding another
condition will bring a need for logging the reason to ignore a backup,
but doing that by converting inner `if` to an `elif` chain (arguably
the simplest modification) would bring the nominal code path to switch
to the negative/last branch of the inner `elif` chain.  At the same
time, the outer `if` would not seem special enough to deserve it
special place (and the cyclomatic complexity).

This commit leverages the existing `try:except:` block to switch to an
"error out the loop" pattern, where the nominal code path is just
linear.

Using `StopIteration` may feel like an abuse, but:
- it is the only standard `Exception` that is not a `StandardError` or
  a `Warning`, and defining a new one could seem overkill
- the closest alternative would be a `while True` loop and breaking out
  in both exceptional code paths and at the end of nominal path, where
  the `break` statements would "stop the iteration" as well

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
All files matchin `custom.*\.conf` will be kept
upon upgrade.

See: xapi-project/sm#600

Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
The swraid code path does disassemble pre-existing swraid when we're
going to create a new one, but this would not be done when the selected
primary disk is part of a pre-existing raid.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
There are debug traces in the code, but no way to see them without
modifying the code.  They're not even intrusive enough to justify filtering
them out by default.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
When an install with a local SR on a raid device pre-exists, selecting a
member of that RAID probed that device directly, and sfdisk would report
partitions to analyze, which the kernel filtered out because of the RAID.
This caused failure to access those partitions through unavailable block
devices.

Since the goal here is to warn the user of possible data loss, scan the
RAID device for SR instead.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
This is a first step before calling this code earlier.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
The former actually does some checks which can cause an upgrade to abort
(although with very low probability), and running the latter first would
leave a host in a broken state, in need for a Restore before attempting
a new upgrade.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
This function searches for the /boot/efi mount point in the /etc/fstab
file of the mount point directory passed as parameter and returns True
if present, False otherwise.

This will allow to check that an existing installation or backup boot
mode matches with the installer boot mode.

Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
This patch checks the boot mode of an existing backups and disallows its
restoration if it differs from the installer one. This uses the new
helper function is_rootf_uefi().

Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
In interactive mode, when Driver Disks are used as local media, they
must *also* be installed as Supplemental Packs after installation.
This change remembers the use of Driver Disks and makes sure the
question is asked, even when the supplemental-packs feature is
disabled.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
It may not be obvious to users that local-media Driver Disks must be
inserted twice during installation.  This change uses the memorization
of usage of Driver Disks from previous commit, and uses it to explain
users they likely wants to insert their Driver Disk again.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
While developing and/or installing from an already-verified ISO, yum's
repo_gpgcheck just gets in the way.  This provides a general kill-switch
for checking repomd.xml.asc, through commandline or answerfile.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
Similar to no-repo-gpgcheck but for RPM sigs.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
Global *gpgcheck flag can change the default from True to False, and these
new flags allow to override this default on a per-source basis.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
When originally implementing the per-source gpgcheck flags in
answerfile[1], the full code was moved to an anwerfile-only location,
breaking the original interactive-install implementation (and then
following code review[2] the working code for interactive install
disappeared further from the patch series).

This moves the Repository flag-setting to `add_repos()` common code,
while leaving the flag computation to the caller, since only the
answerfile case has to do any non-trivial logic.

- [1] 06b7007
- [2] #2 (comment)

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
Signed-off-by: Samuel Verschelde <stormi@laposte.net>

Orig-commit: 9f0f094
Orig-commit: eb796dc
Signed-off-by: Samuel Verschelde <stormi@laposte.net>

Orig-commit: 2731116
- show kernel-alt warning

Originally-by: Rushikesh Jadhav <rushikesh7@gmail.com>

- Update warning message when installing with kernel-alt
- cleaner reboot action on that screen: return EXIT
- fix detection of the kernel-alt boot parameter of the installer
- install kernel-alt when booting on install-alt
- create initrd and update grub configuration as post-install task

Signed-off-by: Samuel Verschelde <stormi@laposte.net>

Orig-commit: 243ce81
Orig-commit: d9a8a3e
Orig-commit: 7d9e1b0
Orig-commit: 9447964
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
Originally-by: Samuel Verschelde <stormi@laposte.net>
Signed-off-by: Yann Dirson <yann.dirson@vates.fr>

Orig-commit: b20e303
The presence of this parameter changes the installer behavior,
preventing local source installation and pre-populating the xcp-ng
install url.

Originally-by: Nicolas Raynaud <github@nraynaud.com>

Use the `--netinstall` parameter that is automatically
generated at preinit stage and translate it into
`answers['netinstall'] = True`.

Signed-off-by: Samuel Verschelde <stormi@laposte.net>

Orig-commit: 36395c3
Orig-commit: 098a2f4
Orig-commit: 0b298cd
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
Also change text for a more suitable description.

Originally-by: Samuel Verschelde <stormi@laposte.net>
Orig-commit: b4ebf81
Orig-commit: 03d3a84
Orig-commit: d3857b8
Orig-commit: 604f0b0

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
This complements the default choice previously changed in the TUI.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
…ntax.

This is a rewritten version of original RAID1 support found in early
8.3.0 versions, on top of upstream swraid support added ustream in
more recent installer versions.

It adds to upstream support:
- TUI support
- Answerfile support for the original XCP-ng syntax:

  <raid device="md127">
    <disk>sda</disk>
    <disk>sdb</disk>
  </raid>

Compared to original XCP-ng implementation, we lose:

- edge cases where the feature could be used to create a RAID for
  other usages than the primary/system disk
- ability to put more than 2 disks in the RAID (though the TUI still
  allows to select them)

Originally-by: Nicolas Raynaud <github@nraynaud.com>
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
@ydirson
ydirson requested a review from a team June 17, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants