Received: from eggs.gnu.org ([2001:4830:134:3::10]:47471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGr68-0006ju-1H for qemu-devel@nongnu.org; Thu, 29 Jan 2015 10:33:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGr63-0000sz-Rq for qemu-devel@nongnu.org; Thu, 29 Jan 2015 10:33:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGr63-0000sv-Ji for qemu-devel@nongnu.org; Thu, 29 Jan 2015 10:33:31 -0500 From: Markus Armbruster References: <87egqd39tf.fsf@blackfin.pond.sub.org> Date: Thu, 29 Jan 2015 16:33:25 +0100 In-Reply-To: (Stefano Stabellini's message of "Thu, 29 Jan 2015 15:23:11 +0000") Message-ID: <87wq45zjne.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] -device xen-platform crashes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: qemu-devel@nongnu.org Stefano Stabellini writes: > On Thu, 29 Jan 2015, Markus Armbruster wrote: >> Reproducer: qemu -nodefaults -S -display none -device xen-platform >> >> Yes, xen-platform makes no sense without Xen, but it shouldn't crash. > > Is it just a matter of doing the following? > > diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c > index 28b324a..40ae1f3 100644 > --- a/hw/i386/xen/xen_platform.c > +++ b/hw/i386/xen/xen_platform.c > @@ -177,6 +177,10 @@ static void platform_fixed_ioport_writeb(void *opaque, uint32_t addr, uint32_t v > { > PCIXenPlatformState *s = opaque; > > + if (!xen_enabled()) { > + return; > + } > + > switch (addr) { > case 0: /* Platform flags */ { > hvmmem_type_t mem_type = (val & PFFLAG_ROM_LOCK) ? Fixes the crash for me. Should Xen-only devices fail to realize when !xen_enabled()?