Hello community,

here is the log from the commit of package hyper-v.1060 for 
openSUSE:12.2:Update checked in at 2012-11-12 17:58:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.2:Update/hyper-v.1060 (Old)
 and      /work/SRC/openSUSE:12.2:Update/.hyper-v.1060.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hyper-v.1060", Maintainer is ""

Changes:
--------
New Changes file:

--- /dev/null   2012-10-22 00:44:18.403455820 +0200
+++ /work/SRC/openSUSE:12.2:Update/.hyper-v.1060.new/hyper-v.changes    
2012-11-12 17:58:32.000000000 +0100
@@ -0,0 +1,186 @@
+-------------------------------------------------------------------
+Fri Oct 26 17:13:40 CEST 2012 - oher...@suse.de
+
+- update hv_set_ifconfig to work with our ifcfg
+
+-------------------------------------------------------------------
+Sat Oct 13 11:40:30 CEST 2012 - oher...@suse.de
+
+- update hv_kvp_daemon
+  Return the full kernel version
+  Don't return loopback addresses
+
+-------------------------------------------------------------------
+Thu Oct  4 15:14:05 CEST 2012 - oher...@suse.de
+
+- bump to version 4
+- update kv_kvp_daemon to 3.7-rc1 state [fate#314441]
+  support KVP IP Injection, helper scripts go to /usr/lib/hyper-v/bin:
+  hv_get_dhcp_info, hv_get_dns_info, hv_set_ifconfig
+- remove usage of absolute paths in runlevel script
+
+-------------------------------------------------------------------
+Tue Sep  4 14:55:38 CEST 2012 - oher...@suse.de
+
+- remove restart_on_update in postun section
+  the daemon can not be restarted at this point, and the new daemon
+  may not be 100 percent compatible with the currently running
+  kernel [bnc#770763]
+
+-------------------------------------------------------------------
+Wed May 16 20:44:36 CEST 2012 - oher...@suse.de
+
+- check origin of netlink messages, use recvfrom() [bnc#761200]
+
+-------------------------------------------------------------------
+Wed May  2 12:13:03 CEST 2012 - oher...@suse.de
+
+- update insserv part, see comments in OBS submit request #112701
+
+-------------------------------------------------------------------
+Tue Mar 27 08:50:43 CEST 2012 - oher...@suse.de
+
+- add kvptest.ps1.txt to docs, a PowerShell script to verify KVP
+
+-------------------------------------------------------------------
+Mon Mar 26 19:05:48 CEST 2012 - oher...@suse.de
+
+- update hv_kvp_daemon to 3.4-rc1 state
+  use a copy linux/hyperv.h to compile the daemon
+
+-------------------------------------------------------------------
+Thu Dec  8 17:46:21 CET 2011 - oher...@suse.de
+
+- do not package modprobe.conf rule in main package
+  prevents loading of ata_piix which is required for cdrom access
+
+-------------------------------------------------------------------
+Fri Nov 18 21:49:57 CET 2011 - oher...@suse.de
+
+- add Supplements to install package if dmi matches [bnc#731198]
+
+-------------------------------------------------------------------
+Thu Sep  1 18:51:03 CEST 2011 - oher...@suse.de
+
+- disable hyper-v-kmp
+  hv_storvsc handles now IDE and SCSI disks and ata_piix is
+  compiled into the kernel in SLE12, so the modprobe.conf rules
+  have no meaning anymore
+
+-------------------------------------------------------------------
+Tue Jul 26 21:24:25 CEST 2011 - oher...@suse.de
+
+- update hv_kvp_daemon: Cleanup kvp_get_domain_name(). If
+  getaddrinfo() fails, deal with it properly (this can happen if no
+  IP address has been assigned).  Also, don't specify a specific
+  service in the call to getaddrinfo() to make this code as generic
+  as possible.
+
+-------------------------------------------------------------------
+Sun Jul 24 17:22:41 CEST 2011 - oher...@suse.de
+
+- update hv_kvp_daemon: The current win7 host does not like it when
+  we return the complete kernel release information. Conform to
+  what the host expects.
+
+-------------------------------------------------------------------
+Fri Jun 17 15:41:33 CEST 2011 - oher...@suse.de
+
+- update preun, stop_on_removal requires an argument
+
+-------------------------------------------------------------------
+Fri Jun 17 11:09:30 CEST 2011 - oher...@suse.de
+
+- remove get_release_number.sh, which was added by accident
+- bump version number to 2
+
+-------------------------------------------------------------------
+Fri Jun 17 10:58:42 CEST 2011 - oher...@suse.de
+
+- catch errors from daemon()
+
+-------------------------------------------------------------------
+Fri Jun 17 10:33:50 CEST 2011 - oher...@suse.de
+
+- update postun to run restart_on_update
+- use rpmmacro for daemon name
+
+-------------------------------------------------------------------
+Fri Jun 17 08:10:12 CEST 2011 - oher...@suse.de
+
+- update postin to work in / again when running insserv macro
+
+-------------------------------------------------------------------
+Thu Jun 16 15:33:49 CEST 2011 - oher...@suse.de
+
+- Update version number to 1 so kernel.rpm can obsolete
+  the old kmp packages
+
+-------------------------------------------------------------------
+Thu Jun 16 11:12:06 CEST 2011 - oher...@suse.de
+
+- enable hv_kvp_daemon if run in a hv guest [fate#312213]
+
+-------------------------------------------------------------------
+Thu Apr 21 17:18:20 CEST 2011 - oher...@suse.de
+
+- add hv_kvp_daemon to provide system infos to hypervisor [bnc#685189] 
+  this enables the hyper-v main package
+
+-------------------------------------------------------------------
+Sat Apr 16 15:13:36 CEST 2011 - oher...@suse.de
+
+- Require at least kernel-default 2.6.32.27 for an empty KMP.
+
+-------------------------------------------------------------------
+Fri Apr 15 16:50:25 CEST 2011 - oher...@suse.de
+
+- actually keep the KMP packages with just the modprobe.conf file
+
+-------------------------------------------------------------------
+Thu Mar 31 11:24:03 CEST 2011 - oher...@suse.de
+
+- make building of kernel modules optional [bnc#676890]
+  the hv*.ko drivers exist in two places, kernel-default and this
+  KMP package. Both can get out of sync, then mkinitrd will use
+  (the possible outdated) drivers from this KMP package.
+  disable building drivers per default, keep only the
+  hyperv_pvdrivers.conf
+- mark hyperv_pvdrivers.conf as config to preserve local
+  modifications done by the sysadmin
+
+-------------------------------------------------------------------
+Thu Feb 24 12:09:25 CET 2011 - meiss...@suse.de
+
+- also add hv_timesource to Modules.supported [bnc#650748]
+
+-------------------------------------------------------------------
+Tue Jan  4 10:28:21 CET 2011 - meiss...@suse.de
+
+- add hv_utils to Modules.supported [bnc#650748]
+
+-------------------------------------------------------------------
+Wed Apr 28 11:40:33 CEST 2010 - ku...@suse.de
+
+- Next update of hyperv_pvdrivers.conf [bnc#600212]
+
+-------------------------------------------------------------------
+Tue Apr 27 13:20:55 CEST 2010 - ku...@suse.de
+
+- hyperv_pvdrivers.conf: fix syntax error
+
+-------------------------------------------------------------------
+Tue Apr 27 07:10:05 CEST 2010 - ksriniva...@novell.com
+
+- Update hyperv_pvdrivers.conf config file 
+
+-------------------------------------------------------------------
+Mon Apr 26 18:15:40 CEST 2010 - ku...@suse.de
+
+- Add hyperv_pvdrivers.conf modprobe config file
+
+-------------------------------------------------------------------
+Fri Mar  5 13:40:56 CET 2010 - mma...@suse.cz
+
+- Packaged drivers/staging/hv as a standalone KMP (bnc#585651).
+

New:
----
  Module.supported
  full-kernel-version.patch
  hyper-v.changes
  hyper-v.dummy_ko.c
  hyper-v.include.linux.hyperv.h
  hyper-v.init.sh
  hyper-v.kvptest.ps1.txt
  hyper-v.spec
  hyper-v.supplements.txt
  hyper-v.tools.hv.hv_get_dhcp_info.sh
  hyper-v.tools.hv.hv_get_dns_info.sh
  hyper-v.tools.hv.hv_kvp_daemon.c
  hyper-v.tools.hv.hv_set_ifconfig.sh
  hyperv_pvdrivers.conf
  kmp_filelist
  no-loopback.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hyper-v.spec ++++++
#
# spec file for package hyper-v
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define with_kmp 0
%define with_modprobe 0
%if %{with_kmp}
%define with_drivers_in_kmp 0
%endif
%define hv_kvp_daemon hv_kvp_daemon

Name:           hyper-v
%if %{with_kmp}
BuildRequires:  kernel-default-devel
BuildRequires:  module-init-tools
%ifarch %ix86
BuildRequires:  kernel-pae-devel
%endif
%endif
ExclusiveArch:  %ix86 x86_64
PreReq:         %insserv_prereq
Summary:        Microsoft Hyper-V tools
License:        GPL-2.0
Group:          System/Kernel
Supplements:    
modalias(dmi*:svn*MicrosoftCorporation*:pn*VirtualMachine*:rn*VirtualMachine*)
Supplements:    modalias(pci:v00001414d00005353sv*sd*bc*sc*i*)
Url:            http://www.kernel.org
Version:        4
Release:        0
Source:         Module.supported
Source1:        hyperv_pvdrivers.conf
Source2:        kmp_filelist
Source3:        hyper-v.supplements.txt
Source4:        hyper-v.dummy_ko.c
Source5:        hyper-v.kvptest.ps1.txt
Source9:        hyper-v.include.linux.hyperv.h
Source10:       hyper-v.tools.hv.hv_kvp_daemon.c
Source11:       hyper-v.init.sh
Source20:       hyper-v.tools.hv.hv_get_dhcp_info.sh
Source21:       hyper-v.tools.hv.hv_get_dns_info.sh
Source22:       hyper-v.tools.hv.hv_set_ifconfig.sh
Patch0:         full-kernel-version.patch
Patch1:         no-loopback.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{with_kmp}
%if %{with_drivers_in_kmp}
%suse_kernel_module_package -n hyper-v um xen  -f kmp_filelist
%else
%suse_kernel_module_package -n hyper-v um xen  -f kmp_filelist -p 
hyper-v.supplements.txt
%endif
%endif

%description
This package contains the Microsoft Hyper-V tools.



%if %{with_kmp}

%package KMP

Summary:        Microsoft Hyper-V drivers
Group:          System/Kernel

%description KMP
This package contains the Microsoft Hyper-V drivers.



%endif

%prep
%setup -Tc
cp -avL %{S:5} kvptest.ps1.txt
cp -vL %{S:9} %{hv_kvp_daemon}.h
cp -vL %{S:10} %{hv_kvp_daemon}.c
%patch0 -p3 
%patch1 -p3 

%build
sed -i~ '/#include <linux.hyperv.h>/d' %{hv_kvp_daemon}.c
gcc \
        $RPM_OPT_FLAGS \
        -Wno-unused-variable \
        -Wno-pointer-sign \
        -g \
        %{hv_kvp_daemon}.c \
        -include %{hv_kvp_daemon}.h \
        -DCN_KVP_IDX=0x9 \
        -DCN_KVP_VAL=0x1 \
        -o %{hv_kvp_daemon}
%if %{with_kmp}
for flavor in %flavors_to_build; do
%if %{with_drivers_in_kmp}
    krel=$(make -s -C %{kernel_source $flavor} kernelrelease)
    cp -a /lib/modules/$krel/source/drivers/staging/hv $flavor
%else
    rm -rfv $flavor
    mkdir -p $flavor
    cp %_sourcedir/hyper-v.dummy_ko.c $flavor/hyper-v.suse_kmp_dummy.c
    cat > $flavor/Makefile <<-EOF
obj-m += hyper-v.suse_kmp_dummy.o
EOF
%endif
    cp %_sourcedir/Module.supported $flavor
    make -C %{kernel_source $flavor} modules M=$PWD/$flavor
done
%endif

%install
%if %{with_kmp}
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
for flavor in %flavors_to_build; do
    make -C %{kernel_source $flavor} modules_install M=$PWD/$flavor
done
%endif
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -m755 %{hv_kvp_daemon} $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/usr/lib/%{name}/bin
cp -avL %{S:20} $RPM_BUILD_ROOT/usr/lib/%{name}/bin/hv_get_dhcp_info
cp -avL %{S:21} $RPM_BUILD_ROOT/usr/lib/%{name}/bin/hv_get_dns_info
cp -avL %{S:22} $RPM_BUILD_ROOT/usr/lib/%{name}/bin/hv_set_ifconfig
chmod 755 $RPM_BUILD_ROOT/usr/lib/%{name}/bin/*
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m755 %{S:11} $RPM_BUILD_ROOT/etc/init.d/%{hv_kvp_daemon}
ln -sfvbn ../../etc/init.d/%{hv_kvp_daemon} 
$RPM_BUILD_ROOT/usr/sbin/rc%{hv_kvp_daemon}
%if %{with_modprobe}
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -m644 %SOURCE1 $RPM_BUILD_ROOT/etc/modprobe.d/hyperv_pvdrivers.conf
%endif

%files
%defattr (-,root,root)
%doc kvptest.ps1.txt
%if %{with_modprobe}
%if !%{with_kmp}
%dir /etc/modprobe.d
%config /etc/modprobe.d/hyperv_pvdrivers.conf
%endif
%endif
/etc/init.d/%{hv_kvp_daemon}
/usr/sbin/rc%{hv_kvp_daemon}
/usr/sbin/%{hv_kvp_daemon}
/usr/lib/%{name}

%post
board_vendor=
product_name=
if pushd /sys/class/dmi/id > /dev/null 2>/dev/null
then
        if test -r board_vendor
        then
                board_vendor="`cat board_vendor`"
        fi
        if test -r product_name
        then
                product_name="`cat product_name`"
        fi
        popd > /dev/null
fi
if test "${board_vendor}" = "Microsoft Corporation" -a "${product_name}" = 
"Virtual Machine"
then
        echo "Enabling %{hv_kvp_daemon} on '${product_name}' from 
'${board_vendor}'"
        %{insserv_force_if_yast %{hv_kvp_daemon}}
fi

%preun
%stop_on_removal %{hv_kvp_daemon}

%postun
# no restart on update because the daemon can not be restarted
%insserv_cleanup

%changelog
++++++ Module.supported ++++++
drivers/staging/hv/hv_blkvsc external
drivers/staging/hv/hv_netvsc external
drivers/staging/hv/hv_storvsc external
drivers/staging/hv/hv_timesource external
drivers/staging/hv/hv_utils external
drivers/staging/hv/hv_vmbus external

++++++ full-kernel-version.patch ++++++
From: "K. Y. Srinivasan" <k...@microsoft.com>
Subject: [PATCH 1/1] tools: hv: Return the full kernel version
Date: Fri, 12 Oct 2012 16:40:10 -0700
Message-Id: <1350085210-11108-1-git-send-email-...@microsoft.com>

Currently, we are returning the same string for both OSBuildNumber 
and OSVersion keys. Return the full uts string for the OSBuild
key since Windows does not impose any restrictions on this. 

Signed-off-by: K. Y. Srinivasan <k...@microsoft.com>
Reviewed-by: Haiyang Zhang <haiya...@microsoft.com>
Reported-by: Claudio Latini <claudio.lat...@live.com>
---
 tools/hv/hv_kvp_daemon.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 5959aff..6c7bcb9 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -88,6 +88,7 @@ static char *os_major = "";
 static char *os_minor = "";
 static char *processor_arch;
 static char *os_build;
+static char *os_version;
 static char *lic_version = "Unknown version";
 static struct utsname uts_buf;
 
@@ -453,7 +454,9 @@ void kvp_get_os_info(void)
        char    *p, buf[512];
 
        uname(&uts_buf);
-       os_build = uts_buf.release;
+       os_version = uts_buf.release;
+       os_build = strdup(uts_buf.release);
+
        os_name = uts_buf.sysname;
        processor_arch = uts_buf.machine;
 
@@ -462,7 +465,7 @@ void kvp_get_os_info(void)
         * string to be of the form: x.y.z
         * Strip additional information we may have.
         */
-       p = strchr(os_build, '-');
+       p = strchr(os_version, '-');
        if (p)
                *p = '\0';
 
@@ -1649,7 +1652,7 @@ int main(void)
                        strcpy(key_name, "OSMinorVersion");
                        break;
                case OSVersion:
-                       strcpy(key_value, os_build);
+                       strcpy(key_value, os_version);
                        strcpy(key_name, "OSVersion");
                        break;
                case ProcessorArchitecture:
-- 
1.7.4.1

++++++ hyper-v.dummy_ko.c ++++++
#include <linux/init.h>
#include <linux/module.h>

static int __init hv_suse_kmp_dummy_init(void)
{
        return 0;
}

static void __exit hv_suse_kmp_dummy_exit(void)
{
}

module_init(hv_suse_kmp_dummy_init);
module_exit(hv_suse_kmp_dummy_exit);
MODULE_LICENSE("GPL");
++++++ hyper-v.include.linux.hyperv.h ++++++
++++ 1154 lines (skipped)

++++++ hyper-v.init.sh ++++++
#!/bin/sh
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO
# Provides:          hv_kvp_daemon
# Required-Start:    $null
# Should-Start:      $syslog $remote_fs $time
# Required-Stop:     $null
# Should-Stop:       $syslog $remote_fs $time
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: hv_kvp_daemon provides info to the host
# Description:       Start hv_kvp_daemon to allow the host to query this guest
### END INIT INFO

# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
HV_KVP_BIN=/usr/sbin/hv_kvp_daemon
test -x $HV_KVP_BIN || { echo "$HV_KVP_BIN not installed"; 
        if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }

. /etc/rc.status

# Reset status of this service
rc_reset

case "$1" in
    start)
        echo -n "Starting Hyper-V KVP daemon "
        env PATH=/usr/lib/hyper-v/bin:$PATH \
        startproc $HV_KVP_BIN
        rc_status -v
        ;;
    stop)
        echo -n "Shutting down Hyper-V KVP daemon "
        killproc -TERM $HV_KVP_BIN
        rc_status -v
        ;;
    try-restart|condrestart)
        if test "$1" = "condrestart"; then
                echo "${attn} Use try-restart ${done}(LSB)${attn} rather than 
condrestart ${warn}(RH)${norm}"
        fi
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        # Remember status and be quiet
        rc_status
        ;;
    restart)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    force-reload)
        echo -n "Reload service Hyper-V KVP daemon "
        $0 try-restart
        rc_status
        ;;
    reload)
        rc_failed 3
        rc_status -v
        ;;
    status)
        echo -n "Checking for service Hyper-V KVP daemon "
        checkproc $HV_KVP_BIN
        rc_status -v
        ;;
    *)
        echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload}"
        exit 1
        ;;
esac
rc_exit
++++++ hyper-v.kvptest.ps1.txt ++++++
# Windows PowerShell script to test Key Value Pair functionality
#
# 
http://blogs.msdn.com/b/virtual_pc_guy/archive/2008/11/18/hyper-v-script-looking-at-kvp-guestintrinsicexchangeitems.aspx
#
# Per default execution of scripts is disabled.
# http://technet.microsoft.com/en-us/library/ee176949.aspx
# The command 'Set-ExecutionPolicy RemoteSigned' will enable it.
#
# Filter for parsing XML data
filter Import-CimXml
{
   # Create new XML object from input
   $CimXml = [Xml]$_
   $CimObj = New-Object -TypeName System.Object

   # Iterate over the data and pull out just the value name and data for each 
entry
   foreach ($CimProperty in 
$CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Name']"))
      {
         $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME 
-Value $CimProperty.VALUE
      }

   foreach ($CimProperty in 
$CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Data']"))
      {
         $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME 
-Value $CimProperty.VALUE
      }

   # Display output
   $CimObj
}

# Prompt for the Hyper-V Server to use
$HyperVServer = Read-Host "Specify the Hyper-V Server to use (enter '.' for the 
local computer)"

# Prompt for the virtual machine to use
$VMName = Read-Host "Specify the name of the virtual machine"

# Get the virtual machine object
$query = "Select * From Msvm_ComputerSystem Where ElementName='" + $VMName + "'"
$Vm = gwmi -namespace root\virtualization -query $query -computername 
$HyperVServer

# Get the KVP Object
$query = "Associators of {$Vm} Where AssocClass=Msvm_SystemDevice 
ResultClass=Msvm_KvpExchangeComponent"
$Kvp = gwmi -namespace root\virtualization -query $query -computername 
$HyperVServer

Write-Host
Write-Host "Guest KVP information for" $VMName

# Filter the results
$Kvp.GuestIntrinsicExchangeItems | Import-CimXml
++++++ hyper-v.supplements.txt ++++++
# if built without drivers
Supplements: 
modalias(kernel-default:dmi*:svn*MicrosoftCorporation*:pn*VirtualMachine*:rn*VirtualMachine*:)
 modalias(kernel-default:pci:v00001414d00005353sv*sd*bc*sc*i*)
# hv drivers were enabled in the middle of the update cycle
# Its Microsoft. It must be a mess. ...
Requires: kernel-%1 >= 2.6.32.27
++++++ hyper-v.tools.hv.hv_get_dhcp_info.sh ++++++
#!/bin/bash

# This example script retrieves the DHCP state of a given interface.
# In the interest of keeping the KVP daemon code free of distro specific
# information; the kvp daemon code invokes this external script to gather
# DHCP setting for the specific interface.
#
# Input: Name of the interface
#
# Output: The script prints the string "Enabled" to stdout to indicate
#       that DHCP is enabled on the interface. If DHCP is not enabled,
#       the script prints the string "Disabled" to stdout.
#
# 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.

if_file="/etc/sysconfig/network-scripts/ifcfg-"$1

dhcp=$(grep "dhcp" $if_file 2>/dev/null)

if [ "$dhcp" != "" ];
then
echo "Enabled"
else
echo "Disabled"
fi
++++++ hyper-v.tools.hv.hv_get_dns_info.sh ++++++
#!/bin/bash

# This example script parses /etc/resolv.conf to retrive DNS information.
# In the interest of keeping the KVP daemon code free of distro specific
# information; the kvp daemon code invokes this external script to gather
# DNS information.
# This script is expected to print the nameserver values to stdout.
# 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 DNS
# entries.

cat /etc/resolv.conf 2>/dev/null | awk '/^nameserver/ { print $2 }'
++++++ hyper-v.tools.hv.hv_kvp_daemon.c ++++++
++++ 1682 lines (skipped)

++++++ hyper-v.tools.hv.hv_set_ifconfig.sh ++++++
#!/bin/bash
#
# In the interest of keeping the KVP daemon code free of distro specific
# information; the kvp daemon code invokes this external script to configure
# the interface.
#
# The only argument to this script is the configuration file that is to
# be used to configure the interface.
#
# Here is the format of the ip configuration file:
#
# HWADDR=macaddr
# IF_NAME=interface name
# DHCP=yes (This is optional; if yes, DHCP is configured)
#
# IPADDR=ipaddr1
# IPADDR_1=ipaddr2
# IPADDR_x=ipaddry (where y = x + 1)
#
# NETMASK=netmask1
# NETMASK_x=netmasky (where y = x + 1)
#
# GATEWAY=ipaddr1
# GATEWAY_x=ipaddry (where y = x + 1)
#
# DNSx=ipaddrx (where first DNS address is tagged as DNS1 etc)
#
# IPV6 addresses will be tagged as IPV6ADDR, IPV6 gateway will be
# tagged as IPV6_DEFAULTGW and IPV6 NETMASK will be tagged as
# IPV6NETMASK.
#
# The host can specify multiple ipv4 and ipv6 addresses to be
# configured for the interface. Furthermore, the configuration
# needs to be persistent. A subsequent GET call on the interface
# is expected to return the configuration that is set via the SET
# call.
#
cfg=$1
if ! test -f "${cfg}"
then
        : expect configuration datafile as first argument
        exit 1
fi
#
(
unset DHCP
unset IF_NAME
. "$1"
if test -z "${IF_NAME}"
then
        echo "Missing IF_NAME= in ${cfg}"
        exit 1
fi
#
t=`mktemp`
if test -z "${t}"
then
        exit 1
fi

_exit() {
        rm -f "${t}"
}
trap _exit EXIT
#
cat >> "${t}" <<_EOF_
# contents from $0 $*
`cat "${cfg}"`
#
# additional options:
STARTMODE=auto
_EOF_

if test "${DHCP}" = "yes"
then
        echo "BOOTPROTO=dhcp" >> ${t};
fi

echo "$0: working on network interface ifcfg-${IF_NAME}"
cp -b ${t} /etc/sysconfig/network/ifcfg-${IF_NAME}
ifdown ${IF_NAME} -o hotplug
ifup ${IF_NAME} -o hotplug
) 2>&1 | logger -t "${0##*/}[$PPID / $$]"
++++++ hyperv_pvdrivers.conf ++++++
# Install HyperV paravirtualized drivers
install ide_core  /sbin/modprobe hv_blkvsc 2>&1 ; /sbin/modprobe 
--ignore-install ide_core 

install ata_piix  { /sbin/modprobe hv_blkvsc 2>&1 || /sbin/modprobe 
--ignore-install ata_piix; }

++++++ kmp_filelist ++++++
%defattr (-,root,root)
/lib/modules/%2-%1
%config /etc/modprobe.d/hyperv_pvdrivers.conf
++++++ no-loopback.patch ++++++
From: "K. Y. Srinivasan" <k...@microsoft.com>
Subject: [PATCH 1/1] Tools: hv: Don't return loopback addresses
Date: Fri, 12 Oct 2012 16:41:48 -0700
Message-Id: <1350085308-11152-1-git-send-email-...@microsoft.com>

Don't return loopback addresses and further don't terminate
the IP address strings with a semicolon. This is the current
behavior of Windows guests.

Signed-off-by: K. Y. Srinivasan <k...@microsoft.com>
Reviewed-by: Haiyang Zhang <haiya...@microsoft.com>
Reported-by: Claudio Latini <claudio.lat...@live.com>
---
 tools/hv/hv_kvp_daemon.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 6c7bcb9..13c2a14 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -43,6 +43,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <dirent.h>
+#include <net/if.h>
 
 /*
  * KVP protocol: The user mode component first registers with the
@@ -882,7 +883,7 @@ static int kvp_process_ip_address(void *addrp,
                addr_length = INET6_ADDRSTRLEN;
        }
 
-       if ((length - *offset) < addr_length + 1)
+       if ((length - *offset) < addr_length + 2)
                return HV_E_FAIL;
        if (str == NULL) {
                strcpy(buffer, "inet_ntop failed\n");
@@ -890,11 +891,13 @@ static int kvp_process_ip_address(void *addrp,
        }
        if (*offset == 0)
                strcpy(buffer, tmp);
-       else
+       else {
+               strcat(buffer, ";");
                strcat(buffer, tmp);
-       strcat(buffer, ";");
+       }
 
        *offset += strlen(str) + 1;
+
        return 0;
 }
 
@@ -956,7 +959,9 @@ kvp_get_ip_info(int family, char *if_name, int op,
                 * supported address families; if not we gather info on
                 * the specified address family.
                 */
-               if ((family != 0) && (curp->ifa_addr->sa_family != family)) {
+               if ((((family != 0) &&
+                        (curp->ifa_addr->sa_family != family))) ||
+                        (curp->ifa_flags & IFF_LOOPBACK)) {
                        curp = curp->ifa_next;
                        continue;
                }
-- 
1.7.4.1

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to