From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org, paul@codesourcery.com
Subject: [Qemu-devel] Monitor command pci_add regressed (qdev)
Date: Wed, 10 Jun 2009 19:43:29 +0200 [thread overview]
Message-ID: <87bpowhtmm.fsf@pike.pond.sub.org> (raw)
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.
next reply other threads:[~2009-06-10 17:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 17:43 Markus Armbruster [this message]
2009-06-12 8:52 ` [Qemu-devel] Monitor command pci_add regressed (qdev) 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
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=87bpowhtmm.fsf@pike.pond.sub.org \
--to=armbru@redhat.com \
--cc=paul@codesourcery.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.