[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Monitor command pci_add regressed (qdev)
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] Monitor command pci_add regressed (qdev) |
Date: |
Wed, 10 Jun 2009 19:43:29 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
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.
- [Qemu-devel] Monitor command pci_add regressed (qdev),
Markus Armbruster <=