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) ? > Backtrace: > > #0 0x00007fffef5a677c in hypercall_buffer_cache_lock () > from /lib64/libxenctrl.so.4.3 > #1 0x00007fffef5a68f1 in xc.hypercall_buffer_alloc_pages () > from /lib64/libxenctrl.so.4.3 > #2 0x00007fffef5a6a61 in xc.hypercall_buffer_alloc () > from /lib64/libxenctrl.so.4.3 > #3 0x00007fffef59da54 in xc_hvm_set_mem_type () from /lib64/libxenctrl.so.4.3 > #4 0x00005555556d5bcd in platform_fixed_ioport_writeb > (opaque=0x5555564713b0, > addr=0, val=0) at /work/armbru/qemu/hw/i386/xen/xen_platform.c:184 > #5 0x00005555556d5ca4 in platform_fixed_ioport_reset (opaque=0x5555564713b0) > at /work/armbru/qemu/hw/i386/xen/xen_platform.c:238 > #6 0x00005555556d608c in platform_reset (dev=0x5555564713b0) > at /work/armbru/qemu/hw/i386/xen/xen_platform.c:417 > #7 0x00005555557e915b in device_reset (dev=0x5555564713b0) > at /work/armbru/qemu/hw/core/qdev.c:1269 > #8 0x00005555557e6a7b in qdev_reset_one (dev=0x5555564713b0, opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:329 > #9 0x00005555557e7608 in qdev_walk_children (dev=0x5555564713b0, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f <qdev_reset_one>, > post_busfn=0x5555557e6a82 <qbus_reset_one>, opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:643 > #10 0x00005555557e74fb in qbus_walk_children (bus=0x5555563b1f00, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f <qdev_reset_one>, > post_busfn=0x5555557e6a82 <qbus_reset_one>, opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:601 > #11 0x00005555557e75cc in qdev_walk_children (dev=0x5555563d67d0, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f <qdev_reset_one>, > post_busfn=0x5555557e6a82 <qbus_reset_one>, opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:635 > #12 0x00005555557e74fb in qbus_walk_children (bus=0x5555563bd3c0, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f <qdev_reset_one>, > post_busfn=0x5555557e6a82 <qbus_reset_one>, opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:601 > #13 0x00005555557e6b57 in qbus_reset_all (bus=0x5555563bd3c0) > at /work/armbru/qemu/hw/core/qdev.c:350 > #14 0x00005555557e6b79 in qbus_reset_all_fn (opaque=0x5555563bd3c0) > at /work/armbru/qemu/hw/core/qdev.c:356 > #15 0x00005555557587b9 in qemu_devices_reset () at /work/armbru/qemu/vl.c:1614 > #16 0x0000555555758845 in qemu_system_reset (report=false) > at /work/armbru/qemu/vl.c:1627 > #17 0x0000555555760739 in main (argc=7, argv=0x7fffffffe0f8, > envp=0x7fffffffe138) at /work/armbru/qemu/vl.c:4315 > > Sorry, no libxenctrl symbols installed. >