Hello community, here is the log from the commit of package biosdevname for openSUSE:Factory checked in at 2016-09-05 21:11:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/biosdevname (Old) and /work/SRC/openSUSE:Factory/.biosdevname.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "biosdevname" Changes: -------- --- /work/SRC/openSUSE:Factory/biosdevname/biosdevname.changes 2016-03-05 13:05:21.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.biosdevname.new/biosdevname.changes 2016-09-05 21:11:10.000000000 +0200 @@ -1,0 +2,7 @@ +Tue Aug 16 14:18:06 UTC 2016 - olaf@aepfle.de + +- Detect dom0 via xenfs instead of cpuid to compensate for ABI + change in xen-4.7 on AMD systems. (bnc#974257) + biosdevname-dom0.patch + +------------------------------------------------------------------- New: ---- biosdevname-dom0.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ biosdevname.spec ++++++ --- /var/tmp/diff_new_pack.musODT/_old 2016-09-05 21:11:13.000000000 +0200 +++ /var/tmp/diff_new_pack.musODT/_new 2016-09-05 21:11:13.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package biosdevname # -# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,7 @@ Patch2: whitelist-dell Patch3: udev-rule-path.patch Patch4: biosdevname-pic.patch +Patch5: biosdevname-dom0.patch BuildRequires: automake # to figure out how to name/location of the rules file BuildRequires: libudev-devel @@ -67,6 +68,7 @@ %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build sed -i -e 's#@@BIOSDEVNAME_RULEDEST@@#'%{_udevrulesdir}'/71-biosdevname.rules#' configure.ac ++++++ biosdevname-dom0.patch ++++++ --- src/bios_dev_name.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) --- a/src/bios_dev_name.c +++ b/src/bios_dev_name.c @@ -133,6 +133,33 @@ cpuid (u_int32_t eax, u_int32_t ecx) } /* + Starting with xen-4.7 cpuid will return with the hypervisor bit set + on AMD systems. This breaks biosdevname and network interface names. + Instead of relying on cpuid check for dom0 in xenfs. +*/ +static int +running_in_dom0(void) +{ + size_t len = 0; +#ifdef __x86_64__ + char buf[16]; + FILE *f = fopen("/proc/xen/capabilities", "r"); + + if (!f) + return 0; + memset(buf, 0, sizeof(buf)); + len = fread(&buf, 1, sizeof(buf) - 1, f); + fclose(f); + while(len && --len && len < sizeof(buf)) { + if (buf[len] == '\n') + buf[len] = '\0'; + } + len = strcmp("control_d", buf) == 0; +#endif + return len; +} + +/* Algorithm suggested by: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */ @@ -144,7 +171,11 @@ running_in_virtual_machine (void) ecx = cpuid (eax, ecx); if (ecx & 0x80000000U) + { + if (running_in_dom0()) + return 0; return 1; + } return 0; }