qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Monitor command pci_add regressed (qdev)
@ 2009-06-10 17:43 Markus Armbruster
  2009-06-12  8:52 ` Gerd Hoffmann
  2009-06-16 14:24 ` [Qemu-devel] [PATCH] qdev: Fix regression in "pci_add ... storage if=virtio, ..." Markus Armbruster
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Armbruster @ 2009-06-10 17:43 UTC (permalink / raw)
  To: qemu-devel, paul

gdb --args qemu -monitor stdio tmp.qcow2 -S
[...]
QEMU 0.10.50 monitor - type 'help' for more information
(qemu) pci_add pci_addr=auto storage if=virtio,file=foo.img
Program received signal SIGSEGV, Segmentation fault.
0x080630c5 in virtio_blk_init (dev=0x849a008)
    at /home/armbru/work/qemu/hw/virtio-blk.c:368
368         bs->private = dev;

This used to work just fine.

Culprit seems to be commit 07e3af9a.  qdev_init_bdrv() fails, and
virtio_blk_init() doesn't check the failure.

I haven't investigated why qdev_init_bdrv() fails (the old code got the
BlockDriverState just fine).  Regardless, there are scenarios where
qdev_init_bdrv() rightly fails, so virtio_blk_init() needs fixing.

Returning NULL would be easy enough, but its caller
virtio_blk_init_pci() doesn't check its value, and it is a qdev init()
callback, which can't fail.  How to handle the error?  exit(1) would be
just fine for -drive, but not for a monitor command.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-16 21:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-10 17:43 [Qemu-devel] Monitor command pci_add regressed (qdev) Markus Armbruster
2009-06-12  8:52 ` Gerd Hoffmann
2009-06-16 14:24 ` [Qemu-devel] [PATCH] qdev: Fix regression in "pci_add ... storage if=virtio, ..." Markus Armbruster
2009-06-16 20:58   ` Gerd Hoffmann

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).