mirror of https://gitee.com/openkylin/qemu.git
pc, virtio bugfixes for 2.3
Several bugfixes, nothing stands out especially. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJVEq0iAAoJECgfDbjSjVRplKAH/i8CIjI5mQPNzHGmSfLOafWq 5GeCeJS3JJWg4u3+lx/gzhLEYex2HxGVGxawWu6UsMH5qAJdmaACpeL2ryyBCqvY 3ba5w/Ku/ykIGlhKsEBBbd4+iDxrrLq3A5N0rl1KLptJpQdVw5XjC9u8sbaHYhEe MSm19azPVxG/ARfRO1cKKiJmkKNa6XhI8x92a6awo14gOzVwVZDUktjoFDT/Zmtn UocyMgDC75kF9Z48NsZmHOIFLhu6TkdsW5DwAJSSPHV/9pVzvlKnx6VPfiOkqVFQ pGnMsC7YanjrEcm0ZbagGKiPqc1uPyjtos34Fob+nsyNn2eqx5D1LPbjmll9BBo= =YHPl -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging pc, virtio bugfixes for 2.3 Several bugfixes, nothing stands out especially. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Wed Mar 25 12:42:10 2015 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: virtio-net: validate backend queue numbers against bus limitation virtio-serial: fix virtio config size acpi: Add missing GCC_FMT_ATTR to local function Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
087c4c9419
|
@ -68,7 +68,7 @@ build_append_nameseg(GArray *array, const char *seg)
|
||||||
g_array_append_vals(array, "____", ACPI_NAMESEG_LEN - len);
|
g_array_append_vals(array, "____", ACPI_NAMESEG_LEN - len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void GCC_FMT_ATTR(2, 0)
|
||||||
build_append_namestringv(GArray *array, const char *format, va_list ap)
|
build_append_namestringv(GArray *array, const char *format, va_list ap)
|
||||||
{
|
{
|
||||||
/* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
|
/* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
|
||||||
|
|
|
@ -980,8 +980,10 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We don't support emergency write, skip it for now. */
|
||||||
|
/* TODO: cleaner fix, depending on host features. */
|
||||||
virtio_init(vdev, "virtio-serial", VIRTIO_ID_CONSOLE,
|
virtio_init(vdev, "virtio-serial", VIRTIO_ID_CONSOLE,
|
||||||
sizeof(struct virtio_console_config));
|
offsetof(struct virtio_console_config, emerg_wr));
|
||||||
|
|
||||||
/* Spawn a new virtio-serial bus on which the ports will ride as devices */
|
/* Spawn a new virtio-serial bus on which the ports will ride as devices */
|
||||||
qbus_create_inplace(&vser->bus, sizeof(vser->bus), TYPE_VIRTIO_SERIAL_BUS,
|
qbus_create_inplace(&vser->bus, sizeof(vser->bus), TYPE_VIRTIO_SERIAL_BUS,
|
||||||
|
|
|
@ -1588,6 +1588,13 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
|
||||||
virtio_init(vdev, "virtio-net", VIRTIO_ID_NET, n->config_size);
|
virtio_init(vdev, "virtio-net", VIRTIO_ID_NET, n->config_size);
|
||||||
|
|
||||||
n->max_queues = MAX(n->nic_conf.peers.queues, 1);
|
n->max_queues = MAX(n->nic_conf.peers.queues, 1);
|
||||||
|
if (n->max_queues * 2 + 1 > VIRTIO_PCI_QUEUE_MAX) {
|
||||||
|
error_setg(errp, "Invalid number of queues (= %" PRIu32 "), "
|
||||||
|
"must be a postive integer less than %d.",
|
||||||
|
n->max_queues, (VIRTIO_PCI_QUEUE_MAX - 1) / 2);
|
||||||
|
virtio_cleanup(vdev);
|
||||||
|
return;
|
||||||
|
}
|
||||||
n->vqs = g_malloc0(sizeof(VirtIONetQueue) * n->max_queues);
|
n->vqs = g_malloc0(sizeof(VirtIONetQueue) * n->max_queues);
|
||||||
n->vqs[0].rx_vq = virtio_add_queue(vdev, 256, virtio_net_handle_rx);
|
n->vqs[0].rx_vq = virtio_add_queue(vdev, 256, virtio_net_handle_rx);
|
||||||
n->curr_queues = 1;
|
n->curr_queues = 1;
|
||||||
|
|
Loading…
Reference in New Issue