XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    The Lowest Priority Bug Ever? (/etc/udev/rules.d/z10-xen-vcpu-hotplug.rules)

    Scheduled Pinned Locked Moved XCP-ng
    5 Posts 3 Posters 398 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      bnerickson
      last edited by bnerickson

      I'm unsure where to report this, but syslog reports the following warning when a VM starts:

      (UDEV-WORKER)   cpu0: Process '/bin/sh -c '[ -e /dev/xen/xenbus ] && [ -e /sys/devices/system/cpu/cpu0/online ] && echo 1 > /sys/devices/system/cpu/cpu0/online'' failed with exit code 1.
      

      This is because /sys/devices/system/cpu/cpu0/online does not exist. I'm assuming that this may be expected, so I think the udev rule could be rewritten as follows to avoid spitting out an error:

      # cat /etc/udev/rules.d/z10-xen-vcpu-hotplug.rules
      ACTION=="add", SUBSYSTEM=="cpu", RUN+="/bin/sh -c 'if [ -e /dev/xen/xenbus ] && [ -e /sys$devpath/online ]; then echo 1 > /sys$devpath/online; fi'"
      
      rzrR 1 Reply Last reply Reply Quote 0
      • B Offline
        bnerickson
        last edited by

        Oh, syslog also reports the following harmless warning:

        Configuration file /etc/udev/rules.d/z10-xen-vcpu-hotplug.rules is marked executable. Please remove executable permission bits. Proceeding anyway.  4
        

        So presumably the executable bits should be removed from this file as well.

        For what it's worth:

        dom0 version:

        xcp-ng-release-config-8.3.0-35.x86_64
        xcp-ng-deps-8.3-13.noarch
        xcp-ng-plymouth-theme-1.1.0-5.xcpng8.3.noarch
        xcp-ng-xapi-plugins-1.15.0-1.xcpng8.3.noarch
        xcp-ng-generic-lib-1.1.1-4.xcpng8.3.x86_64
        xcp-ng-release-presets-8.3.0-35.x86_64
        xcp-ng-release-8.3.0-35.x86_64
        xcp-ng-pv-tools-8.3-15.xcpng8.3.noarch
        

        VM Details:
        Kernel:

        $ uname -a
        Linux fqdn 6.12.0-124.27.1.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 15 13:51:25 UTC 2026 x86_64 GNU/Linux
        

        OS:

        $ cat /etc/os-release 
        NAME="Rocky Linux"
        VERSION="10.1 (Red Quartz)"
        ID="rocky"
        ID_LIKE="rhel centos fedora"
        VERSION_ID="10.1"
        PLATFORM_ID="platform:el10"
        PRETTY_NAME="Rocky Linux 10.1 (Red Quartz)"
        ANSI_COLOR="0;32"
        LOGO="fedora-logo-icon"
        CPE_NAME="cpe:/o:rocky:rocky:10::baseos"
        HOME_URL="https://rockylinux.org/"
        VENDOR_NAME="RESF"
        VENDOR_URL="https://resf.org/"
        BUG_REPORT_URL="https://bugs.rockylinux.org/"
        SUPPORT_END="2035-05-31"
        ROCKY_SUPPORT_PRODUCT="Rocky-Linux-10"
        ROCKY_SUPPORT_PRODUCT_VERSION="10.1"
        REDHAT_SUPPORT_PRODUCT="Rocky Linux"
        REDHAT_SUPPORT_PRODUCT_VERSION="10.1"
        
        1 Reply Last reply Reply Quote 1
        • olivierlambertO Online
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by

          Worth asking @Team-OS-Platform-Release

          B 1 Reply Last reply Reply Quote 1
          • B Offline
            bnerickson @olivierlambert
            last edited by

            @Team-OS-Platform-Release , lowest priority ever, but any thoughts on the topic at hand?

            1 Reply Last reply Reply Quote 1
            • rzrR Offline
              rzr Vates 🪐 XCP-ng Team @bnerickson
              last edited by rzr

              @bnerickson said:

              Thanks for the reminder, for some reason it was not seen before (all applogies).

              I'm unsure where to report this,

              Here or in related open projects directly (assuming you know where to look at) but let me guide you.

              but syslog reports the following warning when a VM starts:

              (UDEV-WORKER)   cpu0: Process '/bin/sh -c '[ -e /dev/xen/xenbus ] && [ -e /sys/devices/system/cpu/cpu0/online ] && echo 1 > /sys/devices/system/cpu/cpu0/online'' failed with exit code 1.
              

              Good catch, it's a bad habit to use AND (&&) in conditionals.

              Hardcore programmers prefer to use OR (||) in scripts, this practice prevents failed exit and make debugging easier (with set -xe).

              (...)

              > ACTION=="add", SUBSYSTEM=="cpu", RUN+="/bin/sh -c 'if [ -e /dev/xen/xenbus ] && [ -e /sys$devpath/online ]; then echo 1 > /sys$devpath/online; fi'"
              

              That would work, What about this "simpler" form ?

              [ ! -e /dev/xen/xenbus ]  || [ ! -e /sys$devpath/online ] || echo 1 > /sys$devpath/online 
              

              Could be harder to read, but I get used to.

              If you want you can contribute the fix directly to upstream since the file is public at:

              https://github.com/xenserver/xe-guest-utilities/blob/master/mk/xen-vcpu-hotplug.rules

              About the exec bit, here is the line that should be changed:

              https://github.com/xcp-ng-rpms/xcp-ng-pv-tools/commit/3d134fbd0f3ac9e2f3cfa914e38b33529635d458#r183816712

              @bnerickson, If you need any mentoring for OSS contributions, I would be more than a happy to help.
              Since it's a lowest priority you can take all the time you need, and If too busy, no problem we can do it for you and then backport the change to XCP-ng.

              1 stormi committed to xcp-ng-rpms/xcp-ng-pv-tools
              Build the tools from the sources
              
              - Build 32 bit and 64 bit xe-guest-utilities
              - Build TGZ, RPM and DEB packages for xe-guest-utilities
              - Put the result into the ISO and the ISO into the xcp-ng-pv-tools RPM
                (as before).
              
              It's a bit hacky, but as the binaries are statically linked, this
              peculiar build process should work.
              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post