mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
virtio-balloon: Check if balloon registration failed
Multiple balloon registrations are not allowed; check if the registration with the qemu balloon api succeeded. If not, fail the device init. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
6c6ec1821a
commit
f76f665547
2 changed files with 11 additions and 1 deletions
|
@ -788,6 +788,9 @@ static int virtio_balloon_init_pci(PCIDevice *pci_dev)
|
|||
VirtIODevice *vdev;
|
||||
|
||||
vdev = virtio_balloon_init(&pci_dev->qdev);
|
||||
if (!vdev) {
|
||||
return -1;
|
||||
}
|
||||
virtio_init_pci(proxy, vdev);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue