aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-serial-bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio-serial-bus.c')
-rw-r--r--hw/virtio-serial-bus.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 6d7338644..c5eb93109 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -104,7 +104,7 @@ static size_t write_to_port(VirtIOSerialPort *port,
}
len = iov_from_buf(elem.in_sg, elem.in_num,
- buf + offset, size - offset);
+ buf + offset, 0, size - offset);
offset += len;
virtqueue_push(vq, &elem, len);
@@ -668,20 +668,22 @@ static struct BusInfo virtser_bus_info = {
.name = "virtio-serial-bus",
.size = sizeof(VirtIOSerialBus),
.print_dev = virtser_bus_dev_print,
+ .props = (Property[]) {
+ DEFINE_PROP_UINT32("nr", VirtIOSerialPort, id, VIRTIO_CONSOLE_BAD_ID),
+ DEFINE_PROP_STRING("name", VirtIOSerialPort, name),
+ DEFINE_PROP_END_OF_LIST()
+ }
};
static void virtser_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent)
{
VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, qdev);
- monitor_printf(mon, "%*s dev-prop-int: id: %u\n",
- indent, "", port->id);
- monitor_printf(mon, "%*s dev-prop-int: guest_connected: %d\n",
- indent, "", port->guest_connected);
- monitor_printf(mon, "%*s dev-prop-int: host_connected: %d\n",
- indent, "", port->host_connected);
- monitor_printf(mon, "%*s dev-prop-int: throttled: %d\n",
- indent, "", port->throttled);
+ monitor_printf(mon, "%*sport %d, guest %s, host %s, throttle %s\n",
+ indent, "", port->id,
+ port->guest_connected ? "on" : "off",
+ port->host_connected ? "on" : "off",
+ port->throttled ? "on" : "off");
}
/* This function is only used if a port id is not provided by the user */