public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Yang Bai <hamo.by@gmail.com>
To: penberg@kernel.org
Cc: kvm@vger.kernel.org, Yang Bai <hamo.by@gmail.com>
Subject: [PATCH 1/4] kvm tool: Stop init if check_extensions failed
Date: Fri, 10 Feb 2012 17:55:33 +0800	[thread overview]
Message-ID: <1328867736-4394-1-git-send-email-hamo.by@gmail.com> (raw)

If kvm__check_extensions found that some of the required
KVM extention is not supported by OS, we should stop the
init and free all allocated resources.

Signed-off-by: Yang Bai <hamo.by@gmail.com>
---
 tools/kvm/kvm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
index 9a0bd67..8e749ad 100644
--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -384,6 +384,7 @@ struct kvm *kvm__init(const char *kvm_dev, const char *hugetlbfs_path, u64 ram_s
 	if (kvm__check_extensions(kvm)) {
 		pr_err("A required KVM extention is not supported by OS");
 		ret = -ENOSYS;
+		goto err;
 	}
 
 	kvm__arch_init(kvm, hugetlbfs_path, ram_size);
-- 
1.7.8.3


             reply	other threads:[~2012-02-10  9:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10  9:55 Yang Bai [this message]
2012-02-10  9:55 ` [PATCH 2/4] kvm tool: unite the error handle in kvm__init Yang Bai
2012-02-10  9:55 ` [PATCH 3/4] kvm tool: if kvm_ipc__start failed, return negative Yang Bai
2012-02-10  9:55 ` [PATCH 4/4] kvm tool: ensure kvm_ipc__register_handler success Yang Bai
2012-02-10 11:38 ` [PATCH 1/4] kvm tool: Stop init if check_extensions failed Pekka Enberg

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=1328867736-4394-1-git-send-email-hamo.by@gmail.com \
    --to=hamo.by@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=penberg@kernel.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox