diff options
-rwxr-xr-x | tools/kvm/kvm_stat/kvm_stat | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat index 90f0445d7808..29c56f3a05dc 100755 --- a/tools/kvm/kvm_stat/kvm_stat +++ b/tools/kvm/kvm_stat/kvm_stat | |||
@@ -1521,6 +1521,13 @@ Press any other key to refresh statistics immediately. | |||
1521 | callback=cb_guest_to_pid, | 1521 | callback=cb_guest_to_pid, |
1522 | ) | 1522 | ) |
1523 | (options, _) = optparser.parse_args(sys.argv) | 1523 | (options, _) = optparser.parse_args(sys.argv) |
1524 | try: | ||
1525 | # verify that we were passed a valid regex up front | ||
1526 | re.compile(options.fields) | ||
1527 | except re.error: | ||
1528 | sys.exit('Error: "' + options.fields + '" is not a valid regular ' | ||
1529 | 'expression') | ||
1530 | |||
1524 | return options | 1531 | return options |
1525 | 1532 | ||
1526 | 1533 | ||