From b39cb830af450db5bb84ff058d513fa32198dc46 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Tue, 10 Jul 2018 16:10:38 +0000
Subject: [PATCH] Upgrade invalid -e kvm= argument to a fatal error

* filter_qualify.c (qualify_kvm): Call error_msg_and_die instead of
error_msg in case of invalid -e kvm= argument.
* tests/options-syntax.test: Check it.
---
 filter_qualify.c          | 2 +-
 tests/options-syntax.test | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/filter_qualify.c b/filter_qualify.c
index e28c6729..95b67e99 100644
--- a/filter_qualify.c
+++ b/filter_qualify.c
@@ -415,7 +415,7 @@ qualify_kvm(const char *const str)
 		else
 			error_msg("-e kvm=vcpu option needs Linux 4.16.0 or higher");
 	} else {
-		error_msg("unknown value for -e kvm= option: %s", str);
+		error_msg_and_die("invalid -e kvm= argument: '%s'", str);
 	}
 }
 #endif
diff --git a/tests/options-syntax.test b/tests/options-syntax.test
index 1a290d01..28762bc5 100755
--- a/tests/options-syntax.test
+++ b/tests/options-syntax.test
@@ -66,6 +66,7 @@ check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e
 check_h "incorrect personality designator '42' in qualification '23@42'" -e trace=23@42,123
 
 check_e "invalid system call '/getcwd@ohmy'" -e trace=/getcwd@ohmy
+check_e "invalid -e kvm= argument: 'chdir'" -e kvm=chdir
 
 case "$STRACE_NATIVE_ARCH" in
 x86_64)
-- 
2.40.0