* [Qemu-devel] [PATCH 1/2] qdev: show name of device that fails init
@ 2009-09-29 10:21 Amit Shah
2009-09-29 10:21 ` [Qemu-devel] [PATCH 2/2] virtio-pci: return error if virtio_console_init fails Amit Shah
0 siblings, 1 reply; 2+ messages in thread
From: Amit Shah @ 2009-09-29 10:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Amit Shah
When initialising a device fails, show the name of the failing device.
The current behaviour is to silently exit on such errors.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
hw/qdev.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index a589d72..a04fdb3 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -203,6 +203,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
return NULL;
}
if (qdev_init(qdev) != 0) {
+ qemu_error("Error initializing device %s\n", driver);
qdev_free(qdev);
return NULL;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH 2/2] virtio-pci: return error if virtio_console_init fails
2009-09-29 10:21 [Qemu-devel] [PATCH 1/2] qdev: show name of device that fails init Amit Shah
@ 2009-09-29 10:21 ` Amit Shah
0 siblings, 0 replies; 2+ messages in thread
From: Amit Shah @ 2009-09-29 10:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Amit Shah
Currently only one virtio_console device is supported. Trying to add
multiple devices fails and such failure should be reported back to the
qdev init functions.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
hw/virtio-pci.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index bd5a7c4..66967c6 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -470,6 +470,9 @@ static int virtio_console_init_pci(PCIDevice *pci_dev)
proxy->class_code = PCI_CLASS_COMMUNICATION_OTHER;
vdev = virtio_console_init(&pci_dev->qdev);
+ if (!vdev) {
+ return -1;
+ }
virtio_init_pci(proxy, vdev,
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_CONSOLE,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-29 10:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29 10:21 [Qemu-devel] [PATCH 1/2] qdev: show name of device that fails init Amit Shah
2009-09-29 10:21 ` [Qemu-devel] [PATCH 2/2] virtio-pci: return error if virtio_console_init fails Amit Shah
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).