kvm-guest-drivers-windows
76 строк · 1.7 Кб
1:: Example of accessing NetKvm internals via WMI commands:
2@echo off
3if "%1"=="" goto help
4if /i "%1"=="debug" goto debug
5if /i "%1"=="cfg" goto cfg
6if /i "%1"=="stat" goto stat
7if /i "%1"=="reset" goto reset
8if /i "%1"=="rss" goto rss_set
9if /i "%1"=="tx" goto tx
10if /i "%1"=="rx" goto rx
11
12goto help
13:debug
14call :dowmic netkvm_logging set level=%2
15goto :eof
16
17:cfg
18call :dowmic netkvm_config get /value
19goto :eof
20
21:stat
22echo ---- TX statistics ---
23call :diag tx
24echo ---- RX statistics ---
25call :diag rx
26echo ---- RSS statistics --
27call :diag rss
28goto :eof
29
30:tx
31call :diag tx
32goto :eof
33
34:rx
35call :diag rx
36goto :eof
37
38:reset
39set resettype=7
40if "%2"=="rx" set resettype=1
41if "%2"=="tx" set resettype=2
42if "%2"=="rss" set resettype=4
43echo resetting type %resettype%...
44call :dowmic netkvm_diagreset set type=%resettype%
45goto :eof
46
47:rss
48call :diag rss
49goto :eof
50
51:rss_set
52if "%2"=="" goto rss
53call :dowmic NetKvm_DeviceRss set value=%2
54goto :eof
55
56:diag
57call :dowmic netkvm_diag get %1 /value
58goto :eof
59
60:dowmic
61::echo executing %*
62wmic /namespace:\\root\wmi path %* | findstr /v __ | findstr /v /r ^^^$
63goto :eof
64
65:help
66echo Example of WMI controls to NetKvm
67echo %~nx0 command parameter
68echo debug level Controls debug level (use level 0..5)
69echo cfg Retrieves current configuration
70echo stat Retrieves all internal statistics
71echo tx Retrieves internal statistics for transmit
72echo rx Retrieves internal statistics for receive
73echo rss Retrieves internal statistics for RSS
74echo rss 0/1 Disable/enable RSS device support
75echo reset [tx^|rs^|rss] Resets internal statistics(default=all)
76goto :eof
77
78