[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 4/4] hw: convert virtio-input-hid device to k
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v7 4/4] hw: convert virtio-input-hid device to keycodemapdb |
Date: |
Thu, 25 Jan 2018 16:16:19 +0100 |
User-agent: |
NeoMutt/20171215 |
Hi,
> If the guest OS reboots, or otherwise re-initializes the virt-input device,
> it will read the new keycode bitmap. No matter how many keys are defined,
> the config space has a fixed 128 byte bitmap. There is, however, a size
> field defiend which says how many bytes in the bitmap are used.
No. There is a size field saying how big the bitmap is. config space
(as in: virtio device config space) is only as big as is actually
needed, i.e. basically the highest set bit of the bitmap determines the
config space size.
Debug patch ...
--- a/hw/input/virtio-input.c
+++ b/hw/input/virtio-input.c
@@ -255,6 +255,8 @@ static void virtio_input_device_realize(DeviceState
*dev, Error **errp)
}
vinput->cfg_size += 8;
assert(vinput->cfg_size <= sizeof(virtio_input_config));
+ fprintf(stderr, "%s: %s: %d bytes cfg space\n", __func__,
+ object_get_typename(OBJECT(dev)), vinput->cfg_size);
virtio_init(vdev, "virtio-input", VIRTIO_ID_INPUT,
vinput->cfg_size);
... prints this without the patch ...
virtio_input_device_realize: virtio-keyboard-device: 29 bytes cfg space
... and this with the patch:
virtio_input_device_realize: virtio-keyboard-device: 37 bytes cfg space
That seems to not have any bad side effects on live migration though.
I can vmsave with unpatched qemu and vmload with patched qemu (and visa
versa).
Agreeing with the analysis that guests should cope with the change just
fine, worst case being that the newly added keys are not working on
updated qemu without guest reboot.
So I think we can go forward with this one without breaking anything.
thanks,
Gerd