Blame 0001-virtio-serial-fix-virtio-config-size.patch

355b03
From: "Michael S. Tsirkin" <mst@redhat.com>
355b03
Date: Wed, 25 Mar 2015 12:41:26 +0100
355b03
Subject: [PATCH] virtio-serial: fix virtio config size
355b03
355b03
commit 9b70c1790acacae54d559d38ca69186a85040bb8
355b03
    virtio-serial: switch to standard-headers
355b03
355b03
changes virtio_console_config size from 8 to 12 bytes:
355b03
it adds an optional 4 byte emerg_wr field.
355b03
355b03
As this crosses a power of two boundary, this changes the PCI BAR size,
355b03
which breaks migration compatibility with old qemu machine types.
355b03
It's probably a problem for other transports as well.
355b03
355b03
As a temporary fix, as we don't yet support this new field anyway,
355b03
simply make the config size smaller at init time.
355b03
355b03
Long terms we probably want something along the lines
355b03
of virtio_net_set_config_size.
355b03
355b03
Reported-by: Cole Robinson <crobinso@redhat.com>
355b03
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
355b03
Message-Id: <1427283599-12789-1-git-send-email-mst@redhat.com>
355b03
---
355b03
 hw/char/virtio-serial-bus.c | 4 +++-
355b03
 1 file changed, 3 insertions(+), 1 deletion(-)
355b03
355b03
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
355b03
index d14e872..e336bdb 100644
355b03
--- a/hw/char/virtio-serial-bus.c
355b03
+++ b/hw/char/virtio-serial-bus.c
355b03
@@ -980,8 +980,10 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp)
355b03
         return;
355b03
     }
355b03
 
355b03
+    /* We don't support emergency write, skip it for now. */
355b03
+    /* TODO: cleaner fix, depending on host features. */
355b03
     virtio_init(vdev, "virtio-serial", VIRTIO_ID_CONSOLE,
355b03
-                sizeof(struct virtio_console_config));
355b03
+                offsetof(struct virtio_console_config, emerg_wr));
355b03
 
355b03
     /* Spawn a new virtio-serial bus on which the ports will ride as devices */
355b03
     qbus_create_inplace(&vser->bus, sizeof(vser->bus), TYPE_VIRTIO_SERIAL_BUS,