From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH v2 4/5] disallow kqemu if we fail to load it.
Date: Fri, 17 Apr 2009 17:00:07 -0400 [thread overview]
Message-ID: <1240002008-2351-5-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1240002008-2351-4-git-send-email-glommer@redhat.com>
Since we're not retrying it anyway, set kqemu_allowed = 0
if we fail to load it. It will allow us to test for kqemu
runtime presence where we don't have an env pointer, possibly
because we don't have a cpu yet.
The monitor code is such an example.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
kqemu.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/kqemu.c b/kqemu.c
index 040e817..e0e0499 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -179,14 +179,14 @@ int kqemu_init(CPUState *env)
if (kqemu_fd == KQEMU_INVALID_FD) {
fprintf(stderr, "Could not open '%s' - QEMU acceleration layer not activated: %lu\n",
KQEMU_DEVICE, GetLastError());
- return -1;
+ goto out;
}
#else
kqemu_fd = open(KQEMU_DEVICE, O_RDWR);
if (kqemu_fd == KQEMU_INVALID_FD) {
fprintf(stderr, "Could not open '%s' - QEMU acceleration layer not activated: %s\n",
KQEMU_DEVICE, strerror(errno));
- return -1;
+ goto out;
}
#endif
version = 0;
@@ -239,6 +239,8 @@ int kqemu_init(CPUState *env)
fail:
kqemu_closefd(kqemu_fd);
kqemu_fd = KQEMU_INVALID_FD;
+ out:
+ kqemu_allowed = 0;
return -1;
}
kqemu_update_cpuid(env);
--
1.5.6.6
next prev parent reply other threads:[~2009-04-17 21:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 21:00 [Qemu-devel] [PATCH v2 0/5] CPU Hotplug v2 Glauber Costa
2009-04-17 21:00 ` [Qemu-devel] [PATCH v2 1/5] split pc_new_cpu Glauber Costa
2009-04-17 21:00 ` [Qemu-devel] [PATCH v2 2/5] always have apic Glauber Costa
2009-04-17 21:00 ` [Qemu-devel] [PATCH v2 3/5] Fix warnings and errors with DEBUG enabled Glauber Costa
2009-04-17 21:00 ` Glauber Costa [this message]
2009-04-17 21:00 ` [Qemu-devel] [PATCH v2 5/5] enable cpu hotplug Glauber Costa
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=1240002008-2351-5-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).