RE: [PATCH v3] hyperv: simplify and rename generate_guest_id
From: Michael Kelley (LINUX)
Date: Sat Sep 24 2022 - 01:31:44 EST
From: Olaf Hering <olaf@xxxxxxxxx> Sent: Friday, September 23, 2022 2:09 PM
>
> Fri, 23 Sep 2022 19:42:59 +0800 Li kunyu <kunyu@xxxxxxxxxxxx>:
>
> > +++ b/include/asm-generic/mshyperv.h
> > +#include <linux/version.h>
>
> A very long time ago I removed most usage of version.h AFAIR,
> so that changing uname -r will dirty just a tiny amount of objects.
>
> But, this header is always coming back, like bad weed.
>
> Please reconsider the suggested approach.
Could you elaborate? This code is getting the Linux kernel version
to pass to the hypervisor for later diagnostic purposes. In a large
cloud environment like Azure, it's helpful sometimes to be able to
correlate emerging fleet-wide issues to particular kernel versions.
The Hyper-V code in Linux has been using LINUX_VERSION_CODE
this way for the past 10 years, so this isn't new.
Is there a more preferred mechanism for kernel code to get its version?
Michael