KVM Archive on lore.kernel.org
 help / color / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kvm <kvm@vger.kernel.org>
Subject: [PATCH] trace-cmd: Fix reporting of unknown SVM exit reasons
Date: Sun, 22 May 2016 18:02:31 +0200
Message-ID: <5741D817.3070902@web.de> (raw)

[-- Attachment #1.1: Type: text/plain, Size: 1065 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

On AMD, exist code -1 is also a possible value, but we use it for
terminating the list of known exit reasons. This leads to EXIT_ERR
being reported for unkown ones. Fix this by using an NULL string
pointer as terminal.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 plugin_kvm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugin_kvm.c b/plugin_kvm.c
index 15a6f4c..99e920f 100644
--- a/plugin_kvm.c
+++ b/plugin_kvm.c
@@ -208,12 +208,12 @@ struct str_values {
 
 static struct str_values vmx_exit_reasons[] = {
 	VMX_EXIT_REASONS
-	{ NULL, -1}
+	{ }
 };
 
 static struct str_values svm_exit_reasons[] = {
 	SVM_EXIT_REASONS
-	{ NULL, -1}
+	{ }
 };
 
 static struct isa_exit_reasons {
@@ -237,7 +237,7 @@ static const char *find_exit_reason(unsigned isa, int val)
 		}
 	if (!strings)
 		return "UNKNOWN-ISA";
-	for (i = 0; strings[i].val >= 0; i++)
+	for (i = 0; strings[i].str; i++)
 		if (strings[i].val == val)
 			break;
 
-- 
2.6.6


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-22 16:02 Jan Kiszka [this message]
2016-05-31 15:23 ` Steven Rostedt
2016-06-01 10:06   ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5741D817.3070902@web.de \
    --to=jan.kiszka@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org
	public-inbox-index kvm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git