From: Simon Horman Subject: Re: [PATCH 3/5] Fixup dummy cpu setup. Date: Sat, 21 Mar 2009 09:41:54 +1100 Message-ID: <20090320224154.GA2799@verge.net.au> References: <1237564971-16188-1-git-send-email-kraxel@redhat.com> <1237564971-16188-4-git-send-email-kraxel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1237564971-16188-4-git-send-email-kraxel@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Gerd Hoffmann Cc: xen-devel@lists.xensource.com, Ian.Jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, Mar 20, 2009 at 05:02:49PM +0100, Gerd Hoffmann wrote: > Passing NULL to cpu_init() doesn't work in upstream qemu. > Also make sure the dummy cpu is in halted mode. > > Signed-off-by: Gerd Hoffmann > --- > hw/xen_machine_pv.c | 10 +++++++++- > 1 files changed, 9 insertions(+), 1 deletions(-) > > diff --git a/hw/xen_machine_pv.c b/hw/xen_machine_pv.c > index 624d8dd..df28be9 100644 > --- a/hw/xen_machine_pv.c > +++ b/hw/xen_machine_pv.c > @@ -51,7 +51,15 @@ static void xen_init_pv(ram_addr_t ram_size, int vga_ram_size, > #endif > > /* Initialize a dummy CPU */ > - env = cpu_init(NULL); > + if (cpu_model == NULL) { > +#ifdef TARGET_X86_64 > + cpu_model = "qemu64"; > +#else > + cpu_model = "qemu32"; > +#endif > + } > + env = cpu_init(cpu_model); > + env->halted = 1; > > /* Initialize backend core & drivers */ > if (-1 == xen_be_init()) { Is there a way to achieve this without ifdef nastiness? -- Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en