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 <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
		
							parent
							
								
									c8cd1fcd66
								
							
						
					
					
						commit
						25fe365483
					
				@ -473,6 +473,9 @@ static int virtio_console_init_pci(PCIDevice *pci_dev)
 | 
				
			|||||||
        proxy->class_code = PCI_CLASS_COMMUNICATION_OTHER;
 | 
					        proxy->class_code = PCI_CLASS_COMMUNICATION_OTHER;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vdev = virtio_console_init(&pci_dev->qdev);
 | 
					    vdev = virtio_console_init(&pci_dev->qdev);
 | 
				
			||||||
 | 
					    if (!vdev) {
 | 
				
			||||||
 | 
					        return -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    virtio_init_pci(proxy, vdev,
 | 
					    virtio_init_pci(proxy, vdev,
 | 
				
			||||||
                    PCI_VENDOR_ID_REDHAT_QUMRANET,
 | 
					                    PCI_VENDOR_ID_REDHAT_QUMRANET,
 | 
				
			||||||
                    PCI_DEVICE_ID_VIRTIO_CONSOLE,
 | 
					                    PCI_DEVICE_ID_VIRTIO_CONSOLE,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user