aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-serial-bus.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-04-27 18:04:03 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2010-04-28 08:58:21 -0500
commit4048c7c321d3029e8c41863a9f54dc39054c57ca (patch)
tree733b70bb0807112738c0cc4f3555f3bf92bb1ee1 /hw/virtio-serial-bus.c
parent71c092e92b45e7ebc762c8736089c074097548d3 (diff)
virtio-serial: Propagate errors in initialising ports / devices in guest
If adding of ports or devices in the guest fails we can send out a QMP event so that management software can deal with it. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-serial-bus.c')
-rw-r--r--hw/virtio-serial-bus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index c77ea4feff..3a09f0d3c6 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -223,6 +223,11 @@ static void handle_control_message(VirtIOSerial *vser, void *buf)
switch(cpkt.event) {
case VIRTIO_CONSOLE_DEVICE_READY:
+ if (!cpkt.value) {
+ error_report("virtio-serial-bus: Guest failure in adding device %s\n",
+ vser->bus->qbus.name);
+ break;
+ }
/*
* The device is up, we can now tell the device about all the
* ports we have here.
@@ -233,6 +238,11 @@ static void handle_control_message(VirtIOSerial *vser, void *buf)
break;
case VIRTIO_CONSOLE_PORT_READY:
+ if (!cpkt.value) {
+ error_report("virtio-serial-bus: Guest failure in adding port %u for device %s\n",
+ port->id, vser->bus->qbus.name);
+ break;
+ }
/*
* Now that we know the guest asked for the port name, we're
* sure the guest has initialised whatever state is necessary