qdev: show name of device that fails init
PATCH 1/2 qdev: show name of device that fails init
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 <[email protected]>
--- hw/qdev.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
hw/qdev.c +1 -0
@@ -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 ; }
Signature · 1 line
1.6.2.5
PATCH 2/2 virtio-pci: return error if virtio_console_init fails
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 <[email protected]>
--- hw/virtio-pci.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
hw/virtio-pci.c +3 -0
@@ -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,
Signature · 1 line
1.6.2.5