All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
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	[thread overview]
Message-ID: <20180125151619.mywrqtexyvqqlcxj@sirius.home.kraxel.org> (raw)
In-Reply-To: <20180117164118.8510-5-berrange@redhat.com>

  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

  parent reply	other threads:[~2018-01-25 15:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 16:41 [Qemu-devel] [PATCH v7 0/4] Convert hw backends to use keycodemapdb Daniel P. Berrange
2018-01-17 16:41 ` [Qemu-devel] [PATCH v7 1/4] hw: convert ps2 device to keycodemapdb Daniel P. Berrange
2018-01-17 16:41 ` [Qemu-devel] [PATCH v7 2/4] hw: convert the escc " Daniel P. Berrange
2018-01-17 16:41 ` [Qemu-devel] [PATCH v7 3/4] ui: fix alphabetical ordering of keymaps Daniel P. Berrange
2018-01-19 12:21   ` Philippe Mathieu-Daudé
2018-01-17 16:41 ` [Qemu-devel] [PATCH v7 4/4] hw: convert virtio-input-hid device to keycodemapdb Daniel P. Berrange
2018-01-17 19:02   ` Eric Blake
2018-01-17 19:34     ` Michael S. Tsirkin
2018-01-25 15:16   ` Gerd Hoffmann [this message]
2018-01-25 15:25     ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180125151619.mywrqtexyvqqlcxj@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=berrange@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.