All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ijc@hellion.org.uk>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 1/2] Generalize -machine command line option
Date: Wed, 25 May 2011 09:34:57 +0100	[thread overview]
Message-ID: <1306312497.20576.209.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <4DDCBC6A.1060107@siemens.com>

On Wed, 2011-05-25 at 10:23 +0200, Jan Kiszka wrote:
> On 2011-05-25 10:13, Ian Campbell wrote:
> > On Tue, 2011-05-24 at 18:18 +0200, Jan Kiszka wrote:
> >> On 2011-05-24 18:06, Ian Campbell wrote:
> >> Well, first of all I think this revealed a Xen bug because it crashes
> >> when you try to run xenfv with an inappropriate accelerator, no? What is
> >> the result of -machine xenfv,accel=tcg or, without my patch, -M xenfv
> >> -machine accel=tcg?
> > 
> > Unsurprisingly it crashed...
> > 
> > I'm not sure if this is a bug in the xen side of simply a case of
> > providing enough rope. I didn't really follow the threads which resulted
> > in the accel stuff all that closely so I'm not sure what the intention
> > was, it seems to me that the accel option is invalid with certain
> > machine types though.
> > 
> > I suppose in theory -machine xenpv,accel=kvm might result in xenner or
> > something, accel=xenpv,tcg I'm less sure about (perhaps xenner too?).
> > For -machine xenfv I don't expect anything other than accel=xen makes
> > much sense.
> 
> The point is that crashing is always a very poor way of reporting a
> misconfiguration to the user. I bet you are able to detect and report
> that more gracefully, e.g. during xenfv machine init.

ACK. How about:

8<------------------------------------

>From b23cadda8da72da480fe7cc8e31ffccd449f4b47 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Wed, 25 May 2011 09:32:07 +0100
Subject: [PATCH] Fail to initialise Xen HVM support gracefully if Xen acceleration not enabled.

This is preferable to the existing segmentation fault due to use of
uninitialised xen_xc context, this is normally inialisted in xen_init which is
not called if xen acceleration is not enabled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>
---
 xen-all.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen-all.c b/xen-all.c
index 377aff7..c04bcbf 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -783,6 +783,12 @@ int xen_hvm_init(void)
     unsigned long ioreq_pfn;
     XenIOState *state;
 
+    if (!xen_xc) {
+        errno = ENOTSUP;
+        perror("xen: xen hvm requires accel=xen");
+        return -errno;
+    }
+
     state = qemu_mallocz(sizeof (XenIOState));
 
     state->xce_handle = xen_xc_evtchn_open(NULL, 0);
-- 
1.7.2.5



-- 
Ian Campbell
Current Noise: Blind Melon - No Rain

Who are you?

  reply	other threads:[~2011-05-25 14:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 11:18 [Qemu-devel] [PATCH 1/2] Generalize -machine command line option Jan Kiszka
2011-05-22 11:00 ` [Qemu-devel] [PATCH v2 " Jan Kiszka
2011-05-24 16:06   ` Ian Campbell
2011-05-24 16:18     ` Jan Kiszka
2011-05-25  7:03       ` [Qemu-devel] [PATCH v3 " Jan Kiszka
2011-05-25  8:17         ` Ian Campbell
2011-06-07 15:58         ` Jan Kiszka
2011-05-25  8:13       ` [Qemu-devel] [PATCH v2 " Ian Campbell
2011-05-25  8:23         ` Jan Kiszka
2011-05-25  8:34           ` Ian Campbell [this message]
2011-05-25 10:54         ` Anthony PERARD
2011-05-26  9:04           ` Ian Campbell

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=1306312497.20576.209.camel@zakaz.uk.xensource.com \
    --to=ijc@hellion.org.uk \
    --cc=aliguori@us.ibm.com \
    --cc=anthony.perard@citrix.com \
    --cc=jan.kiszka@siemens.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.