Rebase to 3.19-rc3 (20150108 git snapshot)

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
This commit is contained in:
Vitaly Kuznetsov 2015-01-08 19:00:11 +01:00
parent fc05cdf5f6
commit 6abf3a1b64
9 changed files with 40 additions and 106 deletions

View File

@ -5,43 +5,43 @@
# HyperV FCOPY daemon binary name
%global hv_fcopy_daemon hypervfcopyd
# snapshot version
%global snapver .20140714git
%global snapver .20150108git
# use hardened build
%global _hardened_build 1
Name: hyperv-daemons
Version: 0
Release: 0.9%{?snapver}%{?dist}
Release: 0.10%{?snapver}%{?dist}
Summary: HyperV daemons suite
Group: System Environment/Daemons
License: GPLv2
URL: http://www.kernel.org
# Source files obtained from kernel upstream 2014-06-11.
# git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
# Source files obtained from kernel upstream 3.19-rc3 (b1940cd21c0f4abdce101253e860feff547291b0)
# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
# The daemon and scripts are located in "master branch - /tools/hv"
# COPYING -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/COPYING?id=refs/tags/next-20130822
# COPYING -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/COPYING?id=b1940cd21c0f4abdce101253e860feff547291b
Source0: COPYING
# HYPERV KVP DAEMON
# hv_kvp_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_kvp_daemon.c?id=refs/tags/next-20140219
# hv_kvp_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_kvp_daemon.c?id=b1940cd21c0f4abdce101253e860feff547291b0
Source1: hv_kvp_daemon.c
# hv_get_dhcp_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_get_dhcp_info.sh?id=refs/tags/next-20140219
# hv_get_dhcp_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_get_dhcp_info.sh?id=b1940cd21c0f4abdce101253e860feff547291b0
Source2: hv_get_dhcp_info.sh
# hv_get_dns_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_get_dns_info.sh?id=refs/tags/next-20140219
# hv_get_dns_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_get_dns_info.sh?id=b1940cd21c0f4abdce101253e860feff547291b0
Source3: hv_get_dns_info.sh
# hv_set_ifconfig.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_set_ifconfig.sh?id=refs/tags/next-20140219
# hv_set_ifconfig.sh -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_set_ifconfig.sh?id=b1940cd21c0f4abdce101253e860feff547291b0
Source4: hv_set_ifconfig.sh
Source5: hypervkvpd.service
# HYPERV VSS DAEMON
# hv_vss_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_vss_daemon.c?id=refs/tags/next-20140219
# hv_vss_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_vss_daemon.c?id=b1940cd21c0f4abdce101253e860feff547291b0
Source100: hv_vss_daemon.c
Source101: hypervvssd.service
# HYPERV FCOPY DAEMON
# hv_fcopy_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_fcopy_daemon.c?id=refs/tags/next-20140714
# hv_fcopy_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_fcopy_daemon.c?id=b1940cd21c0f4abdce101253e860feff547291b0
Source200: hv_fcopy_daemon.c
Source201: hypervfcopyd.service
@ -51,16 +51,6 @@ Source201: hypervfcopyd.service
Patch0: hypervkvpd-0-corrected_paths_to_external_scripts.patch
# rhbz#872566
Patch1: hypervkvpd-0-long_file_names_from_readdir.patch
# Remove daemon() call and let systemd handle it
Patch2: hypervkvpd-0-dont_call_deamon.patch
# HYPERV VSS DAEMON
# Remove daemon() call and let systemd handle it
Patch100: hypervvssd-0-dont_call_daemon.patch
# HYPERV FCOPY DAEMON
# Remove daemon() call and let systemd handle it
Patch200: hypervfcopyd-0-dont_call_daemon.patch
# HyperV is available only on x86 architectures
@ -156,43 +146,19 @@ cp -pvL %{SOURCE201} hypervfcopyd.service
%patch0 -p1 -b .external_scripts
%patch1 -p1 -b .long_names
%patch2 -p1 -b .daemon
%patch100 -p1 -b .daemon
%patch200 -p1 -b .daemon_fcopy
%build
# HYPERV KVP DAEMON
gcc \
$RPM_OPT_FLAGS \
-c hv_kvp_daemon.c
gcc \
$RPM_LD_FLAGS \
hv_kvp_daemon.o \
-o %{hv_kvp_daemon}
gcc $RPM_OPT_FLAGS -c hv_kvp_daemon.c
gcc $RPM_LD_FLAGS hv_kvp_daemon.o -o %{hv_kvp_daemon}
# HYPERV VSS DAEMON
gcc \
$RPM_OPT_FLAGS \
-c hv_vss_daemon.c
gcc \
$RPM_LD_FLAGS \
hv_vss_daemon.o \
-o %{hv_vss_daemon}
gcc $RPM_OPT_FLAGS -c hv_vss_daemon.c
gcc $RPM_LD_FLAGS hv_vss_daemon.o -o %{hv_vss_daemon}
# HYPERV FCOPY DAEMON
gcc \
$RPM_OPT_FLAGS \
-c hv_fcopy_daemon.c
gcc \
$RPM_LD_FLAGS \
hv_fcopy_daemon.o \
-o %{hv_fcopy_daemon}
gcc $RPM_OPT_FLAGS -c hv_fcopy_daemon.c
gcc $RPM_LD_FLAGS hv_fcopy_daemon.o -o %{hv_fcopy_daemon}
%install
rm -rf %{buildroot}
@ -272,6 +238,10 @@ fi
%doc COPYING
%changelog
* Thu Jan 08 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.10.20150108git
- Rebase to 3.19-rc3 (20150108 git snapshot)
- Drop 'nodaemon' patches, use newly introduced '-n' option
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.9.20140714git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

View File

@ -1,15 +0,0 @@
diff -up ./hv_fcopy_daemon.c.daemon_fcopy ./hv_fcopy_daemon.c
--- ./hv_fcopy_daemon.c.daemon_fcopy 2014-02-19 09:55:20.689982023 +0100
+++ ./hv_fcopy_daemon.c 2014-02-19 09:55:36.700982923 +0100
@@ -131,11 +131,6 @@ int main(void)
char *buffer[4096 * 2];
struct hv_fcopy_hdr *in_msg;
- if (daemon(1, 0)) {
- syslog(LOG_ERR, "daemon() failed; error: %s", strerror(errno));
- exit(EXIT_FAILURE);
- }
-
openlog("HV_FCOPY", 0, LOG_USER);
syslog(LOG_INFO, "HV_FCOPY starting; pid is:%d", getpid());

View File

@ -4,7 +4,7 @@ ConditionVirtualization=microsoft
ConditionPathExists=/dev/vmbus/hv_fcopy
[Service]
ExecStart=/usr/sbin/hypervfcopyd
ExecStart=/usr/sbin/hypervfcopyd -n
[Install]
WantedBy=multi-user.target

View File

@ -1,12 +0,0 @@
diff -up hypervkvpd-0/hv_kvp_daemon.c.daemon hypervkvpd-0/hv_kvp_daemon.c
--- hypervkvpd-0/hv_kvp_daemon.c.daemon 2013-08-09 10:51:41.020041192 +0200
+++ hypervkvpd-0/hv_kvp_daemon.c 2013-08-09 10:53:23.217056215 +0200
@@ -1434,8 +1434,6 @@ int main(void)
char *kvp_recv_buffer;
size_t kvp_recv_buffer_len;
- if (daemon(1, 0))
- return 1;
openlog("KVP", 0, LOG_USER);
syslog(LOG_INFO, "KVP starting; pid is:%d", getpid());

View File

@ -1,29 +1,33 @@
From 396ee697e4d5c7d10bacf6d4670fb4ddab357330 Mon Sep 17 00:00:00 2001
From: Tomas Hozza <thozza@redhat.com>
Date: Mon, 5 Nov 2012 13:56:02 +0100
From 8d7fb2212e93411a8f2a07a9cf6be7325e30f3a4 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Thu, 8 Jan 2015 18:03:46 +0100
Subject: [PATCH] Tools: hv: Fix for long file names from readdir
From: Tomas Hozza <thozza@redhat.com>
kvp_get_if_name and kvp_mac_to_if_name copy strings into statically
sized buffers which could be too small to store really long names.
Buffer sizes have been increased and length checks added via snprintf.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
hv_kvp_daemon.c | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/hv_kvp_daemon.c b/hv_kvp_daemon.c
index 3ea3af2..4c2ab6a 100644
index 6a6432a..138666a 100644
--- a/hv_kvp_daemon.c
+++ b/hv_kvp_daemon.c
@@ -44,6 +44,7 @@
@@ -43,6 +43,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <net/if.h>
+#include <limits.h>
#include <getopt.h>
/*
* KVP protocol: The user mode component first registers with the
@@ -588,26 +589,22 @@ static char *kvp_get_if_name(char *guid)
@@ -603,26 +604,22 @@ static char *kvp_get_if_name(char *guid)
DIR *dir;
struct dirent *entry;
FILE *file;
@ -54,7 +58,7 @@ index 3ea3af2..4c2ab6a 100644
file = fopen(dev_id, "r");
if (file == NULL)
@@ -680,28 +677,23 @@ static char *kvp_mac_to_if_name(char *mac)
@@ -695,28 +692,23 @@ static char *kvp_mac_to_if_name(char *mac)
DIR *dir;
struct dirent *entry;
FILE *file;
@ -88,5 +92,5 @@ index 3ea3af2..4c2ab6a 100644
file = fopen(dev_id, "r");
if (file == NULL)
--
1.7.11.7
1.9.3

View File

@ -4,7 +4,7 @@ ConditionVirtualization=microsoft
[Service]
Type=simple
ExecStart=/usr/sbin/hypervkvpd
ExecStart=/usr/sbin/hypervkvpd -n
[Install]
WantedBy=multi-user.target

View File

@ -1,13 +0,0 @@
diff -up ./hv_vss_daemon.c.daemon ./hv_vss_daemon.c
--- ./hv_vss_daemon.c.daemon 2013-06-26 10:26:42.272419971 +0200
+++ ./hv_vss_daemon.c 2013-06-26 10:27:12.894443174 +0200
@@ -148,9 +148,6 @@ int main(void)
char *vss_recv_buffer;
size_t vss_recv_buffer_len;
- if (daemon(1, 0))
- return 1;
-
openlog("Hyper-V VSS", 0, LOG_USER);
syslog(LOG_INFO, "VSS starting; pid is:%d", getpid());

View File

@ -3,7 +3,7 @@ Description=Hyper-V VSS daemon
ConditionVirtualization=microsoft
[Service]
ExecStart=/usr/sbin/hypervvssd
ExecStart=/usr/sbin/hypervvssd -n
[Install]
WantedBy=multi-user.target

View File

@ -1,7 +1,7 @@
5a1b4a81be9d5bbbf8869976408354e8 hv_get_dhcp_info.sh
dbb5cc7ec83ccc7b1c39458a7521c9b4 hv_get_dns_info.sh
28b370a30d044ebe78fdbcd6d6051f5d hv_kvp_daemon.c
20bb00d2260c7b3c2382aedfe097bffb hv_kvp_daemon.c
da7f77aa7507e950851cbb53673ce5d4 hv_set_ifconfig.sh
18e75bce02aea146307877ebc4e5b45f hv_vss_daemon.c
fd3d834f68ca910ddce8759cfdbdbb9e hv_fcopy_daemon.c
b9d0acb860d0e78f7637193e0af77936 hv_vss_daemon.c
9b67527810671cc62d6057f11c9e2841 hv_fcopy_daemon.c
d7810fab7487fb0aad327b76f1be7cd7 COPYING