History

Merge tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux

Pull Hyper-V fixes from Sasha Levin: - A few fixes for the userspace hyper-v tools from Adrian Vladu. - A fix for the hyper-v MAINTAINERs entry from Lan Tianyu. - Fix for SPDX license identifier in the userspace tools from Nishad Kamdar. * tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: MAINTAINERS: Fix Hyperv vIOMMU driver file name tools: hv: Use the correct style for SPDX License Identifier tools: hv: fix typos in toolchain tools: hv: fix KVP and VSS daemons exit code tools: hv: fixed Python pep8/flake8 warnings for lsvmbus

Linus Torvalds committed 7 years ago

Commit 85d8d3b2 parents 05c5253 bafe1e77 files · +54 −41Browse files

Unified · Split

7 files
  1. MAINTAINERS +1 −1
  2. drivers/hv/hv_trace.h +1 −1
  3. tools/hv/hv_get_dhcp_info.sh +1 −1
  4. tools/hv/hv_kvp_daemon.c +5 −3
  5. tools/hv/hv_set_ifconfig.sh +1 −1
  6. tools/hv/hv_vss_daemon.c +3 −1
  7. tools/hv/lsvmbus +42 −33
MAINTAINERS+1−1
@@ -7460,7 +7460,7 @@ F: drivers/net/hyperv/ · 7459 unmodified lines
74607460 F: drivers/scsi/storvsc_drv.c
74617461 F: drivers/uio/uio_hv_generic.c
74627462 F: drivers/video/fbdev/hyperv_fb.c
7463−F: drivers/iommu/hyperv_iommu.c
7463+F: drivers/iommu/hyperv-iommu.c
74647464 F: net/vmw_vsock/hyperv_transport.c
74657465 F: include/clocksource/hyperv_timer.h
74667466 F: include/linux/hyperv.h
drivers/hv/hv_trace.h+1−1
@@ -1,4 +1,4 @@
1−// SPDX-License-Identifier: GPL-2.0
1+/* SPDX-License-Identifier: GPL-2.0 */
22
33 #undef TRACE_SYSTEM
44 #define TRACE_SYSTEM hyperv
tools/hv/hv_get_dhcp_info.sh+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 # the script prints the string "Disabled" to stdout.
1414 #
1515 # Each Distro is expected to implement this script in a distro specific
16−# fashion. For instance on Distros that ship with Network Manager enabled,
16+# fashion. For instance, on Distros that ship with Network Manager enabled,
1717 # this script can be based on the Network Manager APIs for retrieving DHCP
1818 # information.
1919
tools/hv/hv_kvp_daemon.c+5−3
@@ -700,7 +700,7 @@ static void kvp_get_ipconfig_info(char *if_name, · 699 unmodified lines
700700
701701
702702 /*
703− * Gather the DNS state.
703+ * Gather the DNS state.
704704 * Since there is no standard way to get this information
705705 * across various distributions of interest; we just invoke
706706 * an external script that needs to be ported across distros
@@ -1051,7 +1051,7 @@ static int parse_ip_val_buffer(char *in_buf, int *offset, · 344 unmodified lines
10511051 char *start;
10521052
10531053 /*
1054− * in_buf has sequence of characters that are seperated by
1054+ * in_buf has sequence of characters that are separated by
10551055 * the character ';'. The last sequence does not have the
10561056 * terminating ";" character.
10571057 */
@@ -1386,6 +1386,8 @@ int main(int argc, char *argv[]) · 328 unmodified lines
13861386 daemonize = 0;
13871387 break;
13881388 case 'h':
1389+ print_usage(argv);
1390+ exit(0);
13891391 default:
13901392 print_usage(argv);
13911393 exit(EXIT_FAILURE);
@@ -1490,7 +1492,7 @@ int main(int argc, char *argv[]) · 98 unmodified lines
14901492 case KVP_OP_GET_IP_INFO:
14911493 kvp_ip_val = &hv_msg->body.kvp_ip_val;
14921494
1493− error = kvp_mac_to_ip(kvp_ip_val);
1495+ error = kvp_mac_to_ip(kvp_ip_val);
14941496
14951497 if (error)
14961498 hv_msg->error = error;
tools/hv/hv_set_ifconfig.sh+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 # be used to configure the interface.
1313 #
1414 # Each Distro is expected to implement this script in a distro specific
15−# fashion. For instance on Distros that ship with Network Manager enabled,
15+# fashion. For instance, on Distros that ship with Network Manager enabled,
1616 # this script can be based on the Network Manager APIs for configuring the
1717 # interface.
1818 #
tools/hv/hv_vss_daemon.c+3−1
@@ -42,7 +42,7 @@ static int vss_do_freeze(char *dir, unsigned int cmd) · 41 unmodified lines
4242 * If a partition is mounted more than once, only the first
4343 * FREEZE/THAW can succeed and the later ones will get
4444 * EBUSY/EINVAL respectively: there could be 2 cases:
45− * 1) a user may mount the same partition to differnt directories
45+ * 1) a user may mount the same partition to different directories
4646 * by mistake or on purpose;
4747 * 2) The subvolume of btrfs appears to have the same partition
4848 * mounted more than once.
@@ -218,6 +218,8 @@ int main(int argc, char *argv[]) · 169 unmodified lines
218218 daemonize = 0;
219219 break;
220220 case 'h':
221+ print_usage(argv);
222+ exit(0);
221223 default:
222224 print_usage(argv);
223225 exit(EXIT_FAILURE);
tools/hv/lsvmbus+42−33
@@ -4,10 +4,10 @@ · 3 unmodified lines
44 import os
55 from optparse import OptionParser
66
7+help_msg = "print verbose messages. Try -vv, -vvv for more verbose messages"
78 parser = OptionParser()
8−parser.add_option("-v", "--verbose", dest="verbose",
9− help="print verbose messages. Try -vv, -vvv for \
10− more verbose messages", action="count")
9+parser.add_option(
10+ "-v", "--verbose", dest="verbose", help=help_msg, action="count")
1111
1212 (options, args) = parser.parse_args()
1313
@@ -21,27 +21,28 @@ if not os.path.isdir(vmbus_sys_path): · 7 unmodified lines
2121 exit(-1)
2222
2323 vmbus_dev_dict = {
24− '{0e0b6031-5213-4934-818b-38d90ced39db}' : '[Operating system shutdown]',
25− '{9527e630-d0ae-497b-adce-e80ab0175caf}' : '[Time Synchronization]',
26− '{57164f39-9115-4e78-ab55-382f3bd5422d}' : '[Heartbeat]',
27− '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}' : '[Data Exchange]',
28− '{35fa2e29-ea23-4236-96ae-3a6ebacba440}' : '[Backup (volume checkpoint)]',
29− '{34d14be3-dee4-41c8-9ae7-6b174977c192}' : '[Guest services]',
30− '{525074dc-8985-46e2-8057-a307dc18a502}' : '[Dynamic Memory]',
31− '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}' : 'Synthetic mouse',
32− '{f912ad6d-2b17-48ea-bd65-f927a61c7684}' : 'Synthetic keyboard',
33− '{da0a7802-e377-4aac-8e77-0558eb1073f8}' : 'Synthetic framebuffer adapter',
34− '{f8615163-df3e-46c5-913f-f2d2f965ed0e}' : 'Synthetic network adapter',
35− '{32412632-86cb-44a2-9b5c-50d1417354f5}' : 'Synthetic IDE Controller',
36− '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}' : 'Synthetic SCSI Controller',
37− '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}' : 'Synthetic fiber channel adapter',
38− '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}' : 'Synthetic RDMA adapter',
39− '{44c4f61d-4444-4400-9d52-802e27ede19f}' : 'PCI Express pass-through',
40− '{276aacf4-ac15-426c-98dd-7521ad3f01fe}' : '[Reserved system device]',
41− '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}' : '[Reserved system device]',
42− '{3375baf4-9e15-4b30-b765-67acb10d607b}' : '[Reserved system device]',
24+ '{0e0b6031-5213-4934-818b-38d90ced39db}': '[Operating system shutdown]',
25+ '{9527e630-d0ae-497b-adce-e80ab0175caf}': '[Time Synchronization]',
26+ '{57164f39-9115-4e78-ab55-382f3bd5422d}': '[Heartbeat]',
27+ '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}': '[Data Exchange]',
28+ '{35fa2e29-ea23-4236-96ae-3a6ebacba440}': '[Backup (volume checkpoint)]',
29+ '{34d14be3-dee4-41c8-9ae7-6b174977c192}': '[Guest services]',
30+ '{525074dc-8985-46e2-8057-a307dc18a502}': '[Dynamic Memory]',
31+ '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}': 'Synthetic mouse',
32+ '{f912ad6d-2b17-48ea-bd65-f927a61c7684}': 'Synthetic keyboard',
33+ '{da0a7802-e377-4aac-8e77-0558eb1073f8}': 'Synthetic framebuffer adapter',
34+ '{f8615163-df3e-46c5-913f-f2d2f965ed0e}': 'Synthetic network adapter',
35+ '{32412632-86cb-44a2-9b5c-50d1417354f5}': 'Synthetic IDE Controller',
36+ '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}': 'Synthetic SCSI Controller',
37+ '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}': 'Synthetic fiber channel adapter',
38+ '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}': 'Synthetic RDMA adapter',
39+ '{44c4f61d-4444-4400-9d52-802e27ede19f}': 'PCI Express pass-through',
40+ '{276aacf4-ac15-426c-98dd-7521ad3f01fe}': '[Reserved system device]',
41+ '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}': '[Reserved system device]',
42+ '{3375baf4-9e15-4b30-b765-67acb10d607b}': '[Reserved system device]',
4343 }
4444
45+
4546 def get_vmbus_dev_attr(dev_name, attr):
4647 try:
4748 f = open('%s/%s/%s' % (vmbus_sys_path, dev_name, attr), 'r')
@@ -52,6 +53,7 @@ def get_vmbus_dev_attr(dev_name, attr): · 4 unmodified lines
5253
5354 return lines
5455
56+
5557 class VMBus_Dev:
5658 pass
5759
@@ -66,12 +68,13 @@ for f in os.listdir(vmbus_sys_path): · 8 unmodified lines
6668
6769 chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')
6870 chn_vp_mapping = [c.strip() for c in chn_vp_mapping]
69− chn_vp_mapping = sorted(chn_vp_mapping,
70− key = lambda c : int(c.split(':')[0]))
71+ chn_vp_mapping = sorted(
72+ chn_vp_mapping, key=lambda c: int(c.split(':')[0]))
7173
72− chn_vp_mapping = ['\tRel_ID=%s, target_cpu=%s' %
73− (c.split(':')[0], c.split(':')[1])
74− for c in chn_vp_mapping]
74+ chn_vp_mapping = [
75+ '\tRel_ID=%s, target_cpu=%s' %
76+ (c.split(':')[0], c.split(':')[1]) for c in chn_vp_mapping
77+ ]
7578 d = VMBus_Dev()
7679 d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)
7780 d.vmbus_id = vmbus_id
@@ -85,7 +88,7 @@ for f in os.listdir(vmbus_sys_path): · 7 unmodified lines
8588 vmbus_dev_list.append(d)
8689
8790
88−vmbus_dev_list = sorted(vmbus_dev_list, key = lambda d : int(d.vmbus_id))
91+vmbus_dev_list = sorted(vmbus_dev_list, key=lambda d: int(d.vmbus_id))
8992
9093 format0 = '%2s: %s'
9194 format1 = '%2s: Class_ID = %s - %s\n%s'
@@ -95,9 +98,15 @@ for d in vmbus_dev_list: · 3 unmodified lines
9598 if verbose == 0:
9699 print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))
97100 elif verbose == 1:
98− print (('VMBUS ID ' + format1) % \
99− (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping))
101+ print(
102+ ('VMBUS ID ' + format1) %
103+ (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping)
104+ )
100105 else:
101− print (('VMBUS ID ' + format2) % \
102− (d.vmbus_id, d.class_id, d.dev_desc, \
103− d.device_id, d.sysfs_path, d.chn_vp_mapping))
106+ print(
107+ ('VMBUS ID ' + format2) %
108+ (
109+ d.vmbus_id, d.class_id, d.dev_desc,
110+ d.device_id, d.sysfs_path, d.chn_vp_mapping
111+ )
112+ )