Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apache/cloudstack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: apache/cloudstack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.20
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 5 contributors

Commits on Sep 11, 2026

  1. KVM: assign the hot-plugged NIC the next PCI slot above existing NICs…

    … (monotonic interface naming) (#12826)
    
    * KVM: assign explicit PCI slot when hot-plugging NIC to ensure sequential naming
    
    When hot-plugging a NIC to a running VM, libvirt auto-assigns the next
    free PCI slot. Since non-NIC devices (virtio-serial, disk, balloon,
    watchdog) occupy slots immediately after existing NICs, the hot-plugged
    NIC gets a much higher slot number (e.g. 0x09 instead of 0x05), causing
    the guest to see non-sequential interface names (ens9 instead of ens5).
    
    This fix queries the domain XML to find all used PCI slots and assigns
    the next free slot after the highest existing NIC slot. This matches
    the approach already used by LibvirtReplugNicCommandWrapper which
    preserves PCI slots during re-plug operations.
    
    Fixes #12825
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
    
    * fix(kvm): NPE in PlugNic when libvirt domain XML is unavailable
    
    LibvirtPlugNicCommandWrapper.findNextAvailablePciSlot calls
    vm.getXMLDesc(0) and pipes the result straight into Pattern.matcher,
    which NPEs if libvirt returned null (or, in the
    LibvirtComputingResourceTest.testPlugNicCommandNoMatchMack unit test,
    when the Domain mock isn't stubbed for getXMLDesc). Reported by
    @DaanHoogland after the SL packaging run on #12826.
    
    Defensive null check returns null from findNextAvailablePciSlot when
    the domain XML can't be parsed, which falls through to libvirt's
    auto-assignment of the PCI slot — same behaviour as before this PR
    when nextSlot is null.
    
    Also stubs Domain.getXMLDesc(0) in testPlugNicCommandNoMatchMack with
    a minimal <domain> XML that exercises the parser path (rather than
    just relying on the null-fallback), so the test continues to cover
    the happy path of the new logic.
    
    * address review (#12826): parse PCI addresses with an XML parser, split slot selection into helpers, add unit tests
    
    - getUsedPciSlots() parses the domain XML with the safer DocumentBuilderFactory
      and only considers <address type='pci'> elements, replacing the regex.
    - getHighestNicSlot() and getFirstFreeSlotAbove() are separate methods.
    - The javadoc now states the guarantee precisely: deterministic and monotonic
      after the last NIC, not contiguous when other devices sit in between.
    - LibvirtPlugNicCommandWrapperTest covers parsing, selection and the fallbacks.
    
    Signed-off-by: James Peru <jmsperu@gmail.com>
    
    ---------
    
    Signed-off-by: James Peru <jmsperu@gmail.com>
    Co-authored-by: James Peru <jamesperu@Jamess-Mac-mini.local>
    Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
    Co-authored-by: jmsperu <jmsperu@users.noreply.github.com>
    4 people authored Sep 11, 2026
    Configuration menu
    Copy the full SHA
    a4d3c66 View commit details
    Browse the repository at this point in the history
  2. ui: fix info card showing invalid template, iso link (#13199)

    Template/ISO for a VM could be in deleted state therefore links should not be shown for them in the VM info-card.
    
    Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
    shwstppr authored Sep 11, 2026
    Configuration menu
    Copy the full SHA
    8261bec View commit details
    Browse the repository at this point in the history
Loading