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
7460F: drivers/scsi/storvsc_drv.c7460F: drivers/scsi/storvsc_drv.c
7461F: drivers/uio/uio_hv_generic.c7461F: drivers/uio/uio_hv_generic.c
7462F: drivers/video/fbdev/hyperv_fb.c7462F: drivers/video/fbdev/hyperv_fb.c
7463F: drivers/iommu/hyperv_iommu.c7463F: drivers/iommu/hyperv-iommu.c
7464F: net/vmw_vsock/hyperv_transport.c7464F: net/vmw_vsock/hyperv_transport.c
7465F: include/clocksource/hyperv_timer.h7465F: include/clocksource/hyperv_timer.h
7466F: include/linux/hyperv.h7466F: include/linux/hyperv.h
drivers/hv/hv_trace.h+1−1
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.01/* SPDX-License-Identifier: GPL-2.0 */
2 2
3#undef TRACE_SYSTEM3#undef TRACE_SYSTEM
4#define TRACE_SYSTEM hyperv4#define TRACE_SYSTEM hyperv
tools/hv/hv_get_dhcp_info.sh+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
13# the script prints the string "Disabled" to stdout.13# the script prints the string "Disabled" to stdout.
14#14#
15# Each Distro is expected to implement this script in a distro specific15# 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,
17# this script can be based on the Network Manager APIs for retrieving DHCP17# this script can be based on the Network Manager APIs for retrieving DHCP
18# information.18# information.
19 19
tools/hv/hv_kvp_daemon.c+5−3
@@ -700,7 +700,7 @@ static void kvp_get_ipconfig_info(char *if_name, · 699 unmodified lines
700 700
701 701
702 /*702 /*
703 * Gather the DNS state.703 * Gather the DNS state.
704 * Since there is no standard way to get this information704 * Since there is no standard way to get this information
705 * across various distributions of interest; we just invoke705 * across various distributions of interest; we just invoke
706 * an external script that needs to be ported across distros706 * 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
1051 char *start;1051 char *start;
1052 1052
1053 /*1053 /*
1054 * in_buf has sequence of characters that are seperated by1054 * in_buf has sequence of characters that are separated by
1055 * the character ';'. The last sequence does not have the1055 * the character ';'. The last sequence does not have the
1056 * terminating ";" character.1056 * terminating ";" character.
1057 */1057 */
@@ -1386,6 +1386,8 @@ int main(int argc, char *argv[]) · 328 unmodified lines
1386 daemonize = 0;1386 daemonize = 0;
1387 break;1387 break;
1388 case 'h':1388 case 'h':
1389 print_usage(argv);
1390 exit(0);
1389 default:1391 default:
1390 print_usage(argv);1392 print_usage(argv);
1391 exit(EXIT_FAILURE);1393 exit(EXIT_FAILURE);
@@ -1490,7 +1492,7 @@ int main(int argc, char *argv[]) · 98 unmodified lines
1490 case KVP_OP_GET_IP_INFO:1492 case KVP_OP_GET_IP_INFO:
1491 kvp_ip_val = &hv_msg->body.kvp_ip_val;1493 kvp_ip_val = &hv_msg->body.kvp_ip_val;
1492 1494
1493 error = kvp_mac_to_ip(kvp_ip_val);1495 error = kvp_mac_to_ip(kvp_ip_val);
1494 1496
1495 if (error)1497 if (error)
1496 hv_msg->error = error;1498 hv_msg->error = error;
tools/hv/hv_set_ifconfig.sh+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
12# be used to configure the interface.12# be used to configure the interface.
13#13#
14# Each Distro is expected to implement this script in a distro specific14# 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,
16# this script can be based on the Network Manager APIs for configuring the16# this script can be based on the Network Manager APIs for configuring the
17# interface.17# interface.
18#18#
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
42 * If a partition is mounted more than once, only the first42 * If a partition is mounted more than once, only the first
43 * FREEZE/THAW can succeed and the later ones will get43 * FREEZE/THAW can succeed and the later ones will get
44 * EBUSY/EINVAL respectively: there could be 2 cases:44 * EBUSY/EINVAL respectively: there could be 2 cases:
45 * 1) a user may mount the same partition to differnt directories45 * 1) a user may mount the same partition to different directories
46 * by mistake or on purpose;46 * by mistake or on purpose;
47 * 2) The subvolume of btrfs appears to have the same partition47 * 2) The subvolume of btrfs appears to have the same partition
48 * mounted more than once.48 * mounted more than once.
@@ -218,6 +218,8 @@ int main(int argc, char *argv[]) · 169 unmodified lines
218 daemonize = 0;218 daemonize = 0;
219 break;219 break;
220 case 'h':220 case 'h':
221 print_usage(argv);
222 exit(0);
221 default:223 default:
222 print_usage(argv);224 print_usage(argv);
223 exit(EXIT_FAILURE);225 exit(EXIT_FAILURE);
tools/hv/lsvmbus+42−33
@@ -4,10 +4,10 @@ · 3 unmodified lines
4import os4import os
5from optparse import OptionParser5from optparse import OptionParser
6 6
7help_msg = "print verbose messages. Try -vv, -vvv for more verbose messages"
7parser = OptionParser()8parser = OptionParser()
8parser.add_option("-v", "--verbose", dest="verbose",9parser.add_option(
9 help="print verbose messages. Try -vv, -vvv for \10 "-v", "--verbose", dest="verbose", help=help_msg, action="count")
10 more verbose messages", action="count")
11 11
12(options, args) = parser.parse_args()12(options, args) = parser.parse_args()
13 13
@@ -21,27 +21,28 @@ if not os.path.isdir(vmbus_sys_path): · 7 unmodified lines
21 exit(-1)21 exit(-1)
22 22
23vmbus_dev_dict = {23vmbus_dev_dict = {
24 '{0e0b6031-5213-4934-818b-38d90ced39db}' : '[Operating system shutdown]',24 '{0e0b6031-5213-4934-818b-38d90ced39db}': '[Operating system shutdown]',
25 '{9527e630-d0ae-497b-adce-e80ab0175caf}' : '[Time Synchronization]',25 '{9527e630-d0ae-497b-adce-e80ab0175caf}': '[Time Synchronization]',
26 '{57164f39-9115-4e78-ab55-382f3bd5422d}' : '[Heartbeat]',26 '{57164f39-9115-4e78-ab55-382f3bd5422d}': '[Heartbeat]',
27 '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}' : '[Data Exchange]',27 '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}': '[Data Exchange]',
28 '{35fa2e29-ea23-4236-96ae-3a6ebacba440}' : '[Backup (volume checkpoint)]',28 '{35fa2e29-ea23-4236-96ae-3a6ebacba440}': '[Backup (volume checkpoint)]',
29 '{34d14be3-dee4-41c8-9ae7-6b174977c192}' : '[Guest services]',29 '{34d14be3-dee4-41c8-9ae7-6b174977c192}': '[Guest services]',
30 '{525074dc-8985-46e2-8057-a307dc18a502}' : '[Dynamic Memory]',30 '{525074dc-8985-46e2-8057-a307dc18a502}': '[Dynamic Memory]',
31 '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}' : 'Synthetic mouse',31 '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}': 'Synthetic mouse',
32 '{f912ad6d-2b17-48ea-bd65-f927a61c7684}' : 'Synthetic keyboard',32 '{f912ad6d-2b17-48ea-bd65-f927a61c7684}': 'Synthetic keyboard',
33 '{da0a7802-e377-4aac-8e77-0558eb1073f8}' : 'Synthetic framebuffer adapter',33 '{da0a7802-e377-4aac-8e77-0558eb1073f8}': 'Synthetic framebuffer adapter',
34 '{f8615163-df3e-46c5-913f-f2d2f965ed0e}' : 'Synthetic network adapter',34 '{f8615163-df3e-46c5-913f-f2d2f965ed0e}': 'Synthetic network adapter',
35 '{32412632-86cb-44a2-9b5c-50d1417354f5}' : 'Synthetic IDE Controller',35 '{32412632-86cb-44a2-9b5c-50d1417354f5}': 'Synthetic IDE Controller',
36 '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}' : 'Synthetic SCSI Controller',36 '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}': 'Synthetic SCSI Controller',
37 '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}' : 'Synthetic fiber channel adapter',37 '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}': 'Synthetic fiber channel adapter',
38 '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}' : 'Synthetic RDMA adapter',38 '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}': 'Synthetic RDMA adapter',
39 '{44c4f61d-4444-4400-9d52-802e27ede19f}' : 'PCI Express pass-through',39 '{44c4f61d-4444-4400-9d52-802e27ede19f}': 'PCI Express pass-through',
40 '{276aacf4-ac15-426c-98dd-7521ad3f01fe}' : '[Reserved system device]',40 '{276aacf4-ac15-426c-98dd-7521ad3f01fe}': '[Reserved system device]',
41 '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}' : '[Reserved system device]',41 '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}': '[Reserved system device]',
42 '{3375baf4-9e15-4b30-b765-67acb10d607b}' : '[Reserved system device]',42 '{3375baf4-9e15-4b30-b765-67acb10d607b}': '[Reserved system device]',
43}43}
44 44
45
45def get_vmbus_dev_attr(dev_name, attr):46def get_vmbus_dev_attr(dev_name, attr):
46 try:47 try:
47 f = open('%s/%s/%s' % (vmbus_sys_path, dev_name, attr), 'r')48 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
52 53
53 return lines54 return lines
54 55
56
55class VMBus_Dev:57class VMBus_Dev:
56 pass58 pass
57 59
@@ -66,12 +68,13 @@ for f in os.listdir(vmbus_sys_path): · 8 unmodified lines
66 68
67 chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')69 chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')
68 chn_vp_mapping = [c.strip() for c in chn_vp_mapping]70 chn_vp_mapping = [c.strip() for c in chn_vp_mapping]
69 chn_vp_mapping = sorted(chn_vp_mapping,71 chn_vp_mapping = sorted(
70 key = lambda c : int(c.split(':')[0]))72 chn_vp_mapping, key=lambda c: int(c.split(':')[0]))
71 73
72 chn_vp_mapping = ['\tRel_ID=%s, target_cpu=%s' %74 chn_vp_mapping = [
73 (c.split(':')[0], c.split(':')[1])75 '\tRel_ID=%s, target_cpu=%s' %
74 for c in chn_vp_mapping]76 (c.split(':')[0], c.split(':')[1]) for c in chn_vp_mapping
77 ]
75 d = VMBus_Dev()78 d = VMBus_Dev()
76 d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)79 d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)
77 d.vmbus_id = vmbus_id80 d.vmbus_id = vmbus_id
@@ -85,7 +88,7 @@ for f in os.listdir(vmbus_sys_path): · 7 unmodified lines
85 vmbus_dev_list.append(d)88 vmbus_dev_list.append(d)
86 89
87 90
88vmbus_dev_list = sorted(vmbus_dev_list, key = lambda d : int(d.vmbus_id))91vmbus_dev_list = sorted(vmbus_dev_list, key=lambda d: int(d.vmbus_id))
89 92
90format0 = '%2s: %s'93format0 = '%2s: %s'
91format1 = '%2s: Class_ID = %s - %s\n%s'94format1 = '%2s: Class_ID = %s - %s\n%s'
@@ -95,9 +98,15 @@ for d in vmbus_dev_list: · 3 unmodified lines
95 if verbose == 0:98 if verbose == 0:
96 print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))99 print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))
97 elif verbose == 1:100 elif verbose == 1:
98 print (('VMBUS ID ' + format1) % \101 print(
99 (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping))102 ('VMBUS ID ' + format1) %
103 (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping)
104 )
100 else:105 else:
101 print (('VMBUS ID ' + format2) % \106 print(
102 (d.vmbus_id, d.class_id, d.dev_desc, \107 ('VMBUS ID ' + format2) %
103 d.device_id, d.sysfs_path, d.chn_vp_mapping))108 (
109 d.vmbus_id, d.class_id, d.dev_desc,
110 d.device_id, d.sysfs_path, d.chn_vp_mapping
111 )
112 )