public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kvm tool: Report error and don't segfault if kvm__init() fails
@ 2012-02-06  3:09 Michael Ellerman
  2012-02-06  3:09 ` [PATCH 2/2] kvm tool: Initialise kvm fd's to -1 in kvm__new() Michael Ellerman
  2012-02-06 10:22 ` [PATCH 1/2] kvm tool: Report error and don't segfault if kvm__init() fails Pekka Enberg
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Ellerman @ 2012-02-06  3:09 UTC (permalink / raw)
  To: kvm; +Cc: penberg

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 tools/kvm/builtin-run.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index 95d35a5..569246e 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -997,6 +997,11 @@ static int kvm_cmd_run_init(int argc, const char **argv)
 	}
 
 	kvm = kvm__init(dev, hugetlbfs_path, ram_size, guest_name);
+	if (IS_ERR(kvm)) {
+		r = PTR_ERR(kvm);
+		pr_err("kvm__init() failed with error %d\n", r);
+		goto fail;
+	}
 
 	kvm->single_step = single_step;
 
-- 
1.7.7.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-06 11:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06  3:09 [PATCH 1/2] kvm tool: Report error and don't segfault if kvm__init() fails Michael Ellerman
2012-02-06  3:09 ` [PATCH 2/2] kvm tool: Initialise kvm fd's to -1 in kvm__new() Michael Ellerman
2012-02-06 10:22 ` [PATCH 1/2] kvm tool: Report error and don't segfault if kvm__init() fails Pekka Enberg
2012-02-06 10:27   ` Cyrill Gorcunov
2012-02-06 11:35   ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox