Mailing List Archive

Xenstored not finding gnttab during boot
Hi,

the Xenstored service is failing during boot because it can't find gnttab during boot. But the file /usr/lib/libxengnttab.so.1.2 is there and if I manually start /usr/sbin/xenstored or /etc/xen/scripts/launch-xenstore it works. Does anyone have an idea why xenstored can't find the library during boot, but can find it after the boot?

This is the Xenstored service status after booting:
* xenstored.service - The Xen xenstore
Loaded: loaded (/etc/systemd/system/xenstored.service; enabled; vendor preset: enabled)
Active: failed (Result: protocol) since Thu 2021-01-14 12:35:41 UTC; 12min ago
Main PID: 405 (code=exited, status=0/SUCCESS)

Jan 14 12:35:40 xenhost systemd[1]: Starting The Xen xenstore...
Jan 14 12:35:41 xenhost launch-xenstore[405]: Starting /usr/sbin/xenstored...FATAL: Failed to open connection to gnttab: No such file or directory
Jan 14 12:35:41 xenhost systemd[1]: xenstored.service: Failed with result 'protocol'.
Jan 14 12:35:41 xenhost systemd[1]: Failed to start The Xen xenstore.


For context, this is my 'xl info':
host : xenhost
release : 5.4.0-xilinx-v2020.2
version : #1 SMP Tue Jan 12 12:04:34 UTC 2021
machine : aarch64
nr_cpus : 4
max_cpu_id : 3
nr_nodes : 1
cores_per_socket : 1
threads_per_core : 1
cpu_mhz : 100.000
hw_caps : 00000000:00000000:00000000:00000000:00000000:00000000:00000000:00000000
virt_caps : hvm hvm_directio hap iommu_hap_pt_share
total_memory : 6143
free_memory : 1917
sharing_freed_memory : 0
sharing_used_memory : 0
outstanding_claims : 0
free_cpus : 0
xen_major : 4
xen_minor : 13
xen_extra : .0
xen_version : 4.13.0
xen_caps : xen-3.0-aarch64 xen-3.0-armv7l
xen_scheduler : null
xen_pagesize : 4096
platform_params : virt_start=0x200000
xen_changeset : Tue Sep 29 15:34:31 2020 -0700 git:dfa58d1a3f-dirty
xen_commandline : console=dtuart dtuart=serial0 dom0_mem=4G dom0_max_vcpus=1 bootscrub=0 vwfi=native sched=null
cc_compiler : aarch64-xilinx-linux-gcc (GCC) 9.2.0
cc_compile_date : Thu Jan 14 09:11:59 UTC 2021
build_id : f1c65240b433f0ff6d0cfb67c35b0864e88d4056
xend_config_format : 4

And this is the config file for the Xenstored service:
[Unit]
Description=The Xen xenstore
Requires=proc-xen.mount var-lib-xenstored.mount
After=proc-xen.mount var-lib-xenstored.mount
Before=libvirtd.service libvirt-guests.service
RefuseManualStop=true
ConditionPathExists=/proc/xen/capabilities

[Service]
Type=notify
NotifyAccess=all
RemainAfterExit=true
ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
ExecStart=/etc/xen/scripts/launch-xenstore

[Install]
WantedBy=multi-user.target
Also=proc-xen.mount
Also=var-lib-xenstored.mount

Best regards,
Dominik
re: Xenstored not finding gnttab during boot [ In reply to ]
the static service below should load xen kernel modules. Did you include the
systemd-modules-load.service file in your build?

Notice the xen-gntdev module.

Below I show a status check for xen-4.12 running in Ubuntu Bionic.

user@xen1804:~$ sudo systemctl status systemd-modules-load
* systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/lib/systemd/system/systemd-modules-load.service;
static; vendor preset: enabled)
Active: active (exited) since Fri 2021-01-15 12:30:37 PST; 2h 50min ago
Docs: man:systemd-modules-load.service(8)
man:modules-load.d(5)
Process: 298 ExecStart=/lib/systemd/systemd-modules-load
(code=exited, status=0/SUCCESS)
Main PID: 298 (code=exited, status=0/SUCCESS)

Jan 15 12:30:37 xen1804 systemd-modules-load[298]: Inserted module 'xen_evtchn'
Jan 15 12:30:37 xen1804 systemd-modules-load[298]: Inserted module 'xen_gntdev'
Jan 15 12:30:37 xen1804 systemd-modules-load[298]: Inserted module
'xen_gntalloc'
Jan 15 12:30:37 xen1804 systemd-modules-load[298]: Inserted module 'xen_blkback'
Jan 15 12:30:37 xen1804 systemd-modules-load[298]: Inserted module 'xen_netback'
Jan 15 12:30:37 xen1804 systemd-modules-load[298]: Inserted module 'xen_pciback'
Jan 15 12:30:37 xen1804 systemd[1]: Started Load Kernel Modules.
Warning: Journal has been rotated since unit was started. Log output
is incomplete or unavailable.

cheers,
Prymar56
##xen-packaging on Freenode
new build of xen-4.14.1 in Bullseye, lately in Freeze