qemu-patch-raspberry4/hw/virtio
Luiz Capitulino 46abb81240 balloon: improve error msg when adding second device
A VM supports only one balloon device, but due to several changes
in infrastructure the error message got messed up when trying
to add a second device. Fix it.

Before this fix

Command-line:

qemu-qmp: -device virtio-balloon-pci,id=balloon0: Another balloon device already registered
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Adding balloon handler failed
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Device 'virtio-balloon-pci' could not be initialized

HMP:

Another balloon device already registered
Adding balloon handler failed
Device 'virtio-balloon-pci' could not be initialized

QMP:

{ "execute": "device_add", "arguments": { "driver": "virtio-balloon-pci", "id": "balloon0" } }
{
	"error": {
		"class": "GenericError",
		"desc": "Adding balloon handler failed"
	}
}

After this fix

Command-line:

qemu-qmp: -device virtio-balloon-pci,id=balloon0: Only one balloon device is supported
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Device 'virtio-balloon-pci' could not be initialized

HMP:

(qemu) device_add virtio-balloon-pci,id=balloon0
Only one balloon device is supported
Device 'virtio-balloon-pci' could not be initialized
(qemu)

QMP:

{ "execute": "device_add",
          "arguments": { "driver": "virtio-balloon-pci", "id": "balloon0" } }
{
    "error": {
        "class": "GenericError",
        "desc": "Only one balloon device is supported"
    }
}

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-04-24 14:18:05 -04:00
..
dataplane
Makefile.objs
vhost-backend.c vhost: Remove superfluous '\n' around error_report() 2015-03-10 08:15:33 +03:00
vhost-user.c
vhost.c vhost: fix log base address 2015-04-20 09:27:01 +01:00
virtio-balloon.c balloon: improve error msg when adding second device 2015-04-24 14:18:05 -04:00
virtio-bus.c
virtio-mmio.c
virtio-pci.c virtio-pci: Convert to realize() 2015-03-11 18:24:13 +01:00
virtio-pci.h virtio-pci: Convert to realize() 2015-03-11 18:24:13 +01:00
virtio-rng.c
virtio.c virtio: validate the existence of handle_output before calling it 2015-03-16 15:29:51 +01:00