commit
92ec98a0c7
@ -0,0 +1,24 @@
|
||||
From 88be69d62a01b9ac233de7f68118c948623c6f0a Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Thu, 14 Nov 2019 09:45:44 +0100
|
||||
Subject: Do not set NM_CONTROLLED=no
|
||||
|
||||
---
|
||||
hv_set_ifconfig.sh | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh
|
||||
index 7ed9f85..18b27cc 100644
|
||||
--- a/hv_set_ifconfig.sh
|
||||
+++ b/hv_set_ifconfig.sh
|
||||
@@ -51,7 +51,6 @@
|
||||
|
||||
|
||||
echo "IPV6INIT=yes" >> $1
|
||||
-echo "NM_CONTROLLED=no" >> $1
|
||||
echo "PEERDNS=yes" >> $1
|
||||
echo "ONBOOT=yes" >> $1
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,345 @@
|
||||
From f20c2a3298ceae7536c06bd08a5c571ebfa8cce4 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Thu, 6 May 2021 12:50:43 +0200
|
||||
Subject: Update C files and scripts to kernel version 5.7-rc1
|
||||
|
||||
(cherry-picked from RHEL 8.4.0 commit b0a20fac0e74b0b3eecc20ffe74006e7877da352)
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
---
|
||||
hv_fcopy_daemon.c | 37 +++++++++++++++++++++++++++++++-----
|
||||
hv_get_dhcp_info.sh | 2 +-
|
||||
hv_kvp_daemon.c | 35 ++++++++++++++++++++--------------
|
||||
hv_set_ifconfig.sh | 2 +-
|
||||
hv_vss_daemon.c | 46 ++++++++++++++++++++++++++++++++++-----------
|
||||
5 files changed, 90 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/hv_fcopy_daemon.c b/hv_fcopy_daemon.c
|
||||
index aea2d91..16d629b 100644
|
||||
--- a/hv_fcopy_daemon.c
|
||||
+++ b/hv_fcopy_daemon.c
|
||||
@@ -80,6 +80,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
|
||||
|
||||
error = 0;
|
||||
done:
|
||||
+ if (error)
|
||||
+ target_fname[0] = '\0';
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -108,15 +110,29 @@ static int hv_copy_data(struct hv_do_fcopy *cpmsg)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Reset target_fname to "" in the two below functions for hibernation: if
|
||||
+ * the fcopy operation is aborted by hibernation, the daemon should remove the
|
||||
+ * partially-copied file; to achieve this, the hv_utils driver always fakes a
|
||||
+ * CANCEL_FCOPY message upon suspend, and later when the VM resumes back,
|
||||
+ * the daemon calls hv_copy_cancel() to remove the file; if a file is copied
|
||||
+ * successfully before suspend, hv_copy_finished() must reset target_fname to
|
||||
+ * avoid that the file can be incorrectly removed upon resume, since the faked
|
||||
+ * CANCEL_FCOPY message is spurious in this case.
|
||||
+ */
|
||||
static int hv_copy_finished(void)
|
||||
{
|
||||
close(target_fd);
|
||||
+ target_fname[0] = '\0';
|
||||
return 0;
|
||||
}
|
||||
static int hv_copy_cancel(void)
|
||||
{
|
||||
close(target_fd);
|
||||
- unlink(target_fname);
|
||||
+ if (strlen(target_fname) > 0) {
|
||||
+ unlink(target_fname);
|
||||
+ target_fname[0] = '\0';
|
||||
+ }
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -131,7 +147,7 @@ void print_usage(char *argv[])
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
- int fcopy_fd;
|
||||
+ int fcopy_fd = -1;
|
||||
int error;
|
||||
int daemonize = 1, long_index = 0, opt;
|
||||
int version = FCOPY_CURRENT_VERSION;
|
||||
@@ -141,7 +157,7 @@ int main(int argc, char *argv[])
|
||||
struct hv_do_fcopy copy;
|
||||
__u32 kernel_modver;
|
||||
} buffer = { };
|
||||
- int in_handshake = 1;
|
||||
+ int in_handshake;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"help", no_argument, 0, 'h' },
|
||||
@@ -170,6 +186,12 @@ int main(int argc, char *argv[])
|
||||
openlog("HV_FCOPY", 0, LOG_USER);
|
||||
syslog(LOG_INFO, "starting; pid is:%d", getpid());
|
||||
|
||||
+reopen_fcopy_fd:
|
||||
+ if (fcopy_fd != -1)
|
||||
+ close(fcopy_fd);
|
||||
+ /* Remove any possible partially-copied file on error */
|
||||
+ hv_copy_cancel();
|
||||
+ in_handshake = 1;
|
||||
fcopy_fd = open("/dev/vmbus/hv_fcopy", O_RDWR);
|
||||
|
||||
if (fcopy_fd < 0) {
|
||||
@@ -196,7 +218,7 @@ int main(int argc, char *argv[])
|
||||
len = pread(fcopy_fd, &buffer, sizeof(buffer), 0);
|
||||
if (len < 0) {
|
||||
syslog(LOG_ERR, "pread failed: %s", strerror(errno));
|
||||
- exit(EXIT_FAILURE);
|
||||
+ goto reopen_fcopy_fd;
|
||||
}
|
||||
|
||||
if (in_handshake) {
|
||||
@@ -231,9 +253,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * pwrite() may return an error due to the faked CANCEL_FCOPY
|
||||
+ * message upon hibernation. Ignore the error by resetting the
|
||||
+ * dev file, i.e. closing and re-opening it.
|
||||
+ */
|
||||
if (pwrite(fcopy_fd, &error, sizeof(int), 0) != sizeof(int)) {
|
||||
syslog(LOG_ERR, "pwrite failed: %s", strerror(errno));
|
||||
- exit(EXIT_FAILURE);
|
||||
+ goto reopen_fcopy_fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/hv_get_dhcp_info.sh b/hv_get_dhcp_info.sh
|
||||
index c38686c..2f2a3c7 100644
|
||||
--- a/hv_get_dhcp_info.sh
|
||||
+++ b/hv_get_dhcp_info.sh
|
||||
@@ -13,7 +13,7 @@
|
||||
# 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,
|
||||
+# 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.
|
||||
|
||||
diff --git a/hv_kvp_daemon.c b/hv_kvp_daemon.c
|
||||
index e9ef4ca..0e5f14a 100644
|
||||
--- a/hv_kvp_daemon.c
|
||||
+++ b/hv_kvp_daemon.c
|
||||
@@ -76,7 +76,7 @@ enum {
|
||||
DNS
|
||||
};
|
||||
|
||||
-static int in_hand_shake = 1;
|
||||
+static int in_hand_shake;
|
||||
|
||||
static char *os_name = "";
|
||||
static char *os_major = "";
|
||||
@@ -1360,7 +1360,7 @@ void print_usage(char *argv[])
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
- int kvp_fd, len;
|
||||
+ int kvp_fd = -1, len;
|
||||
int error;
|
||||
struct pollfd pfd;
|
||||
char *p;
|
||||
@@ -1400,14 +1400,6 @@ int main(int argc, char *argv[])
|
||||
openlog("KVP", 0, LOG_USER);
|
||||
syslog(LOG_INFO, "KVP starting; pid is:%d", getpid());
|
||||
|
||||
- kvp_fd = open("/dev/vmbus/hv_kvp", O_RDWR | O_CLOEXEC);
|
||||
-
|
||||
- if (kvp_fd < 0) {
|
||||
- syslog(LOG_ERR, "open /dev/vmbus/hv_kvp failed; error: %d %s",
|
||||
- errno, strerror(errno));
|
||||
- exit(EXIT_FAILURE);
|
||||
- }
|
||||
-
|
||||
/*
|
||||
* Retrieve OS release information.
|
||||
*/
|
||||
@@ -1423,6 +1415,18 @@ int main(int argc, char *argv[])
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
+reopen_kvp_fd:
|
||||
+ if (kvp_fd != -1)
|
||||
+ close(kvp_fd);
|
||||
+ in_hand_shake = 1;
|
||||
+ kvp_fd = open("/dev/vmbus/hv_kvp", O_RDWR | O_CLOEXEC);
|
||||
+
|
||||
+ if (kvp_fd < 0) {
|
||||
+ syslog(LOG_ERR, "open /dev/vmbus/hv_kvp failed; error: %d %s",
|
||||
+ errno, strerror(errno));
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Register ourselves with the kernel.
|
||||
*/
|
||||
@@ -1457,8 +1461,7 @@ int main(int argc, char *argv[])
|
||||
syslog(LOG_ERR, "read failed; error:%d %s",
|
||||
errno, strerror(errno));
|
||||
|
||||
- close(kvp_fd);
|
||||
- return EXIT_FAILURE;
|
||||
+ goto reopen_kvp_fd;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1617,13 +1620,17 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
}
|
||||
|
||||
- /* Send the value back to the kernel. */
|
||||
+ /*
|
||||
+ * Send the value back to the kernel. Note: the write() may
|
||||
+ * return an error due to hibernation; we can ignore the error
|
||||
+ * by resetting the dev file, i.e. closing and re-opening it.
|
||||
+ */
|
||||
kvp_done:
|
||||
len = write(kvp_fd, hv_msg, sizeof(struct hv_kvp_msg));
|
||||
if (len != sizeof(struct hv_kvp_msg)) {
|
||||
syslog(LOG_ERR, "write failed; error: %d %s", errno,
|
||||
strerror(errno));
|
||||
- exit(EXIT_FAILURE);
|
||||
+ goto reopen_kvp_fd;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh
|
||||
index 18b27cc..3dd064c 100644
|
||||
--- a/hv_set_ifconfig.sh
|
||||
+++ b/hv_set_ifconfig.sh
|
||||
@@ -12,7 +12,7 @@
|
||||
# be used to configure the interface.
|
||||
#
|
||||
# Each Distro is expected to implement this script in a distro specific
|
||||
-# fashion. For instance on Distros that ship with Network Manager enabled,
|
||||
+# fashion. For instance, on Distros that ship with Network Manager enabled,
|
||||
# this script can be based on the Network Manager APIs for configuring the
|
||||
# interface.
|
||||
#
|
||||
diff --git a/hv_vss_daemon.c b/hv_vss_daemon.c
|
||||
index 92902a8..29a1e48 100644
|
||||
--- a/hv_vss_daemon.c
|
||||
+++ b/hv_vss_daemon.c
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <dirent.h>
|
||||
|
||||
+static bool fs_frozen;
|
||||
+
|
||||
/* Don't use syslog() in the function since that can cause write to disk */
|
||||
static int vss_do_freeze(char *dir, unsigned int cmd)
|
||||
{
|
||||
@@ -155,16 +157,22 @@ static int vss_operate(int operation)
|
||||
continue;
|
||||
}
|
||||
error |= vss_do_freeze(ent->mnt_dir, cmd);
|
||||
- if (error && operation == VSS_OP_FREEZE)
|
||||
- goto err;
|
||||
+ if (operation == VSS_OP_FREEZE) {
|
||||
+ if (error)
|
||||
+ goto err;
|
||||
+ fs_frozen = true;
|
||||
+ }
|
||||
}
|
||||
|
||||
endmntent(mounts);
|
||||
|
||||
if (root_seen) {
|
||||
error |= vss_do_freeze("/", cmd);
|
||||
- if (error && operation == VSS_OP_FREEZE)
|
||||
- goto err;
|
||||
+ if (operation == VSS_OP_FREEZE) {
|
||||
+ if (error)
|
||||
+ goto err;
|
||||
+ fs_frozen = true;
|
||||
+ }
|
||||
}
|
||||
|
||||
goto out;
|
||||
@@ -175,6 +183,7 @@ err:
|
||||
endmntent(mounts);
|
||||
}
|
||||
vss_operate(VSS_OP_THAW);
|
||||
+ fs_frozen = false;
|
||||
/* Call syslog after we thaw all filesystems */
|
||||
if (ent)
|
||||
syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s",
|
||||
@@ -196,13 +205,13 @@ void print_usage(char *argv[])
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
- int vss_fd, len;
|
||||
+ int vss_fd = -1, len;
|
||||
int error;
|
||||
struct pollfd pfd;
|
||||
int op;
|
||||
struct hv_vss_msg vss_msg[1];
|
||||
int daemonize = 1, long_index = 0, opt;
|
||||
- int in_handshake = 1;
|
||||
+ int in_handshake;
|
||||
__u32 kernel_modver;
|
||||
|
||||
static struct option long_options[] = {
|
||||
@@ -232,6 +241,18 @@ int main(int argc, char *argv[])
|
||||
openlog("Hyper-V VSS", 0, LOG_USER);
|
||||
syslog(LOG_INFO, "VSS starting; pid is:%d", getpid());
|
||||
|
||||
+reopen_vss_fd:
|
||||
+ if (vss_fd != -1)
|
||||
+ close(vss_fd);
|
||||
+ if (fs_frozen) {
|
||||
+ if (vss_operate(VSS_OP_THAW) || fs_frozen) {
|
||||
+ syslog(LOG_ERR, "failed to thaw file system: err=%d",
|
||||
+ errno);
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ in_handshake = 1;
|
||||
vss_fd = open("/dev/vmbus/hv_vss", O_RDWR);
|
||||
if (vss_fd < 0) {
|
||||
syslog(LOG_ERR, "open /dev/vmbus/hv_vss failed; error: %d %s",
|
||||
@@ -247,8 +268,7 @@ int main(int argc, char *argv[])
|
||||
if (len < 0) {
|
||||
syslog(LOG_ERR, "registration to kernel failed; error: %d %s",
|
||||
errno, strerror(errno));
|
||||
- close(vss_fd);
|
||||
- exit(EXIT_FAILURE);
|
||||
+ goto reopen_vss_fd;
|
||||
}
|
||||
|
||||
pfd.fd = vss_fd;
|
||||
@@ -312,14 +332,18 @@ int main(int argc, char *argv[])
|
||||
default:
|
||||
syslog(LOG_ERR, "Illegal op:%d\n", op);
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * The write() may return an error due to the faked VSS_OP_THAW
|
||||
+ * message upon hibernation. Ignore the error by resetting the
|
||||
+ * dev file, i.e. closing and re-opening it.
|
||||
+ */
|
||||
vss_msg->error = error;
|
||||
len = write(vss_fd, vss_msg, sizeof(struct hv_vss_msg));
|
||||
if (len != sizeof(struct hv_vss_msg)) {
|
||||
syslog(LOG_ERR, "write failed; error: %d %s", errno,
|
||||
strerror(errno));
|
||||
-
|
||||
- if (op == VSS_OP_FREEZE)
|
||||
- vss_operate(VSS_OP_THAW);
|
||||
+ goto reopen_vss_fd;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,401 @@
|
||||
From a13aa83d1b5bb4b6ce4396aef3457b48695b7c41 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Thu, 6 May 2021 12:53:31 +0200
|
||||
Subject: Add vmbus_testing tool build files
|
||||
|
||||
Add the vmbus_testing tool to redhat build dirs
|
||||
|
||||
(cherry-pick from rhel 8.4.0 commit d8ca5e0)
|
||||
Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
---
|
||||
.distro/hyperv-daemons.spec.template | 2 +
|
||||
vmbus_testing | 376 +++++++++++++++++++++++++++
|
||||
2 files changed, 378 insertions(+)
|
||||
create mode 100755 vmbus_testing
|
||||
|
||||
diff --git a/vmbus_testing b/vmbus_testing
|
||||
new file mode 100755
|
||||
index 0000000..e721290
|
||||
--- /dev/null
|
||||
+++ b/vmbus_testing
|
||||
@@ -0,0 +1,376 @@
|
||||
+#!/usr/bin/env python3
|
||||
+# SPDX-License-Identifier: GPL-2.0
|
||||
+#
|
||||
+# Program to allow users to fuzz test Hyper-V drivers
|
||||
+# by interfacing with Hyper-V debugfs attributes.
|
||||
+# Current test methods available:
|
||||
+# 1. delay testing
|
||||
+#
|
||||
+# Current file/directory structure of hyper-V debugfs:
|
||||
+# /sys/kernel/debug/hyperv/UUID
|
||||
+# /sys/kernel/debug/hyperv/UUID/<test-state filename>
|
||||
+# /sys/kernel/debug/hyperv/UUID/<test-method sub-directory>
|
||||
+#
|
||||
+# author: Branden Bonaby <brandonbonaby94@gmail.com>
|
||||
+
|
||||
+import os
|
||||
+import cmd
|
||||
+import argparse
|
||||
+import glob
|
||||
+from argparse import RawDescriptionHelpFormatter
|
||||
+from argparse import RawTextHelpFormatter
|
||||
+from enum import Enum
|
||||
+
|
||||
+# Do not change unless, you change the debugfs attributes
|
||||
+# in /drivers/hv/debugfs.c. All fuzz testing
|
||||
+# attributes will start with "fuzz_test".
|
||||
+
|
||||
+# debugfs path for hyperv must exist before proceeding
|
||||
+debugfs_hyperv_path = "/sys/kernel/debug/hyperv"
|
||||
+if not os.path.isdir(debugfs_hyperv_path):
|
||||
+ print("{} doesn't exist/check permissions".format(debugfs_hyperv_path))
|
||||
+ exit(-1)
|
||||
+
|
||||
+class dev_state(Enum):
|
||||
+ off = 0
|
||||
+ on = 1
|
||||
+
|
||||
+# File names, that correspond to the files created in
|
||||
+# /drivers/hv/debugfs.c
|
||||
+class f_names(Enum):
|
||||
+ state_f = "fuzz_test_state"
|
||||
+ buff_f = "fuzz_test_buffer_interrupt_delay"
|
||||
+ mess_f = "fuzz_test_message_delay"
|
||||
+
|
||||
+# Both single_actions and all_actions are used
|
||||
+# for error checking and to allow for some subparser
|
||||
+# names to be abbreviated. Do not abbreviate the
|
||||
+# test method names, as it will become less intuitive
|
||||
+# as to what the user can do. If you do decide to
|
||||
+# abbreviate the test method name, make sure the main
|
||||
+# function reflects this change.
|
||||
+
|
||||
+all_actions = [
|
||||
+ "disable_all",
|
||||
+ "D",
|
||||
+ "enable_all",
|
||||
+ "view_all",
|
||||
+ "V"
|
||||
+]
|
||||
+
|
||||
+single_actions = [
|
||||
+ "disable_single",
|
||||
+ "d",
|
||||
+ "enable_single",
|
||||
+ "view_single",
|
||||
+ "v"
|
||||
+]
|
||||
+
|
||||
+def main():
|
||||
+
|
||||
+ file_map = recursive_file_lookup(debugfs_hyperv_path, dict())
|
||||
+ args = parse_args()
|
||||
+ if (not args.action):
|
||||
+ print ("Error, no options selected...exiting")
|
||||
+ exit(-1)
|
||||
+ arg_set = { k for (k,v) in vars(args).items() if v and k != "action" }
|
||||
+ arg_set.add(args.action)
|
||||
+ path = args.path if "path" in arg_set else None
|
||||
+ if (path and path[-1] == "/"):
|
||||
+ path = path[:-1]
|
||||
+ validate_args_path(path, arg_set, file_map)
|
||||
+ if (path and "enable_single" in arg_set):
|
||||
+ state_path = locate_state(path, file_map)
|
||||
+ set_test_state(state_path, dev_state.on.value, args.quiet)
|
||||
+
|
||||
+ # Use subparsers as the key for different actions
|
||||
+ if ("delay" in arg_set):
|
||||
+ validate_delay_values(args.delay_time)
|
||||
+ if (args.enable_all):
|
||||
+ set_delay_all_devices(file_map, args.delay_time,
|
||||
+ args.quiet)
|
||||
+ else:
|
||||
+ set_delay_values(path, file_map, args.delay_time,
|
||||
+ args.quiet)
|
||||
+ elif ("disable_all" in arg_set or "D" in arg_set):
|
||||
+ disable_all_testing(file_map)
|
||||
+ elif ("disable_single" in arg_set or "d" in arg_set):
|
||||
+ disable_testing_single_device(path, file_map)
|
||||
+ elif ("view_all" in arg_set or "V" in arg_set):
|
||||
+ get_all_devices_test_status(file_map)
|
||||
+ elif ("view_single" in arg_set or "v" in arg_set):
|
||||
+ get_device_test_values(path, file_map)
|
||||
+
|
||||
+# Get the state location
|
||||
+def locate_state(device, file_map):
|
||||
+ return file_map[device][f_names.state_f.value]
|
||||
+
|
||||
+# Validate delay values to make sure they are acceptable to
|
||||
+# enable delays on a device
|
||||
+def validate_delay_values(delay):
|
||||
+
|
||||
+ if (delay[0] == -1 and delay[1] == -1):
|
||||
+ print("\nError, At least 1 value must be greater than 0")
|
||||
+ exit(-1)
|
||||
+ for i in delay:
|
||||
+ if (i < -1 or i == 0 or i > 1000):
|
||||
+ print("\nError, Values must be equal to -1 "
|
||||
+ "or be > 0 and <= 1000")
|
||||
+ exit(-1)
|
||||
+
|
||||
+# Validate argument path
|
||||
+def validate_args_path(path, arg_set, file_map):
|
||||
+
|
||||
+ if (not path and any(element in arg_set for element in single_actions)):
|
||||
+ print("Error, path (-p) REQUIRED for the specified option. "
|
||||
+ "Use (-h) to check usage.")
|
||||
+ exit(-1)
|
||||
+ elif (path and any(item in arg_set for item in all_actions)):
|
||||
+ print("Error, path (-p) NOT REQUIRED for the specified option. "
|
||||
+ "Use (-h) to check usage." )
|
||||
+ exit(-1)
|
||||
+ elif (path not in file_map and any(item in arg_set
|
||||
+ for item in single_actions)):
|
||||
+ print("Error, path '{}' not a valid vmbus device".format(path))
|
||||
+ exit(-1)
|
||||
+
|
||||
+# display Testing status of single device
|
||||
+def get_device_test_values(path, file_map):
|
||||
+
|
||||
+ for name in file_map[path]:
|
||||
+ file_location = file_map[path][name]
|
||||
+ print( name + " = " + str(read_test_files(file_location)))
|
||||
+
|
||||
+# Create a map of the vmbus devices and their associated files
|
||||
+# [key=device, value = [key = filename, value = file path]]
|
||||
+def recursive_file_lookup(path, file_map):
|
||||
+
|
||||
+ for f_path in glob.iglob(path + '**/*'):
|
||||
+ if (os.path.isfile(f_path)):
|
||||
+ if (f_path.rsplit("/",2)[0] == debugfs_hyperv_path):
|
||||
+ directory = f_path.rsplit("/",1)[0]
|
||||
+ else:
|
||||
+ directory = f_path.rsplit("/",2)[0]
|
||||
+ f_name = f_path.split("/")[-1]
|
||||
+ if (file_map.get(directory)):
|
||||
+ file_map[directory].update({f_name:f_path})
|
||||
+ else:
|
||||
+ file_map[directory] = {f_name:f_path}
|
||||
+ elif (os.path.isdir(f_path)):
|
||||
+ recursive_file_lookup(f_path,file_map)
|
||||
+ return file_map
|
||||
+
|
||||
+# display Testing state of devices
|
||||
+def get_all_devices_test_status(file_map):
|
||||
+
|
||||
+ for device in file_map:
|
||||
+ if (get_test_state(locate_state(device, file_map)) is 1):
|
||||
+ print("Testing = ON for: {}"
|
||||
+ .format(device.split("/")[5]))
|
||||
+ else:
|
||||
+ print("Testing = OFF for: {}"
|
||||
+ .format(device.split("/")[5]))
|
||||
+
|
||||
+# read the vmbus device files, path must be absolute path before calling
|
||||
+def read_test_files(path):
|
||||
+ try:
|
||||
+ with open(path,"r") as f:
|
||||
+ file_value = f.readline().strip()
|
||||
+ return int(file_value)
|
||||
+
|
||||
+ except IOError as e:
|
||||
+ errno, strerror = e.args
|
||||
+ print("I/O error({0}): {1} on file {2}"
|
||||
+ .format(errno, strerror, path))
|
||||
+ exit(-1)
|
||||
+ except ValueError:
|
||||
+ print ("Element to int conversion error in: \n{}".format(path))
|
||||
+ exit(-1)
|
||||
+
|
||||
+# writing to vmbus device files, path must be absolute path before calling
|
||||
+def write_test_files(path, value):
|
||||
+
|
||||
+ try:
|
||||
+ with open(path,"w") as f:
|
||||
+ f.write("{}".format(value))
|
||||
+ except IOError as e:
|
||||
+ errno, strerror = e.args
|
||||
+ print("I/O error({0}): {1} on file {2}"
|
||||
+ .format(errno, strerror, path))
|
||||
+ exit(-1)
|
||||
+
|
||||
+# set testing state of device
|
||||
+def set_test_state(state_path, state_value, quiet):
|
||||
+
|
||||
+ write_test_files(state_path, state_value)
|
||||
+ if (get_test_state(state_path) is 1):
|
||||
+ if (not quiet):
|
||||
+ print("Testing = ON for device: {}"
|
||||
+ .format(state_path.split("/")[5]))
|
||||
+ else:
|
||||
+ if (not quiet):
|
||||
+ print("Testing = OFF for device: {}"
|
||||
+ .format(state_path.split("/")[5]))
|
||||
+
|
||||
+# get testing state of device
|
||||
+def get_test_state(state_path):
|
||||
+ #state == 1 - test = ON
|
||||
+ #state == 0 - test = OFF
|
||||
+ return read_test_files(state_path)
|
||||
+
|
||||
+# write 1 - 1000 microseconds, into a single device using the
|
||||
+# fuzz_test_buffer_interrupt_delay and fuzz_test_message_delay
|
||||
+# debugfs attributes
|
||||
+def set_delay_values(device, file_map, delay_length, quiet):
|
||||
+
|
||||
+ try:
|
||||
+ interrupt = file_map[device][f_names.buff_f.value]
|
||||
+ message = file_map[device][f_names.mess_f.value]
|
||||
+
|
||||
+ # delay[0]- buffer interrupt delay, delay[1]- message delay
|
||||
+ if (delay_length[0] >= 0 and delay_length[0] <= 1000):
|
||||
+ write_test_files(interrupt, delay_length[0])
|
||||
+ if (delay_length[1] >= 0 and delay_length[1] <= 1000):
|
||||
+ write_test_files(message, delay_length[1])
|
||||
+ if (not quiet):
|
||||
+ print("Buffer delay testing = {} for: {}"
|
||||
+ .format(read_test_files(interrupt),
|
||||
+ interrupt.split("/")[5]))
|
||||
+ print("Message delay testing = {} for: {}"
|
||||
+ .format(read_test_files(message),
|
||||
+ message.split("/")[5]))
|
||||
+ except IOError as e:
|
||||
+ errno, strerror = e.args
|
||||
+ print("I/O error({0}): {1} on files {2}{3}"
|
||||
+ .format(errno, strerror, interrupt, message))
|
||||
+ exit(-1)
|
||||
+
|
||||
+# enabling delay testing on all devices
|
||||
+def set_delay_all_devices(file_map, delay, quiet):
|
||||
+
|
||||
+ for device in (file_map):
|
||||
+ set_test_state(locate_state(device, file_map),
|
||||
+ dev_state.on.value,
|
||||
+ quiet)
|
||||
+ set_delay_values(device, file_map, delay, quiet)
|
||||
+
|
||||
+# disable all testing on a SINGLE device.
|
||||
+def disable_testing_single_device(device, file_map):
|
||||
+
|
||||
+ for name in file_map[device]:
|
||||
+ file_location = file_map[device][name]
|
||||
+ write_test_files(file_location, dev_state.off.value)
|
||||
+ print("ALL testing now OFF for {}".format(device.split("/")[-1]))
|
||||
+
|
||||
+# disable all testing on ALL devices
|
||||
+def disable_all_testing(file_map):
|
||||
+
|
||||
+ for device in file_map:
|
||||
+ disable_testing_single_device(device, file_map)
|
||||
+
|
||||
+def parse_args():
|
||||
+ parser = argparse.ArgumentParser(prog = "vmbus_testing",usage ="\n"
|
||||
+ "%(prog)s [delay] [-h] [-e|-E] -t [-p]\n"
|
||||
+ "%(prog)s [view_all | V] [-h]\n"
|
||||
+ "%(prog)s [disable_all | D] [-h]\n"
|
||||
+ "%(prog)s [disable_single | d] [-h|-p]\n"
|
||||
+ "%(prog)s [view_single | v] [-h|-p]\n"
|
||||
+ "%(prog)s --version\n",
|
||||
+ description = "\nUse lsvmbus to get vmbus device type "
|
||||
+ "information.\n" "\nThe debugfs root path is "
|
||||
+ "/sys/kernel/debug/hyperv",
|
||||
+ formatter_class = RawDescriptionHelpFormatter)
|
||||
+ subparsers = parser.add_subparsers(dest = "action")
|
||||
+ parser.add_argument("--version", action = "version",
|
||||
+ version = '%(prog)s 0.1.0')
|
||||
+ parser.add_argument("-q","--quiet", action = "store_true",
|
||||
+ help = "silence none important test messages."
|
||||
+ " This will only work when enabling testing"
|
||||
+ " on a device.")
|
||||
+ # Use the path parser to hold the --path attribute so it can
|
||||
+ # be shared between subparsers. Also do the same for the state
|
||||
+ # parser, as all testing methods will use --enable_all and
|
||||
+ # enable_single.
|
||||
+ path_parser = argparse.ArgumentParser(add_help=False)
|
||||
+ path_parser.add_argument("-p","--path", metavar = "",
|
||||
+ help = "Debugfs path to a vmbus device. The path "
|
||||
+ "must be the absolute path to the device.")
|
||||
+ state_parser = argparse.ArgumentParser(add_help=False)
|
||||
+ state_group = state_parser.add_mutually_exclusive_group(required = True)
|
||||
+ state_group.add_argument("-E", "--enable_all", action = "store_const",
|
||||
+ const = "enable_all",
|
||||
+ help = "Enable the specified test type "
|
||||
+ "on ALL vmbus devices.")
|
||||
+ state_group.add_argument("-e", "--enable_single",
|
||||
+ action = "store_const",
|
||||
+ const = "enable_single",
|
||||
+ help = "Enable the specified test type on a "
|
||||
+ "SINGLE vmbus device.")
|
||||
+ parser_delay = subparsers.add_parser("delay",
|
||||
+ parents = [state_parser, path_parser],
|
||||
+ help = "Delay the ring buffer interrupt or the "
|
||||
+ "ring buffer message reads in microseconds.",
|
||||
+ prog = "vmbus_testing",
|
||||
+ usage = "%(prog)s [-h]\n"
|
||||
+ "%(prog)s -E -t [value] [value]\n"
|
||||
+ "%(prog)s -e -t [value] [value] -p",
|
||||
+ description = "Delay the ring buffer interrupt for "
|
||||
+ "vmbus devices, or delay the ring buffer message "
|
||||
+ "reads for vmbus devices (both in microseconds). This "
|
||||
+ "is only on the host to guest channel.")
|
||||
+ parser_delay.add_argument("-t", "--delay_time", metavar = "", nargs = 2,
|
||||
+ type = check_range, default =[0,0], required = (True),
|
||||
+ help = "Set [buffer] & [message] delay time. "
|
||||
+ "Value constraints: -1 == value "
|
||||
+ "or 0 < value <= 1000.\n"
|
||||
+ "Use -1 to keep the previous value for that delay "
|
||||
+ "type, or a value > 0 <= 1000 to change the delay "
|
||||
+ "time.")
|
||||
+ parser_dis_all = subparsers.add_parser("disable_all",
|
||||
+ aliases = ['D'], prog = "vmbus_testing",
|
||||
+ usage = "%(prog)s [disable_all | D] -h\n"
|
||||
+ "%(prog)s [disable_all | D]\n",
|
||||
+ help = "Disable ALL testing on ALL vmbus devices.",
|
||||
+ description = "Disable ALL testing on ALL vmbus "
|
||||
+ "devices.")
|
||||
+ parser_dis_single = subparsers.add_parser("disable_single",
|
||||
+ aliases = ['d'],
|
||||
+ parents = [path_parser], prog = "vmbus_testing",
|
||||
+ usage = "%(prog)s [disable_single | d] -h\n"
|
||||
+ "%(prog)s [disable_single | d] -p\n",
|
||||
+ help = "Disable ALL testing on a SINGLE vmbus device.",
|
||||
+ description = "Disable ALL testing on a SINGLE vmbus "
|
||||
+ "device.")
|
||||
+ parser_view_all = subparsers.add_parser("view_all", aliases = ['V'],
|
||||
+ help = "View the test state for ALL vmbus devices.",
|
||||
+ prog = "vmbus_testing",
|
||||
+ usage = "%(prog)s [view_all | V] -h\n"
|
||||
+ "%(prog)s [view_all | V]\n",
|
||||
+ description = "This shows the test state for ALL the "
|
||||
+ "vmbus devices.")
|
||||
+ parser_view_single = subparsers.add_parser("view_single",
|
||||
+ aliases = ['v'],parents = [path_parser],
|
||||
+ help = "View the test values for a SINGLE vmbus "
|
||||
+ "device.",
|
||||
+ description = "This shows the test values for a SINGLE "
|
||||
+ "vmbus device.", prog = "vmbus_testing",
|
||||
+ usage = "%(prog)s [view_single | v] -h\n"
|
||||
+ "%(prog)s [view_single | v] -p")
|
||||
+
|
||||
+ return parser.parse_args()
|
||||
+
|
||||
+# value checking for range checking input in parser
|
||||
+def check_range(arg1):
|
||||
+
|
||||
+ try:
|
||||
+ val = int(arg1)
|
||||
+ except ValueError as err:
|
||||
+ raise argparse.ArgumentTypeError(str(err))
|
||||
+ if val < -1 or val > 1000:
|
||||
+ message = ("\n\nvalue must be -1 or 0 < value <= 1000. "
|
||||
+ "Value program received: {}\n").format(val)
|
||||
+ raise argparse.ArgumentTypeError(message)
|
||||
+ return val
|
||||
+
|
||||
+if __name__ == "__main__":
|
||||
+ main()
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,56 @@
|
||||
From 6ed9946f9a4f1a01846add2279e8d0640c1c2f1c Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
Date: Thu, 6 May 2021 12:53:58 +0200
|
||||
Subject: tools: hv: change http to https in hv_kvp_daemon.c
|
||||
|
||||
The patch has no functional change. Only changes the URL pointed to
|
||||
in one of the comments
|
||||
|
||||
commit fa52a4b2d0ab416508538bb47a95167d4c94caac
|
||||
Author: Alexander A. Klimov <grandmaster@al2klimov.de>
|
||||
Date: Sun Jul 5 23:44:57 2020 +0200
|
||||
|
||||
tools: hv: change http to https in hv_kvp_daemon.c
|
||||
|
||||
Rationale:
|
||||
Reduces attack surface on kernel devs opening the links for MITM
|
||||
as HTTPS traffic is much harder to manipulate.
|
||||
|
||||
Deterministic algorithm:
|
||||
For each file:
|
||||
If not .svg:
|
||||
For each line:
|
||||
If doesn't contain `\bxmlns\b`:
|
||||
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
|
||||
If both the HTTP and HTTPS versions
|
||||
return 200 OK and serve the same content:
|
||||
Replace HTTP with HTTPS.
|
||||
|
||||
Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
|
||||
Link: https://lore.kernel.org/r/20200705214457.28433-1-grandmaster@al2klimov.de
|
||||
[ wei: change subject line to be more specific ]
|
||||
Signed-off-by: Wei Liu <wei.liu@kernel.org>
|
||||
|
||||
Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
|
||||
(cherry-picked from rhel 8.4.0 commit e956573)
|
||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
---
|
||||
hv_kvp_daemon.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hv_kvp_daemon.c b/hv_kvp_daemon.c
|
||||
index 0e5f14a..c06c94d 100644
|
||||
--- a/hv_kvp_daemon.c
|
||||
+++ b/hv_kvp_daemon.c
|
||||
@@ -437,7 +437,7 @@ void kvp_get_os_info(void)
|
||||
|
||||
/*
|
||||
* Parse the /etc/os-release file if present:
|
||||
- * http://www.freedesktop.org/software/systemd/man/os-release.html
|
||||
+ * https://www.freedesktop.org/software/systemd/man/os-release.html
|
||||
*/
|
||||
file = fopen("/etc/os-release", "r");
|
||||
if (file != NULL) {
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,31 @@
|
||||
From 3d234bcdb4d40b42923688514a2fb5d1cb8b3314 Mon Sep 17 00:00:00 2001
|
||||
From: Till Maas <timaas@redhat.com>
|
||||
Date: Tue, 14 Dec 2021 08:07:40 +0000
|
||||
Subject: [PATCH 2/2] Use filename for connection profile
|
||||
|
||||
RH-Author: Till Maas <None>
|
||||
RH-MergeRequest: 2: hv_set_ifconfig.sh: Use nmcli commands
|
||||
RH-Commit: [2/2] 6b6f37ba159b0614b75fcfc02f0513af116711c2 (timaas/hyperv-daemons)
|
||||
RH-Bugzilla: 2026371
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
---
|
||||
hv_set_ifconfig.sh | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh
|
||||
index 5a64efe..146829b 100644
|
||||
--- a/hv_set_ifconfig.sh
|
||||
+++ b/hv_set_ifconfig.sh
|
||||
@@ -57,5 +57,6 @@ echo "ONBOOT=yes" >> $1
|
||||
|
||||
cp $1 /etc/sysconfig/network-scripts/
|
||||
|
||||
-nmcli connection load "/etc/sysconfig/network-scripts/$1"
|
||||
-nmcli connection up filename "/etc/sysconfig/network-scripts/$1"
|
||||
+filename="${1##*/}"
|
||||
+nmcli connection load "/etc/sysconfig/network-scripts/${filename}"
|
||||
+nmcli connection up filename "/etc/sysconfig/network-scripts/${filename}"
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,38 @@
|
||||
From ac2132ceaeb611c89eacb468a66f1815ee6fe806 Mon Sep 17 00:00:00 2001
|
||||
From: Till Maas <timaas@redhat.com>
|
||||
Date: Mon, 13 Dec 2021 16:08:42 +0000
|
||||
Subject: [PATCH 1/2] hv_set_ifconfig.sh: Use nmcli commands
|
||||
|
||||
RH-Author: Till Maas <None>
|
||||
RH-MergeRequest: 2: hv_set_ifconfig.sh: Use nmcli commands
|
||||
RH-Commit: [1/2] fbb64255b1d96babd362391d53529cef0e449296 (timaas/hyperv-daemons)
|
||||
RH-Bugzilla: 2026371
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
||||
|
||||
Instead of using deprecated ifup/ifdown commands, use nmcli commands.
|
||||
Taking the connection down is not necessary with NM, so don't do it.
|
||||
|
||||
Resolves: #2026371
|
||||
---
|
||||
hv_set_ifconfig.sh | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh
|
||||
index 3dd064c..5a64efe 100644
|
||||
--- a/hv_set_ifconfig.sh
|
||||
+++ b/hv_set_ifconfig.sh
|
||||
@@ -57,8 +57,5 @@ echo "ONBOOT=yes" >> $1
|
||||
|
||||
cp $1 /etc/sysconfig/network-scripts/
|
||||
|
||||
-
|
||||
-interface=$(echo $1 | awk -F - '{ print $2 }')
|
||||
-
|
||||
-/sbin/ifdown $interface 2>/dev/null
|
||||
-/sbin/ifup $interface 2>/dev/null
|
||||
+nmcli connection load "/etc/sysconfig/network-scripts/$1"
|
||||
+nmcli connection up filename "/etc/sysconfig/network-scripts/$1"
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,239 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* An implementation of host to guest copy functionality for Linux.
|
||||
*
|
||||
* Copyright (C) 2014, Microsoft, Inc.
|
||||
*
|
||||
* Author : K. Y. Srinivasan <kys@microsoft.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <linux/hyperv.h>
|
||||
#include <linux/limits.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
|
||||
static int target_fd;
|
||||
static char target_fname[PATH_MAX];
|
||||
static unsigned long long filesize;
|
||||
|
||||
static int hv_start_fcopy(struct hv_start_fcopy *smsg)
|
||||
{
|
||||
int error = HV_E_FAIL;
|
||||
char *q, *p;
|
||||
|
||||
filesize = 0;
|
||||
p = (char *)smsg->path_name;
|
||||
snprintf(target_fname, sizeof(target_fname), "%s/%s",
|
||||
(char *)smsg->path_name, (char *)smsg->file_name);
|
||||
|
||||
syslog(LOG_INFO, "Target file name: %s", target_fname);
|
||||
/*
|
||||
* Check to see if the path is already in place; if not,
|
||||
* create if required.
|
||||
*/
|
||||
while ((q = strchr(p, '/')) != NULL) {
|
||||
if (q == p) {
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
*q = '\0';
|
||||
if (access((char *)smsg->path_name, F_OK)) {
|
||||
if (smsg->copy_flags & CREATE_PATH) {
|
||||
if (mkdir((char *)smsg->path_name, 0755)) {
|
||||
syslog(LOG_ERR, "Failed to create %s",
|
||||
(char *)smsg->path_name);
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
syslog(LOG_ERR, "Invalid path: %s",
|
||||
(char *)smsg->path_name);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
p = q + 1;
|
||||
*q = '/';
|
||||
}
|
||||
|
||||
if (!access(target_fname, F_OK)) {
|
||||
syslog(LOG_INFO, "File: %s exists", target_fname);
|
||||
if (!(smsg->copy_flags & OVER_WRITE)) {
|
||||
error = HV_ERROR_ALREADY_EXISTS;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
target_fd = open(target_fname,
|
||||
O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744);
|
||||
if (target_fd == -1) {
|
||||
syslog(LOG_INFO, "Open Failed: %s", strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
|
||||
error = 0;
|
||||
done:
|
||||
return error;
|
||||
}
|
||||
|
||||
static int hv_copy_data(struct hv_do_fcopy *cpmsg)
|
||||
{
|
||||
ssize_t bytes_written;
|
||||
int ret = 0;
|
||||
|
||||
bytes_written = pwrite(target_fd, cpmsg->data, cpmsg->size,
|
||||
cpmsg->offset);
|
||||
|
||||
filesize += cpmsg->size;
|
||||
if (bytes_written != cpmsg->size) {
|
||||
switch (errno) {
|
||||
case ENOSPC:
|
||||
ret = HV_ERROR_DISK_FULL;
|
||||
break;
|
||||
default:
|
||||
ret = HV_E_FAIL;
|
||||
break;
|
||||
}
|
||||
syslog(LOG_ERR, "pwrite failed to write %llu bytes: %ld (%s)",
|
||||
filesize, (long)bytes_written, strerror(errno));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hv_copy_finished(void)
|
||||
{
|
||||
close(target_fd);
|
||||
return 0;
|
||||
}
|
||||
static int hv_copy_cancel(void)
|
||||
{
|
||||
close(target_fd);
|
||||
unlink(target_fname);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void print_usage(char *argv[])
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [options]\n"
|
||||
"Options are:\n"
|
||||
" -n, --no-daemon stay in foreground, don't daemonize\n"
|
||||
" -h, --help print this help\n", argv[0]);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int fcopy_fd;
|
||||
int error;
|
||||
int daemonize = 1, long_index = 0, opt;
|
||||
int version = FCOPY_CURRENT_VERSION;
|
||||
union {
|
||||
struct hv_fcopy_hdr hdr;
|
||||
struct hv_start_fcopy start;
|
||||
struct hv_do_fcopy copy;
|
||||
__u32 kernel_modver;
|
||||
} buffer = { };
|
||||
int in_handshake = 1;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"help", no_argument, 0, 'h' },
|
||||
{"no-daemon", no_argument, 0, 'n' },
|
||||
{0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
while ((opt = getopt_long(argc, argv, "hn", long_options,
|
||||
&long_index)) != -1) {
|
||||
switch (opt) {
|
||||
case 'n':
|
||||
daemonize = 0;
|
||||
break;
|
||||
case 'h':
|
||||
default:
|
||||
print_usage(argv);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (daemonize && daemon(1, 0)) {
|
||||
syslog(LOG_ERR, "daemon() failed; error: %s", strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
openlog("HV_FCOPY", 0, LOG_USER);
|
||||
syslog(LOG_INFO, "starting; pid is:%d", getpid());
|
||||
|
||||
fcopy_fd = open("/dev/vmbus/hv_fcopy", O_RDWR);
|
||||
|
||||
if (fcopy_fd < 0) {
|
||||
syslog(LOG_ERR, "open /dev/vmbus/hv_fcopy failed; error: %d %s",
|
||||
errno, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register with the kernel.
|
||||
*/
|
||||
if ((write(fcopy_fd, &version, sizeof(int))) != sizeof(int)) {
|
||||
syslog(LOG_ERR, "Registration failed: %s", strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
/*
|
||||
* In this loop we process fcopy messages after the
|
||||
* handshake is complete.
|
||||
*/
|
||||
ssize_t len;
|
||||
|
||||
len = pread(fcopy_fd, &buffer, sizeof(buffer), 0);
|
||||
if (len < 0) {
|
||||
syslog(LOG_ERR, "pread failed: %s", strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (in_handshake) {
|
||||
if (len != sizeof(buffer.kernel_modver)) {
|
||||
syslog(LOG_ERR, "invalid version negotiation");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
in_handshake = 0;
|
||||
syslog(LOG_INFO, "kernel module version: %u",
|
||||
buffer.kernel_modver);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (buffer.hdr.operation) {
|
||||
case START_FILE_COPY:
|
||||
error = hv_start_fcopy(&buffer.start);
|
||||
break;
|
||||
case WRITE_TO_FILE:
|
||||
error = hv_copy_data(&buffer.copy);
|
||||
break;
|
||||
case COMPLETE_FCOPY:
|
||||
error = hv_copy_finished();
|
||||
break;
|
||||
case CANCEL_FCOPY:
|
||||
error = hv_copy_cancel();
|
||||
break;
|
||||
|
||||
default:
|
||||
error = HV_E_FAIL;
|
||||
syslog(LOG_ERR, "Unknown operation: %d",
|
||||
buffer.hdr.operation);
|
||||
|
||||
}
|
||||
|
||||
if (pwrite(fcopy_fd, &error, sizeof(int), 0) != sizeof(int)) {
|
||||
syslog(LOG_ERR, "pwrite failed: %s", strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
# 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
|
@ -0,0 +1,13 @@
|
||||
#!/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 }'
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
# This example script activates an interface based on the specified
|
||||
# configuration.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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 configuring the
|
||||
# interface.
|
||||
#
|
||||
# This example script is based on a RHEL environment.
|
||||
#
|
||||
# Here is the format of the ip configuration file:
|
||||
#
|
||||
# HWADDR=macaddr
|
||||
# DEVICE=interface name
|
||||
# BOOTPROTO=<protocol> (where <protocol> is "dhcp" if DHCP is configured
|
||||
# or "none" if no boot-time protocol should be used)
|
||||
#
|
||||
# IPADDR0=ipaddr1
|
||||
# IPADDR1=ipaddr2
|
||||
# IPADDRx=ipaddry (where y = x + 1)
|
||||
#
|
||||
# NETMASK0=netmask1
|
||||
# NETMASKx=netmasky (where y = x + 1)
|
||||
#
|
||||
# GATEWAY=ipaddr1
|
||||
# GATEWAYx=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.
|
||||
#
|
||||
|
||||
|
||||
|
||||
echo "IPV6INIT=yes" >> $1
|
||||
echo "NM_CONTROLLED=no" >> $1
|
||||
echo "PEERDNS=yes" >> $1
|
||||
echo "ONBOOT=yes" >> $1
|
||||
|
||||
|
||||
cp $1 /etc/sysconfig/network-scripts/
|
||||
|
||||
|
||||
interface=$(echo $1 | awk -F - '{ print $2 }')
|
||||
|
||||
/sbin/ifdown $interface 2>/dev/null
|
||||
/sbin/ifup $interface 2>/dev/null
|
@ -0,0 +1,328 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* An implementation of the host initiated guest snapshot for Hyper-V.
|
||||
*
|
||||
* Copyright (C) 2013, Microsoft, Inc.
|
||||
* Author : K. Y. Srinivasan <kys@microsoft.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/poll.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <mntent.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/hyperv.h>
|
||||
#include <syslog.h>
|
||||
#include <getopt.h>
|
||||
#include <stdbool.h>
|
||||
#include <dirent.h>
|
||||
|
||||
/* Don't use syslog() in the function since that can cause write to disk */
|
||||
static int vss_do_freeze(char *dir, unsigned int cmd)
|
||||
{
|
||||
int ret, fd = open(dir, O_RDONLY);
|
||||
|
||||
if (fd < 0)
|
||||
return 1;
|
||||
|
||||
ret = ioctl(fd, cmd, 0);
|
||||
|
||||
/*
|
||||
* If a partition is mounted more than once, only the first
|
||||
* FREEZE/THAW can succeed and the later ones will get
|
||||
* EBUSY/EINVAL respectively: there could be 2 cases:
|
||||
* 1) a user may mount the same partition to different directories
|
||||
* by mistake or on purpose;
|
||||
* 2) The subvolume of btrfs appears to have the same partition
|
||||
* mounted more than once.
|
||||
*/
|
||||
if (ret) {
|
||||
if ((cmd == FIFREEZE && errno == EBUSY) ||
|
||||
(cmd == FITHAW && errno == EINVAL)) {
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return !!ret;
|
||||
}
|
||||
|
||||
static bool is_dev_loop(const char *blkname)
|
||||
{
|
||||
char *buffer;
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
bool ret = false;
|
||||
|
||||
buffer = malloc(PATH_MAX);
|
||||
if (!buffer) {
|
||||
syslog(LOG_ERR, "Can't allocate memory!");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
snprintf(buffer, PATH_MAX, "%s/loop", blkname);
|
||||
if (!access(buffer, R_OK | X_OK)) {
|
||||
ret = true;
|
||||
goto free_buffer;
|
||||
} else if (errno != ENOENT) {
|
||||
syslog(LOG_ERR, "Can't access: %s; error:%d %s!",
|
||||
buffer, errno, strerror(errno));
|
||||
}
|
||||
|
||||
snprintf(buffer, PATH_MAX, "%s/slaves", blkname);
|
||||
dir = opendir(buffer);
|
||||
if (!dir) {
|
||||
if (errno != ENOENT)
|
||||
syslog(LOG_ERR, "Can't opendir: %s; error:%d %s!",
|
||||
buffer, errno, strerror(errno));
|
||||
goto free_buffer;
|
||||
}
|
||||
|
||||
while ((entry = readdir(dir)) != NULL) {
|
||||
if (strcmp(entry->d_name, ".") == 0 ||
|
||||
strcmp(entry->d_name, "..") == 0)
|
||||
continue;
|
||||
|
||||
snprintf(buffer, PATH_MAX, "%s/slaves/%s", blkname,
|
||||
entry->d_name);
|
||||
if (is_dev_loop(buffer)) {
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
free_buffer:
|
||||
free(buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int vss_operate(int operation)
|
||||
{
|
||||
char match[] = "/dev/";
|
||||
FILE *mounts;
|
||||
struct mntent *ent;
|
||||
struct stat sb;
|
||||
char errdir[1024] = {0};
|
||||
char blkdir[23]; /* /sys/dev/block/XXX:XXX */
|
||||
unsigned int cmd;
|
||||
int error = 0, root_seen = 0, save_errno = 0;
|
||||
|
||||
switch (operation) {
|
||||
case VSS_OP_FREEZE:
|
||||
cmd = FIFREEZE;
|
||||
break;
|
||||
case VSS_OP_THAW:
|
||||
cmd = FITHAW;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
mounts = setmntent("/proc/mounts", "r");
|
||||
if (mounts == NULL)
|
||||
return -1;
|
||||
|
||||
while ((ent = getmntent(mounts))) {
|
||||
if (strncmp(ent->mnt_fsname, match, strlen(match)))
|
||||
continue;
|
||||
if (stat(ent->mnt_fsname, &sb)) {
|
||||
syslog(LOG_ERR, "Can't stat: %s; error:%d %s!",
|
||||
ent->mnt_fsname, errno, strerror(errno));
|
||||
} else {
|
||||
sprintf(blkdir, "/sys/dev/block/%d:%d",
|
||||
major(sb.st_rdev), minor(sb.st_rdev));
|
||||
if (is_dev_loop(blkdir))
|
||||
continue;
|
||||
}
|
||||
if (hasmntopt(ent, MNTOPT_RO) != NULL)
|
||||
continue;
|
||||
if (strcmp(ent->mnt_type, "vfat") == 0)
|
||||
continue;
|
||||
if (strcmp(ent->mnt_dir, "/") == 0) {
|
||||
root_seen = 1;
|
||||
continue;
|
||||
}
|
||||
error |= vss_do_freeze(ent->mnt_dir, cmd);
|
||||
if (error && operation == VSS_OP_FREEZE)
|
||||
goto err;
|
||||
}
|
||||
|
||||
endmntent(mounts);
|
||||
|
||||
if (root_seen) {
|
||||
error |= vss_do_freeze("/", cmd);
|
||||
if (error && operation == VSS_OP_FREEZE)
|
||||
goto err;
|
||||
}
|
||||
|
||||
goto out;
|
||||
err:
|
||||
save_errno = errno;
|
||||
if (ent) {
|
||||
strncpy(errdir, ent->mnt_dir, sizeof(errdir)-1);
|
||||
endmntent(mounts);
|
||||
}
|
||||
vss_operate(VSS_OP_THAW);
|
||||
/* Call syslog after we thaw all filesystems */
|
||||
if (ent)
|
||||
syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s",
|
||||
errdir, save_errno, strerror(save_errno));
|
||||
else
|
||||
syslog(LOG_ERR, "FREEZE of / failed; error:%d %s", save_errno,
|
||||
strerror(save_errno));
|
||||
out:
|
||||
return error;
|
||||
}
|
||||
|
||||
void print_usage(char *argv[])
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [options]\n"
|
||||
"Options are:\n"
|
||||
" -n, --no-daemon stay in foreground, don't daemonize\n"
|
||||
" -h, --help print this help\n", argv[0]);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int vss_fd, len;
|
||||
int error;
|
||||
struct pollfd pfd;
|
||||
int op;
|
||||
struct hv_vss_msg vss_msg[1];
|
||||
int daemonize = 1, long_index = 0, opt;
|
||||
int in_handshake = 1;
|
||||
__u32 kernel_modver;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"help", no_argument, 0, 'h' },
|
||||
{"no-daemon", no_argument, 0, 'n' },
|
||||
{0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
while ((opt = getopt_long(argc, argv, "hn", long_options,
|
||||
&long_index)) != -1) {
|
||||
switch (opt) {
|
||||
case 'n':
|
||||
daemonize = 0;
|
||||
break;
|
||||
case 'h':
|
||||
print_usage(argv);
|
||||
exit(0);
|
||||
default:
|
||||
print_usage(argv);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (daemonize && daemon(1, 0))
|
||||
return 1;
|
||||
|
||||
openlog("Hyper-V VSS", 0, LOG_USER);
|
||||
syslog(LOG_INFO, "VSS starting; pid is:%d", getpid());
|
||||
|
||||
vss_fd = open("/dev/vmbus/hv_vss", O_RDWR);
|
||||
if (vss_fd < 0) {
|
||||
syslog(LOG_ERR, "open /dev/vmbus/hv_vss failed; error: %d %s",
|
||||
errno, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
/*
|
||||
* Register ourselves with the kernel.
|
||||
*/
|
||||
vss_msg->vss_hdr.operation = VSS_OP_REGISTER1;
|
||||
|
||||
len = write(vss_fd, vss_msg, sizeof(struct hv_vss_msg));
|
||||
if (len < 0) {
|
||||
syslog(LOG_ERR, "registration to kernel failed; error: %d %s",
|
||||
errno, strerror(errno));
|
||||
close(vss_fd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
pfd.fd = vss_fd;
|
||||
|
||||
while (1) {
|
||||
pfd.events = POLLIN;
|
||||
pfd.revents = 0;
|
||||
|
||||
if (poll(&pfd, 1, -1) < 0) {
|
||||
syslog(LOG_ERR, "poll failed; error:%d %s", errno, strerror(errno));
|
||||
if (errno == EINVAL) {
|
||||
close(vss_fd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
len = read(vss_fd, vss_msg, sizeof(struct hv_vss_msg));
|
||||
|
||||
if (in_handshake) {
|
||||
if (len != sizeof(kernel_modver)) {
|
||||
syslog(LOG_ERR, "invalid version negotiation");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
kernel_modver = *(__u32 *)vss_msg;
|
||||
in_handshake = 0;
|
||||
syslog(LOG_INFO, "VSS: kernel module version: %d",
|
||||
kernel_modver);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (len != sizeof(struct hv_vss_msg)) {
|
||||
syslog(LOG_ERR, "read failed; error:%d %s",
|
||||
errno, strerror(errno));
|
||||
close(vss_fd);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
op = vss_msg->vss_hdr.operation;
|
||||
error = HV_S_OK;
|
||||
|
||||
switch (op) {
|
||||
case VSS_OP_FREEZE:
|
||||
case VSS_OP_THAW:
|
||||
error = vss_operate(op);
|
||||
syslog(LOG_INFO, "VSS: op=%s: %s\n",
|
||||
op == VSS_OP_FREEZE ? "FREEZE" : "THAW",
|
||||
error ? "failed" : "succeeded");
|
||||
|
||||
if (error) {
|
||||
error = HV_E_FAIL;
|
||||
syslog(LOG_ERR, "op=%d failed!", op);
|
||||
syslog(LOG_ERR, "report it with these files:");
|
||||
syslog(LOG_ERR, "/etc/fstab and /proc/mounts");
|
||||
}
|
||||
break;
|
||||
case VSS_OP_HOT_BACKUP:
|
||||
syslog(LOG_INFO, "VSS: op=CHECK HOT BACKUP\n");
|
||||
break;
|
||||
default:
|
||||
syslog(LOG_ERR, "Illegal op:%d\n", op);
|
||||
}
|
||||
vss_msg->error = error;
|
||||
len = write(vss_fd, vss_msg, sizeof(struct hv_vss_msg));
|
||||
if (len != sizeof(struct hv_vss_msg)) {
|
||||
syslog(LOG_ERR, "write failed; error: %d %s", errno,
|
||||
strerror(errno));
|
||||
|
||||
if (op == VSS_OP_FREEZE)
|
||||
vss_operate(VSS_OP_THAW);
|
||||
}
|
||||
}
|
||||
|
||||
close(vss_fd);
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="misc", KERNEL=="vmbus/hv_fcopy", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hypervfcopyd.service"
|
@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Hyper-V FCOPY daemon
|
||||
BindsTo=sys-devices-virtual-misc-vmbus\x21hv_fcopy.device
|
||||
IgnoreOnIsolate=1
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/hypervfcopyd -n
|
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="misc", KERNEL=="vmbus/hv_kvp", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hypervkvpd.service"
|
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Hyper-V KVP daemon
|
||||
ConditionVirtualization=microsoft
|
||||
BindsTo=sys-devices-virtual-misc-vmbus\x21hv_kvp.device
|
||||
After=sys-devices-virtual-misc-vmbus\x21hv_kvp.device
|
||||
RequiresMountsFor=/var/lib/hyperv
|
||||
Before=cloud-init-local.service
|
||||
IgnoreOnIsolate=1
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/hypervkvpd -n
|
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="misc", KERNEL=="vmbus/hv_vss", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hypervvssd.service"
|
@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Hyper-V VSS daemon
|
||||
BindsTo=sys-devices-virtual-misc-vmbus\x21hv_vss.device
|
||||
IgnoreOnIsolate=1
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/hypervvssd -n
|
@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env python
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
import os
|
||||
from optparse import OptionParser
|
||||
|
||||
help_msg = "print verbose messages. Try -vv, -vvv for more verbose messages"
|
||||
parser = OptionParser()
|
||||
parser.add_option(
|
||||
"-v", "--verbose", dest="verbose", help=help_msg, action="count")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
verbose = 0
|
||||
if options.verbose is not None:
|
||||
verbose = options.verbose
|
||||
|
||||
vmbus_sys_path = '/sys/bus/vmbus/devices'
|
||||
if not os.path.isdir(vmbus_sys_path):
|
||||
print("%s doesn't exist: exiting..." % vmbus_sys_path)
|
||||
exit(-1)
|
||||
|
||||
vmbus_dev_dict = {
|
||||
'{0e0b6031-5213-4934-818b-38d90ced39db}': '[Operating system shutdown]',
|
||||
'{9527e630-d0ae-497b-adce-e80ab0175caf}': '[Time Synchronization]',
|
||||
'{57164f39-9115-4e78-ab55-382f3bd5422d}': '[Heartbeat]',
|
||||
'{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}': '[Data Exchange]',
|
||||
'{35fa2e29-ea23-4236-96ae-3a6ebacba440}': '[Backup (volume checkpoint)]',
|
||||
'{34d14be3-dee4-41c8-9ae7-6b174977c192}': '[Guest services]',
|
||||
'{525074dc-8985-46e2-8057-a307dc18a502}': '[Dynamic Memory]',
|
||||
'{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}': 'Synthetic mouse',
|
||||
'{f912ad6d-2b17-48ea-bd65-f927a61c7684}': 'Synthetic keyboard',
|
||||
'{da0a7802-e377-4aac-8e77-0558eb1073f8}': 'Synthetic framebuffer adapter',
|
||||
'{f8615163-df3e-46c5-913f-f2d2f965ed0e}': 'Synthetic network adapter',
|
||||
'{32412632-86cb-44a2-9b5c-50d1417354f5}': 'Synthetic IDE Controller',
|
||||
'{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}': 'Synthetic SCSI Controller',
|
||||
'{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}': 'Synthetic fiber channel adapter',
|
||||
'{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}': 'Synthetic RDMA adapter',
|
||||
'{44c4f61d-4444-4400-9d52-802e27ede19f}': 'PCI Express pass-through',
|
||||
'{276aacf4-ac15-426c-98dd-7521ad3f01fe}': '[Reserved system device]',
|
||||
'{f8e65716-3cb3-4a06-9a60-1889c5cccab5}': '[Reserved system device]',
|
||||
'{3375baf4-9e15-4b30-b765-67acb10d607b}': '[Reserved system device]',
|
||||
}
|
||||
|
||||
|
||||
def get_vmbus_dev_attr(dev_name, attr):
|
||||
try:
|
||||
f = open('%s/%s/%s' % (vmbus_sys_path, dev_name, attr), 'r')
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
except IOError:
|
||||
lines = []
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
class VMBus_Dev:
|
||||
pass
|
||||
|
||||
|
||||
vmbus_dev_list = []
|
||||
|
||||
for f in os.listdir(vmbus_sys_path):
|
||||
vmbus_id = get_vmbus_dev_attr(f, 'id')[0].strip()
|
||||
class_id = get_vmbus_dev_attr(f, 'class_id')[0].strip()
|
||||
device_id = get_vmbus_dev_attr(f, 'device_id')[0].strip()
|
||||
dev_desc = vmbus_dev_dict.get(class_id, 'Unknown')
|
||||
|
||||
chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')
|
||||
chn_vp_mapping = [c.strip() for c in chn_vp_mapping]
|
||||
chn_vp_mapping = sorted(
|
||||
chn_vp_mapping, key=lambda c: int(c.split(':')[0]))
|
||||
|
||||
chn_vp_mapping = [
|
||||
'\tRel_ID=%s, target_cpu=%s' %
|
||||
(c.split(':')[0], c.split(':')[1]) for c in chn_vp_mapping
|
||||
]
|
||||
d = VMBus_Dev()
|
||||
d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)
|
||||
d.vmbus_id = vmbus_id
|
||||
d.class_id = class_id
|
||||
d.device_id = device_id
|
||||
d.dev_desc = dev_desc
|
||||
d.chn_vp_mapping = '\n'.join(chn_vp_mapping)
|
||||
if d.chn_vp_mapping:
|
||||
d.chn_vp_mapping += '\n'
|
||||
|
||||
vmbus_dev_list.append(d)
|
||||
|
||||
|
||||
vmbus_dev_list = sorted(vmbus_dev_list, key=lambda d: int(d.vmbus_id))
|
||||
|
||||
format0 = '%2s: %s'
|
||||
format1 = '%2s: Class_ID = %s - %s\n%s'
|
||||
format2 = '%2s: Class_ID = %s - %s\n\tDevice_ID = %s\n\tSysfs path: %s\n%s'
|
||||
|
||||
for d in vmbus_dev_list:
|
||||
if verbose == 0:
|
||||
print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))
|
||||
elif verbose == 1:
|
||||
print(
|
||||
('VMBUS ID ' + format1) %
|
||||
(d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping)
|
||||
)
|
||||
else:
|
||||
print(
|
||||
('VMBUS ID ' + format2) %
|
||||
(
|
||||
d.vmbus_id, d.class_id, d.dev_desc,
|
||||
d.device_id, d.sysfs_path, d.chn_vp_mapping
|
||||
)
|
||||
)
|
@ -0,0 +1,423 @@
|
||||
# Hyper-V KVP daemon binary name
|
||||
%global hv_kvp_daemon hypervkvpd
|
||||
# Hyper-V VSS daemon binary name
|
||||
%global hv_vss_daemon hypervvssd
|
||||
# Hyper-V FCOPY daemon binary name
|
||||
%global hv_fcopy_daemon hypervfcopyd
|
||||
# snapshot version
|
||||
%global snapver .20190303git
|
||||
# use hardened build
|
||||
%global _hardened_build 1
|
||||
# udev rules prefix
|
||||
%global udev_prefix 70
|
||||
|
||||
Name: hyperv-daemons
|
||||
Version: 0
|
||||
Release: 0.40%{?snapver}%{?dist}
|
||||
Summary: Hyper-V daemons suite
|
||||
|
||||
License: GPLv2
|
||||
URL: http://www.kernel.org
|
||||
|
||||
# Source files obtained from kernel upstream 4.17-rc1 (60cc43fc888428bb2f18f08997432d426a243338)
|
||||
# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
|
||||
Source0: COPYING
|
||||
|
||||
# HYPERV KVP DAEMON
|
||||
Source1: hv_kvp_daemon.c
|
||||
Source2: hv_get_dhcp_info.sh
|
||||
Source3: hv_get_dns_info.sh
|
||||
Source4: hv_set_ifconfig.sh
|
||||
Source5: hypervkvpd.service
|
||||
Source6: hypervkvp.rules
|
||||
|
||||
# HYPERV VSS DAEMON
|
||||
Source100: hv_vss_daemon.c
|
||||
Source101: hypervvssd.service
|
||||
Source102: hypervvss.rules
|
||||
|
||||
# HYPERV FCOPY DAEMON
|
||||
Source200: hv_fcopy_daemon.c
|
||||
Source201: hypervfcopyd.service
|
||||
Source202: hypervfcopy.rules
|
||||
|
||||
# HYPERV TOOLS
|
||||
Source301: lsvmbus
|
||||
|
||||
Patch0002: 0002-Do-not-set-NM_CONTROLLED-no.patch
|
||||
Patch0004: 0004-Update-C-files-and-scripts-to-kernel-version-5.7-rc1.patch
|
||||
Patch0005: 0005-Add-vmbus_testing-tool-build-files.patch
|
||||
Patch0006: 0006-tools-hv-change-http-to-https-in-hv_kvp_daemon.c.patch
|
||||
# For bz#2026371 - [RHEL9][Hyper-V]The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9
|
||||
Patch7: hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch
|
||||
# For bz#2026371 - [RHEL9][Hyper-V]The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9
|
||||
Patch8: hpvd-Use-filename-for-connection-profile.patch
|
||||
|
||||
# Source-git patches
|
||||
|
||||
# Hyper-V is available only on x86 and aarch64 architectures
|
||||
# The base empty (a.k.a. virtual) package can not be noarch
|
||||
# due to http://www.rpm.org/ticket/78
|
||||
ExclusiveArch: i686 x86_64 aarch64
|
||||
|
||||
Requires: hypervkvpd = %{version}-%{release}
|
||||
Requires: hypervvssd = %{version}-%{release}
|
||||
Requires: hypervfcopyd = %{version}-%{release}
|
||||
BuildRequires: gcc
|
||||
|
||||
|
||||
%description
|
||||
Suite of daemons that are needed when Linux guest
|
||||
is running on Windows Host with Hyper-V.
|
||||
|
||||
|
||||
%package -n hypervkvpd
|
||||
Summary: Hyper-V key value pair (KVP) daemon
|
||||
Requires: %{name}-license = %{version}-%{release}
|
||||
BuildRequires: systemd, kernel-headers
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
|
||||
%description -n hypervkvpd
|
||||
Hypervkvpd is an implementation of Hyper-V key value pair (KVP)
|
||||
functionality for Linux. The daemon first registers with the
|
||||
kernel driver. After this is done it collects information
|
||||
requested by Windows Host about the Linux Guest. It also supports
|
||||
IP injection functionality on the Guest.
|
||||
|
||||
|
||||
%package -n hypervvssd
|
||||
Summary: Hyper-V VSS daemon
|
||||
Requires: %{name}-license = %{version}-%{release}
|
||||
BuildRequires: systemd, kernel-headers
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
|
||||
%description -n hypervvssd
|
||||
Hypervvssd is an implementation of Hyper-V VSS functionality
|
||||
for Linux. The daemon is used for host initiated guest snapshot
|
||||
on Hyper-V hypervisor. The daemon first registers with the
|
||||
kernel driver. After this is done it waits for instructions
|
||||
from Windows Host if to "freeze" or "thaw" the filesystem
|
||||
on the Linux Guest.
|
||||
|
||||
|
||||
%package -n hypervfcopyd
|
||||
Summary: Hyper-V FCOPY daemon
|
||||
Requires: %{name}-license = %{version}-%{release}
|
||||
BuildRequires: systemd, kernel-headers
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
|
||||
%description -n hypervfcopyd
|
||||
Hypervfcopyd is an implementation of file copy service functionality
|
||||
for Linux Guest running on Hyper-V. The daemon enables host to copy
|
||||
a file (over VMBUS) into the Linux Guest. The daemon first registers
|
||||
with the kernel driver. After this is done it waits for instructions
|
||||
from Windows Host.
|
||||
|
||||
|
||||
%package license
|
||||
Summary: License of the Hyper-V daemons suite
|
||||
BuildArch: noarch
|
||||
|
||||
%description license
|
||||
Contains license of the Hyper-V daemons suite.
|
||||
|
||||
%package -n hyperv-tools
|
||||
Summary: Tools for Hyper-V guests
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n hyperv-tools
|
||||
Contains tools and scripts useful for Hyper-V guests.
|
||||
|
||||
%prep
|
||||
%setup -Tc
|
||||
cp -pvL %{SOURCE0} COPYING
|
||||
|
||||
cp -pvL %{SOURCE1} hv_kvp_daemon.c
|
||||
cp -pvL %{SOURCE2} hv_get_dhcp_info.sh
|
||||
cp -pvL %{SOURCE3} hv_get_dns_info.sh
|
||||
cp -pvL %{SOURCE4} hv_set_ifconfig.sh
|
||||
cp -pvL %{SOURCE5} hypervkvpd.service
|
||||
cp -pvL %{SOURCE6} hypervkvp.rules
|
||||
cp -pvL %{SOURCE100} hv_vss_daemon.c
|
||||
cp -pvL %{SOURCE101} hypervvssd.service
|
||||
cp -pvL %{SOURCE102} hypervvss.rules
|
||||
cp -pvL %{SOURCE200} hv_fcopy_daemon.c
|
||||
cp -pvL %{SOURCE201} hypervfcopyd.service
|
||||
cp -pvL %{SOURCE202} hypervfcopy.rules
|
||||
|
||||
cp -pvL %{SOURCE301} lsvmbus
|
||||
|
||||
%patch0002 -p1
|
||||
%patch0004 -p1
|
||||
%patch0005 -p1
|
||||
%patch0006 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
|
||||
%build
|
||||
# HYPERV KVP DAEMON
|
||||
%{__cc} $RPM_OPT_FLAGS -c hv_kvp_daemon.c
|
||||
%{__cc} $RPM_LD_FLAGS hv_kvp_daemon.o -o %{hv_kvp_daemon}
|
||||
|
||||
# HYPERV VSS DAEMON
|
||||
%{__cc} $RPM_OPT_FLAGS -c hv_vss_daemon.c
|
||||
%{__cc} $RPM_LD_FLAGS hv_vss_daemon.o -o %{hv_vss_daemon}
|
||||
|
||||
# HYPERV FCOPY DAEMON
|
||||
%{__cc} $RPM_OPT_FLAGS -c hv_fcopy_daemon.c
|
||||
%{__cc} $RPM_LD_FLAGS hv_fcopy_daemon.o -o %{hv_fcopy_daemon}
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
install -p -m 0755 %{hv_kvp_daemon} %{buildroot}%{_sbindir}
|
||||
install -p -m 0755 %{hv_vss_daemon} %{buildroot}%{_sbindir}
|
||||
install -p -m 0755 %{hv_fcopy_daemon} %{buildroot}%{_sbindir}
|
||||
# Systemd unit file
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
install -p -m 0644 hypervkvpd.service %{buildroot}%{_unitdir}
|
||||
install -p -m 0644 hypervvssd.service %{buildroot}%{_unitdir}
|
||||
install -p -m 0644 hypervfcopyd.service %{buildroot}%{_unitdir}
|
||||
# Udev rules
|
||||
mkdir -p %{buildroot}%{_udevrulesdir}
|
||||
install -p -m 0644 hypervkvp.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
|
||||
install -p -m 0644 hypervvss.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
|
||||
install -p -m 0644 hypervfcopy.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
|
||||
# Shell scripts for the KVP daemon
|
||||
mkdir -p %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}
|
||||
install -p -m 0755 hv_get_dhcp_info.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dhcp_info
|
||||
install -p -m 0755 hv_get_dns_info.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dns_info
|
||||
install -p -m 0755 hv_set_ifconfig.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_set_ifconfig
|
||||
# Directory for pool files
|
||||
mkdir -p %{buildroot}%{_sharedstatedir}/hyperv
|
||||
|
||||
# Tools
|
||||
install -p -m 0755 lsvmbus %{buildroot}%{_sbindir}/
|
||||
sed -i 's,#!/usr/bin/env python,#!%{__python3},' %{buildroot}%{_sbindir}/lsvmbus
|
||||
install -p -m 0755 vmbus_testing %{buildroot}%{_sbindir}/
|
||||
|
||||
%post -n hypervkvpd
|
||||
if [ $1 -gt 1 ] ; then
|
||||
# Upgrade
|
||||
systemctl --no-reload disable hypervkvpd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%preun -n hypervkvpd
|
||||
%systemd_preun hypervkvpd.service
|
||||
|
||||
%postun -n hypervkvpd
|
||||
# hypervkvpd daemon does NOT support restarting (driver, neither)
|
||||
%systemd_postun hypervkvpd.service
|
||||
# If removing the package, delete %%{_sharedstatedir}/hyperv directory
|
||||
if [ "$1" -eq "0" ] ; then
|
||||
rm -rf %{_sharedstatedir}/hyperv || :
|
||||
fi
|
||||
|
||||
|
||||
%post -n hypervvssd
|
||||
if [ $1 -gt 1 ] ; then
|
||||
# Upgrade
|
||||
systemctl --no-reload disable hypervvssd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%postun -n hypervvssd
|
||||
%systemd_postun hypervvssd.service
|
||||
|
||||
%preun -n hypervvssd
|
||||
%systemd_preun hypervvssd.service
|
||||
|
||||
|
||||
%post -n hypervfcopyd
|
||||
if [ $1 -gt 1 ] ; then
|
||||
# Upgrade
|
||||
systemctl --no-reload disable hypervfcopyd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%postun -n hypervfcopyd
|
||||
%systemd_postun hypervfcopyd.service
|
||||
|
||||
%preun -n hypervfcopyd
|
||||
%systemd_preun hypervfcopyd.service
|
||||
|
||||
|
||||
%files
|
||||
# the base package does not contain any files.
|
||||
|
||||
%files -n hypervkvpd
|
||||
%{_sbindir}/%{hv_kvp_daemon}
|
||||
%{_unitdir}/hypervkvpd.service
|
||||
%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
|
||||
%dir %{_libexecdir}/%{hv_kvp_daemon}
|
||||
%{_libexecdir}/%{hv_kvp_daemon}/*
|
||||
%dir %{_sharedstatedir}/hyperv
|
||||
|
||||
%files -n hypervvssd
|
||||
%{_sbindir}/%{hv_vss_daemon}
|
||||
%{_unitdir}/hypervvssd.service
|
||||
%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
|
||||
|
||||
%files -n hypervfcopyd
|
||||
%{_sbindir}/%{hv_fcopy_daemon}
|
||||
%{_unitdir}/hypervfcopyd.service
|
||||
%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
|
||||
|
||||
%files license
|
||||
%doc COPYING
|
||||
|
||||
%files -n hyperv-tools
|
||||
%{_sbindir}/lsvmbus
|
||||
%{_sbindir}/vmbus_testing
|
||||
|
||||
%changelog
|
||||
* Fri Jul 29 2022 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.40.20190303git
|
||||
- hpvd-hypervkvpd.service-ordering-fixes.patch [bz#2103188]
|
||||
- Resolves: bz#2103188
|
||||
([Hyper-V][RHEL-9] hypervkvpd.service service ordering)
|
||||
|
||||
* Wed Dec 15 2021 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.39.20190303git
|
||||
- hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch [bz#2026371]
|
||||
- hpvd-Use-filename-for-connection-profile.patch [bz#2026371]
|
||||
- Resolves: bz#2026371
|
||||
([RHEL9][Hyper-V]The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9)
|
||||
|
||||
* Mon Nov 08 2021 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.38.20190303git
|
||||
- hpvd-Enable-build-on-aarch64.patch [bz#2020148]
|
||||
- Resolves: bz#2020148
|
||||
([Hyper-V][RHEL9.0][ARM] No hyperv-daemons package built for aarch64 platform)
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0-0.37.20190303git
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Mon May 10 2021 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.36.20190303git
|
||||
- Synchronize RHEL 8 changes [rhbz#1957651]
|
||||
- Resolves: rhbz#1957651
|
||||
([Hyper-V][RHEL-9] Update build to rhel format and syncup RHEL 8 content for hyperv-daemons.)
|
||||
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0-0.35.20190303git
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.34.20190303git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.33.20190303git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.32.20190303git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Wed Jan 15 2020 Tom Stellard <tstellar@redhat.com> - 0-0.31.20190303git
|
||||
- Use __cc macro instead of hard-coding gcc
|
||||
|
||||
* Fri Nov 08 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.30.20190303git
|
||||
- Rebase to 5.4-rc6
|
||||
- Add IgnoreOnIsolate to systemd units
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.29.20190303git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Fri Mar 15 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.28.20190303git
|
||||
- Rebase to 5.0
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.27.20180415git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.26.20180415git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Mon Jun 11 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.25.20180415git
|
||||
- Switch lsvmbus to Python3
|
||||
|
||||
* Thu Apr 26 2018 Tomas Hozza <thozza@redhat.com> - 0-0.24.20180415git
|
||||
- Added gcc as an explicit BuildRequires
|
||||
|
||||
* Thu Apr 19 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.23.20180415git
|
||||
- Rebase to 4.17-rc1
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.22.20170105git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Mon Dec 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.21.20170105git
|
||||
- Rebase to 4.15-rc2, drop fedora patches as changes are upstream
|
||||
- Start kvpd after network.target
|
||||
|
||||
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20.20170105git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.19.20170105git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.18.20170105git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Wed Jan 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.17.20160728git
|
||||
- Use '-gt' instead of '>' to do the right comparison (#1412033)
|
||||
|
||||
* Thu Jan 05 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.16.20160728git
|
||||
- Rebase to 4.9
|
||||
- hyperv-tools subpackage added
|
||||
|
||||
* Thu Jul 28 2016 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.15.20160728git
|
||||
- Rebase to 4.8-rc0 (20160728 git snapshot)
|
||||
- Disable services and remove ConditionVirtualization, multi-user.target
|
||||
dependencies switching to udev-only activation (#1331577)
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.14.20150702git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Wed Nov 18 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.13.20150702git
|
||||
- Add udev rules to properly restart services (#1195029)
|
||||
- Spec cleanup
|
||||
|
||||
* Thu Jul 02 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.12.20150702git
|
||||
- Rebase to 4.2-rc0 (20150702 git snapshot)
|
||||
- Switch to new chardev-based communication layer (#1195029)
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.11.20150108git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* 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
|
||||
|
||||
* Mon Jul 14 2014 Tomas Hozza <thozza@redhat.com> - 0-0.8.20140714git
|
||||
- Update the File copy daemon to the latest git snapshot
|
||||
- Fix hyperfcopyd.service to check for /dev/vmbus/hv_fcopy
|
||||
|
||||
* Wed Jun 11 2014 Tomas Hozza <thozza@redhat.com> - 0-0.7.20140611git
|
||||
- Fix FTBFS (#1106781)
|
||||
- Use kernel-headers instead of kernel-devel for building
|
||||
- package new Hyper-V fcopy daemon as hypervfcopyd sub-package
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.20140219git
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Wed Feb 19 2014 Tomas Hozza <thozza@redhat.com> - 0-0.5.20140219git
|
||||
- rebase to the latest git snapshot next-20140219
|
||||
- KVP, VSS: removed inclusion of linux/types.h
|
||||
- VSS: Ignore VFAT mounts during freeze operation
|
||||
|
||||
* Fri Jan 10 2014 Tomas Hozza <thozza@redhat.com> - 0-0.4.20131022git
|
||||
- provide 'hyperv-daemons' package for convenient installation of all daemons
|
||||
|
||||
* Tue Oct 22 2013 Tomas Hozza <thozza@redhat.com> - 0-0.3.20131022git
|
||||
- rebase to the latest git snapshot next-20130927 (obtained 2013-10-22)
|
||||
- KVP, VSS: daemon use single buffer for send/recv
|
||||
- KVP: FQDN is obtained on start and cached
|
||||
|
||||
* Fri Sep 20 2013 Tomas Hozza <thozza@redhat.com> - 0-0.2.20130826git
|
||||
- Use 'hypervkvpd' directory in libexec for KVP daemon scripts (#1010268)
|
||||
- daemons are now WantedBy multi-user.target instead of basic.target (#1010260)
|
||||
|
||||
* Mon Aug 26 2013 Tomas Hozza <thozza@redhat.com> - 0-0.1.20130826git
|
||||
- Initial package
|
Loading…
Reference in new issue