FS#55579 - [linux-tools-meta][hyperv] Distribution-specific scripts are not found

Attached to Project: Community Packages
Opened by Andrii Melnykov (zoidberg_md) - Sunday, 10 September 2017, 18:09 GMT
Last edited by Sébastien Luttringer (seblu) - Sunday, 14 July 2019, 23:56 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

[root@arch ~]$ hv_kvp_daemon -n
sh: /usr/libexec/hypervkvpd/hv_get_dns_info: No such file or directory
sh: /usr/libexec/hypervkvpd/hv_get_dhcp_info: No such file or directory
sh: /usr/libexec/hypervkvpd/hv_get_dns_info: No such file or directory
sh: /usr/libexec/hypervkvpd/hv_get_dhcp_info: No such file or directory

Additional info:
* hyperv-4.13-1

Steps to reproduce:

- pacman -Sy hyperv
- hv_kvp_daemon -n
- open the VM in Hyper-V Manager
- go to "networking properties" tab (the other tabs are Summary and Memory)

Expected behaviour: nothing happens in the log

Actual behaviour: the 4 messages are emitted

I think the fix is
- to patch the code to change the folder to more appropriate one (there's no /usr/libexec on arch, so /usr/lib/hyperv seems more appropriate)
- to actually supply these scripts (the prototypes are already in the tools/hv folder, and they do work on Arch)
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Sunday, 14 July 2019, 23:56 GMT
Reason for closing:  Won't fix
Comment by Eli Schwartz (eschwartz) - Sunday, 10 September 2017, 18:56 GMT
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/hv/hv_kvp_daemon.c#n97 the right defines should do The Right Thing™

Also the scripts in question exist in the same directory, but there is no make install target upstream so they were presumably overlooked.
Comment by Sébastien Luttringer (seblu) - Sunday, 10 September 2017, 19:01 GMT
I don't use hyperv stuff. Please provides a patch.
Comment by Andrii Melnykov (zoidberg_md) - Sunday, 10 September 2017, 19:07 GMT
> there is no make install target upstream so they were presumably overlooked.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/hv/hv_get_dhcp_info.sh#n14

# Each Distro is expected to implement this script in a distro specific
# fashion. For instance on Distros that ship with Network Manager enabled,
# this script can be based on the Network Manager APIs for retrieving DHCP
# information.

So they are not installed because they are not supposed to work out of the box.
Comment by Eli Schwartz (eschwartz) - Sunday, 10 September 2017, 19:21 GMT
Actually, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/Makefile#n34

CFLAGS+=" -DKVP_SCRIPTS_PATH=/usr/lib/hypervkvpd/" make -C tools/ hv hv_install should in theory work. At least the kernel Makefile wizardry seems to imply it should work, I'm not positive it was implemented.

At the very least using the tools/ Makefile should simplify the build.
Comment by Eli Schwartz (eschwartz) - Sunday, 10 September 2017, 19:25 GMT
@zoidberg_md,

That sucks horribly, it isn't exactly hard to write a script which is capable of checking a couple information sources. Also Arch lets you pick and choose between different tools available to the Linux community.
Comment by Sébastien Luttringer (seblu) - Sunday, 10 December 2017, 16:28 GMT
Is it better with 4.14-1?
Comment by Andrii Melnykov (zoidberg_md) - Monday, 11 December 2017, 03:25 GMT
No, the messages are the same. Also, it appears to depend on iproute2 (which is in base, but you might want to add it anyway)

The package creates /usr/lib/hyperv/kvpscripts/ folder but it's empty and the scripts are still searched in libexec.

Upd: I did some more testing and found that now, although the messages are displayed, the Hyper-V host displays the ips in the panel if kvm daemon is running, including ipv6
Comment by Sébastien Luttringer (seblu) - Tuesday, 30 January 2018, 01:36 GMT
I have no interest in fixing this. Opinion on removing hypverv from linux-tools or letting it broken?
Comment by Zhongcheng Lao (laozc) - Sunday, 31 March 2019, 06:59 GMT
Uploading a patch to enable three Hyper-V daemons - hv_fcopy_daemon, hv_kvp_daemon, hv_vss_daemon.
The kvp daemons scripts are directly from the upstream.
They are still not altered to match the distro
since it's kind of complicate in Arch Linux that the package for networking may vary.
It is not perfect but does not affect the basic functionality of kvp daemon.

Is it possible to merge it to the current repository?

Thanks.
Comment by Andrii Melnykov (zoidberg_md) - Monday, 01 April 2019, 13:16 GMT
Hi,

hv_kvp_daemon works now without scripts, so this bug can be closed. At least it reports the IP addresses and doesn't say that the scripts were not found.

iproute2 dependency is fine for me.

The .service files are good additions. As for the udev rules, I have no idea why they are needed or how they work, so I can't comment.

Andy
Comment by Zhongcheng Lao (laozc) - Tuesday, 02 April 2019, 03:12 GMT
Hi Andy,

Those udev rules are trying to load the service when a specific integration service is enabled on Hyper-V settings,
in which case a device under /dev/vmbus/* will be created to communicate with Hyper-V VMBus.
These rules are implemented in Azure Linux kernel changes as well.

Those KVP scripts are invoked when receiving requests from VMBus.
They're no longer needed for most of time in a desktop environment.
I'm not sure for a hosted environment like Azure they will be needed somehow which I would need to find out more details.

Thanks,
Zhongcheng

Loading...